Vous êtes sur la page 1sur 6

Colegio Nacional de Educación Profesional Técnica del Estado de

Chihuahua

Elaboración y Mantenimiento de Sistemas de la Información

Practica#6

Generación de Códigos

Jesús Manuel Silva

Grupo: 6101-I

Matricula: 080260779-6
Objetivo: terminar con la codificación del sistema de información.

Material:

 Reportes

 Sistema de Información

Desarrollo:

1. Codificar los botones faltantes

2. Realizar el paso 4 del manual del sistema (formulario + código)

3. Probar que el sistema funcione correctamente

Formularios de selección de codigo

Public Class Form1


Private Sub RadioButton1_CheckedChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
RadioButton1.CheckedChanged
x = 2
End Sub

Private Sub RadioButton2_CheckedChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
RadioButton2.CheckedChanged
x = 1
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Me.Hide()
Conectar.Show()
End Sub
End Class

Formulario para registrar a un nuevo usuario

Public Class Registro


Dim dt As New DataTable
Dim cn As New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Sis
tema\Sistema\Sistema.mdb")
Private Sub Registro_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If (x = 2) Then
Label1.Text = ("Welcome to the registration of a new
account")
Label2.Text = ("Name")
Label3.Text = ("Last name")
Label4.Text = ("Mother's maiden name")
Label5.Text = ("Address")
Label6.Text = ("Birth date")
Label7.Text = ("Account Name")
Label8.Text = ("Password")
Button1.Text = ("Register")
Else
End If
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
cn.Open()
Dim GuardarDatos As String = "Insert Into
NuevosRegistros(Nombre,ApellidoM,ApellidoP,Domicilio,FechaNac,NombreCuent
a,Contraseña)" & " Values ('" & TextBox1.Text & "','" & TextBox2.Text &
"', '" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text &
"','" & TextBox6.Text & "','" & TextBox7.Text & "')"
Dim dataAdapter As New OleDb.OleDbDataAdapter(GuardarDatos, cn)
dataAdapter.Fill(dt)
If (x = 2) Then
MsgBox("The account was created correctly")
Else
MsgBox("La cuenta se creo correctamente")
End If
dataAdapter.Dispose()
cn.Close()
Me.Hide()
Conectar.Show()
End Sub
End Class

Formulario para registrar a un nuevo trabajador

Public Class Agregar


Dim dt As New DataTable
Dim cn As New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Sis
tema\Sistema\Sistema.mdb")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
cn.Open()
Dim GuardarDatos As String = "Insert Into
Altas(Nombre,ApellidoM,ApellidoP,Edad,SerieUnica,Telefono,Fechanac,Lugarn
ac,MotivoAlta)" & " Values ('" & TextBox1.Text & "','" & TextBox2.Text &
"', '" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text &
"','" & TextBox6.Text & "','" & TextBox7.Text & "','" & TextBox8.Text &
"','" & TextBox9.Text & "','" & TextBox10.Text & "')"
Dim dataAdapter As New OleDb.OleDbDataAdapter(GuardarDatos, cn)
dataAdapter.Fill(dt)
If (x = 2) Then
MsgBox("The account was created correctly")
Else
MsgBox("Data successfully added")
End If
dataAdapter.Dispose()
cn.Close()
Me.Close()
End Sub
End Class

Formulario de administrador, en el cual realizara tareas de modificacion, agregacion


y eliminacion de registros de datos (aun en codificacion)

Public Class Administrador


Dim dt As New DataTable
Dim cn As New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Sis
tema\Sistema\Sistema.mdb")
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
Me.Close()
End Sub

Private Sub Administrador_Load(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles MyBase.Load
Label2.Text = Name
If (x = 2) Then
Label1.Text = ("Welcome")
Label2.Text = ("Name")
Button1.Text = ("Modify")
Button2.Text = ("Add")
Button3.Text = ("Delete")
Button4.Text = ("Exit")
Else
End If
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Agregar.Show()
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
MsgBox("Seguro que desea continuar", MsgBoxStyle.OkCancel)
Serie.Show()
refrescar()
actualiza()
End Sub
End Class

Vous aimerez peut-être aussi