0% found this document useful (0 votes)
64 views32 pages

Conalep Cd. Juárez 1

The document contains code for a program with buttons that open different forms and menus when clicked. It includes code for buttons to open main menus, add/delete/modify data, navigate between records, and load and save data to a database. Methods are included to refresh and update the data displayed on the forms.

Uploaded by

TheDefjam
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views32 pages

Conalep Cd. Juárez 1

The document contains code for a program with buttons that open different forms and menus when clicked. It includes code for buttons to open main menus, add/delete/modify data, navigate between records, and load and save data to a database. Methods are included to refresh and update the data displayed on the forms.

Uploaded by

TheDefjam
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 32

Conalep Cd.

Jurez 1

Luis Carlos Castro Aguayo

090260351-3

Grupo: 5102

Fecha: 22/11/11

Manual De Programador

Botn Men Principal:


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Hide() Form6.Show() End Sub

Botn Salir:

Private Sub Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button.Click Me.Close() End Sub

Botn Men De Alumnos:


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Hide() Form2.Show()

End Sub

Botn Men De Maestros:


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Hide() Carlos_Menumaestros.Show() End Sub

Botn Men De Asignaturas:


Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Hide() MenuAsignaturas.Show() End Sub

Botn Men De Materias:


Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Me.Hide() Materias.Show() End Sub

Botn Men De Grupos:

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click Me.Hide() Grupos_Menu.Show() End Sub

Botn Altas:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Close() Form3.Show() End Sub

Botn Bajas:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If ((MsgBox("... Desea Eliminar ? " + CStr(TextBox1.Text), MsgBoxStyle.OkCancel, "Mensaje")) = 1) Then Dim strSQL As String = "DELETE FROM Alumnos WHERE Matricula='" & CStr(TextBox1.Text) & "';" Dim dataAdapter As New OleDb.OleDbDataAdapter(strSQL, cn) dataAdapter.Fill(dt) Refrescar() Actualiza() dataAdapter.Dispose() Else MsgBox("No se ha seleccionado registro a eliminar") End If End Sub

Botn Consultas:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() Form4.Show() End Sub

Botn Modificaciones:
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Me.Close() Form5.Show() End Sub

Botn Regresar:
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click Me.Close() Form1.Show() End Sub

Botn Anterior

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click If (fila > 0 And fila <= dt.Rows.Count - 1) Then fila = fila - 1 Actualiza() Else MsgBox("Primer Registro Encontrado", MsgBoxStyle.Information, "Mensaje") End If End Sub

Botn Siguiente:
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click If (fila >= 0 And fila < dt.Rows.Count - 1) Then fila = fila + 1 Actualiza() Else

MsgBox("Ultimo Registro Encontrado", MsgBoxStyle.Information, "Mensaje") End If

Metodo Actualizar:
Public Sub Actualiza() TextBox1.Text = TextBox2.Text = TextBox3.Text = TextBox4.Text = TextBox5.Text = TextBox6.Text = End Sub CInt(dt.Rows(fila)("Matricula")) CStr(dt.Rows(fila)("Nombre")) CStr(dt.Rows(fila)("Paterno")) CStr(dt.Rows(fila)("Materno")) CStr(dt.Rows(fila)("Direccion")) CStr(dt.Rows(fila)("Numgrup"))

End Sub

Metodo Refrescar:
Private Sub Refrescar() dt.Reset() fila = 0 Dim RefrescarDatos As String = "Select * from Alumnos" Dim dataAdapter As New OleDb.OleDbDataAdapter(RefrescarDatos, cn) dataAdapter.Fill(dt) Actualiza() dataAdapter.Dispose() End Sub

En el Form2:
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load dt.Reset() fila = 0 Dim RefrescarDatos As String = "Select * from Alumnos" Dim dataAdapter As New OleDb.OleDbDataAdapter(RefrescarDatos, cn) dataAdapter.Fill(dt) Actualiza() dataAdapter.Dispose() End Sub

Botn Guardar:
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 Alumnos(Matricula,Nombre,Paterno,Materno,Direccion,Numgrup)" & "Values('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & "')" Dim dataAdapter As New OleDb.OleDbDataAdapter(GuardarDatos, cn) dataAdapter.Fill(dt) MsgBox("Se Agrego registro Correctamente", MsgBoxStyle.Information, "Mensaje") ' Limpiar() dataAdapter.Dispose() cn.Close() End Sub

Botn Regresar Al Men Alumnos:


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() Form2.Show() End Sub

Botn Consultar:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click cn.Open() Dim strSQL As String = "Select * from Alumnos where Matricula= '" & (CInt(TextBox1.Text)) & "' " Dim dataAdapter As New OleDb.OleDbDataAdapter(strSQL, cn) dt.Reset() dataAdapter.Fill(dt) ' Limpiar() fila = 0

Botn Regresar Al Men Alumnos:


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() Form2.Show() End Sub

Actualiza() dataAdapter.Dispose() cn.Close() End Sub

Mtodo Actualizar:
Public Sub Actualiza() TextBox1.Text = TextBox2.Text = TextBox3.Text = TextBox4.Text = TextBox5.Text = TextBox6.Text = End Sub CInt(dt.Rows(fila)("Matricula")) CStr(dt.Rows(fila)("Nombre")) CStr(dt.Rows(fila)("Paterno")) CStr(dt.Rows(fila)("Materno")) CStr(dt.Rows(fila)("Direccion")) CStr(dt.Rows(fila)("Numgrup"))

Botn Buscar:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click cn.Open() Dim strSQL As String = "Select * from Alumnos where Matricula= '" & (CStr(TextBox1.Text)) & "' " Dim dataAdapter As New OleDb.OleDbDataAdapter(strSQL, cn) dt.Reset() dataAdapter.Fill(dt) ' Limpiar() fila = 0 Actualiza() dataAdapter.Dispose() cn.Close() End Sub

Botn Modificar:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click cn.Open() Dim ModificaDatos As String = "Update Alumnos set Matricula= '" & TextBox1.Text() & "', Nombre = '" & TextBox2.Text() & "' , Paterno ='" & TextBox3.Text() & "', Materno ='" & TextBox4.Text() & "', Direccion ='" & TextBox5.Text() & "', Numgrup ='" & TextBox6.Text() & "' where Matricula='" & CInt(TextBox1.Text()) & "'" Dim dataAdapter As New OleDb.OleDbDataAdapter(ModificaDatos, cn) dataAdapter.Fill(dt) dataAdapter.Dispose() MsgBox("Registro Modificado", MsgBoxStyle.Information, "Mensaje") cn.Close() End Sub

Botn Regresar Al Men Principal:

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() Form2.Show() End Sub

Mtodo Actualizar:
Public Sub Actualiza() TextBox1.Text = TextBox2.Text = TextBox3.Text = TextBox4.Text = TextBox5.Text = TextBox6.Text = End Sub CStr(dt.Rows(fila)("Matricula")) CStr(dt.Rows(fila)("Nombre")) CStr(dt.Rows(fila)("Paterno")) CStr(dt.Rows(fila)("Materno")) CStr(dt.Rows(fila)("Direccion")) CInt(dt.Rows(fila)("Numgrup"))

Botn Altas:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Close() Altas.Show() End Sub

Botn Bajas:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If ((MsgBox("... Desea Eliminar ? " + CStr(CarlosBox1.Text), MsgBoxStyle.OkCancel, "Mensaje")) = 1) Then Dim strSQL As String = "DELETE FROM Maestros WHERE Claveprofe=" & CInt(CarlosBox1.Text) Dim dataAdapter As New OleDb.OleDbDataAdapter(strSQL, cn) dataAdapter.Fill(dt) Refrescar() Actualiza() dataAdapter.Dispose() Else MsgBox("No se ha seleccionado registro a eliminar") End If End Sub

Botn Consultas:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() Modificaciones.Show() End Sub

Botn Modificaciones:
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Me.Close() Modifica.Show() End Sub

Botn Regresar:

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click Me.Close() Form1.Show() End Sub

Botn Anterior:
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click If (fila > 0 And fila <= dt.Rows.Count - 1) Then fila = fila - 1 Actualiza() Else MsgBox("Primer Registro Encontrado", MsgBoxStyle.Information, "Mensaje") End If End Sub

Botn Siguiente:
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click If (fila >= 0 And fila < dt.Rows.Count - 1) Then fila = fila + 1 Actualiza() Else MsgBox("Ultimo Registro Encontrado", MsgBoxStyle.Information, "Mensaje") End If End Sub

Mtodo Actualizar:
Public Sub Actualiza() CarlosBox1.Text CarlosBox2.Text CarlosBox3.Text CarlosBox4.Text CarlosBox5.Text CarlosBox6.Text End Sub = = = = = = CInt(dt.Rows(fila)("Claveprofe")) CStr(dt.Rows(fila)("Nombre")) CStr(dt.Rows(fila)("Paterno")) CStr(dt.Rows(fila)("Materno")) CStr(dt.Rows(fila)("Profesion")) CStr(dt.Rows(fila)("Fechanac"))

Mtodo Refrescar:

Private Sub Refrescar() dt.Reset() fila = 0 Dim RefrescarDatos As String = "Select * from Maestros" Dim dataAdapter As New OleDb.OleDbDataAdapter(RefrescarDatos, cn) dataAdapter.Fill(dt) Actualiza() dataAdapter.Dispose() End Sub

En El Formulario CarlosMenumaestros:
Private Sub Carlos_Menumaestros_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load dt.Reset() fila = 0 Dim RefrescarDatos As String = "Select * from Maestros" Dim dataAdapter As New OleDb.OleDbDataAdapter(RefrescarDatos, cn) dataAdapter.Fill(dt) Actualiza() dataAdapter.Dispose() End Sub

Botn Guardar:
Private Sub Carlos1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Carlos1.Click cn.Open() Dim GuardarDatos As String = " Insert into Maestros(Claveprofe,Nombre,Paterno,Materno,Profesion,Fechanac)" & "Values('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & "')" Dim dataAdapter As New OleDb.OleDbDataAdapter(GuardarDatos, cn) dataAdapter.Fill(dt) MsgBox("Se Agrego registro Correctamente", MsgBoxStyle.Information, "Mensaje") ' Limpiar() dataAdapter.Dispose() cn.Close() End Sub

Botn Regresar Al Men Maestros:


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Close() Carlos_Menumaestros.Show() End Sub

Botn Buscar:
Private Sub ButtonCar1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCar1.Click cn.Open() Dim strSQL As String = "Select * FROM Maestros WHERE Claveprofe= " & CInt(CarBox1.Text) Dim DataAdapter As New OleDb.OleDbDataAdapter(strSQL, cn) dt.Reset() DataAdapter.Fill(dt) ' Limpiar() fila = 0 Actualiza() dataAdapter.Dispose() cn.Close() End Sub

Botn Regresar Al Men:


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Close() Carlos_Menumaestros.Show() End Sub End Class

Mtodo Actualizar:
Public Sub Actualiza() CarBox1.Text = CarBox2.Text = CarBox3.Text = CarBox4.Text = CarBox5.Text = CarBox6.Text = End Sub

CInt(dt.Rows(fila)("Claveprofe")) CStr(dt.Rows(fila)("Nombre")) CStr(dt.Rows(fila)("Paterno")) CStr(dt.Rows(fila)("Materno")) CStr(dt.Rows(fila)("Profesion")) CStr(dt.Rows(fila)("Fechanac"))

Botn Buscar:
Private Sub cAr1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cAr1.Click cn.Open() Dim strSQL As String = "Select * from Maestros where Claveprofe= " & CInt(TextBox1.Text) Dim dataAdapter As New OleDb.OleDbDataAdapter(strSQL, cn) dt.Reset() dataAdapter.Fill(dt) ' Limpiar() fila = 0 Actualiza() dataAdapter.Dispose() cn.Close() End Sub

Botn Modificar:
Private Sub cAr2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cAr2.Click cn.Open() Dim ModificaDatos As String = "Update Maestros set Claveprofe= '" & TextBox1.Text() & "', Nombre = '" & TextBox2.Text() & "' , Paterno ='" & TextBox3.Text() & "', Materno ='" & TextBox4.Text() & "', Profesion ='" & TextBox5.Text() & "', Fechanac ='" & TextBox6.Text() & "' where Claveprofe=" & CInt(TextBox1.Text()) Dim dataAdapter As New OleDb.OleDbDataAdapter(ModificaDatos, cn) dataAdapter.Fill(dt) dataAdapter.Dispose() MsgBox("Registro Modificado", MsgBoxStyle.Information, "Mensaje") cn.Close() End Sub

Botn Regresar Al Men Maestros:


Private Sub cAr3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cAr3.Click Me.Close() Carlos_Menumaestros.Show() End Sub

Mtodo Actualizar:
Public Sub Actualiza() TextBox1.Text = TextBox2.Text = TextBox3.Text = TextBox4.Text = TextBox5.Text = TextBox6.Text = End Sub CInt(dt.Rows(fila)("Claveprofe")) CStr(dt.Rows(fila)("Nombre")) CStr(dt.Rows(fila)("Paterno")) CStr(dt.Rows(fila)("Materno")) CStr(dt.Rows(fila)("Profesion")) CStr(dt.Rows(fila)("Fechanac"))

Botn Altas:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Close() AsignaturasAltas.Show() End Sub

Botn Bajas:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If ((MsgBox("... Desea Eliminar ? " + CStr(TextLC1.Text), MsgBoxStyle.OkCancel, "Mensaje")) = 1) Then Dim strSQL As String = "DELETE FROM Asignaturas WHERE Clavemat=" & CInt(TextLC1.Text) Dim dataAdapter As New OleDb.OleDbDataAdapter(strSQL, cn) dataAdapter.Fill(dt) Refrescar() Actualiza() dataAdapter.Dispose() Else MsgBox("No se ha seleccionado registro a eliminar") End If End Sub

Botn Consultas:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() AsignaturasConsultas.Show() End Sub

Botn Modificar:
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Me.Close() AsiganturasModificaciones.Show() End Sub

Botn Regresar:
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click Me.Close() Form1.Show() End Sub

Botn Anterior:
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click If (fila > 0 And fila <= dt.Rows.Count - 1) Then fila = fila - 1 Actualiza() Else MsgBox("Primer Registro Encontrado", MsgBoxStyle.Information, "Mensaje") End If End Sub

Botn Siguiente:
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click If (fila >= 0 And fila < dt.Rows.Count - 1) Then fila = fila + 1 Actualiza() Else MsgBox("Ultimo Registro Encontrado", MsgBoxStyle.Information, "Mensaje") End If End Sub

En El Formulario MenuAsignaturas:
Private Sub MenuAsignaturas_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load dt.Reset() fila = 0 Dim RefrescarDatos As String = "Select * from Asignaturas" Dim dataAdapter As New OleDb.OleDbDataAdapter(RefrescarDatos, cn) dataAdapter.Fill(dt) Actualiza() dataAdapter.Dispose() End Sub

Mtodo Actualizar:
Public Sub Actualiza() TextLC1.Text = CInt(dt.Rows(fila)("Clavemat")) TextBox2.Text = CInt(dt.Rows(fila)("Claveprofe")) TextBox3.Text = CInt(dt.Rows(fila)("Numgrup")) End Sub

Mtodo Refrescar:
Private Sub Refrescar() dt.Reset() fila = 0 Dim RefrescarDatos As String = "Select * from Asignaturas" Dim dataAdapter As New OleDb.OleDbDataAdapter(RefrescarDatos, cn) dataAdapter.Fill(dt) Actualiza() dataAdapter.Dispose() End Sub

Botn Guardar:
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 Asignaturas(Clavemat,Claveprofe,Numgrup)" & "Values('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "')" Dim dataAdapter As New OleDb.OleDbDataAdapter(GuardarDatos, cn) dataAdapter.Fill(dt) MsgBox("Se Agrego registro Correctamente", MsgBoxStyle.Information, "Mensaje") ' Limpiar() dataAdapter.Dispose() cn.Close() End Sub

Botn Regresar:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() MenuAsignaturas.Show() End Sub

Botn Consultar:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click cn.Open() Dim strSQL As String = "Select * from Asignaturas where Clavemat= " & CInt(TextLC1.Text) Dim dataAdapter As New OleDb.OleDbDataAdapter(strSQL, cn) dt.Reset() dataAdapter.Fill(dt) ' Limpiar() fila = 0 Actualiza() dataAdapter.Dispose() cn.Close() End Sub

Botn Regresar Al Men Asignaturas:


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() MenuAsignaturas.Show() End Sub

Mtodo Actualizar:
Public Sub Actualiza() TextLC1.Text = CInt(dt.Rows(fila)("Clavemat")) TextLC2.Text = CStr(dt.Rows(fila)("Claveprofe")) TextBox3.Text = CStr(dt.Rows(fila)("Numgrup")) End Sub

End Class

Botn Buscar:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click cn.Open() Dim strSQL As String = "Select * from Asignaturas where Clavemat= " & CInt(TextBox1.Text) Dim dataAdapter As New OleDb.OleDbDataAdapter(strSQL, cn) dt.Reset() dataAdapter.Fill(dt) ' Limpiar() fila = 0 Actualiza() dataAdapter.Dispose() cn.Close() End Sub

Botn Modificar:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click cn.Open() Dim ModificaDatos As String = "Update Asignaturas set Clavemat= '" & TextBox1.Text() & "', Claveprofe = '" & TextBox2.Text() & "' , Numgrup ='" & TextBox3.Text() & "' where Clavemat=" & CInt(TextBox1.Text()) Dim dataAdapter As New OleDb.OleDbDataAdapter(ModificaDatos, cn) dataAdapter.Fill(dt) dataAdapter.Dispose() MsgBox("Registro Modificado", MsgBoxStyle.Information, "Mensaje") cn.Close() End Sub

Botn Regresar Al Men Asignaturas:

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close()

MenuAsignaturas.Show() End Sub

Mtodo Actualizar:
Public Sub Actualiza() TextBox1.Text = CInt(dt.Rows(fila)("Clavemat")) TextBox2.Text = CInt(dt.Rows(fila)("Claveprofe")) TextBox3.Text = CInt(dt.Rows(fila)("Numgrup")) End Sub

Botn Altas:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCC1.Click Me.Close() AltasMaterias.Show() End Sub

Botn Bajas:
Private Sub ButtonCC2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCC2.Click If ((MsgBox("... Desea Eliminar ? " + CStr(TextBox1.Text), MsgBoxStyle.OkCancel, "Mensaje")) = 1) Then Dim strSQL As String = "DELETE FROM Materias WHERE Clavemat=" & CInt(TextBox1.Text) Dim dataAdapter As New OleDb.OleDbDataAdapter(strSQL, cn) dataAdapter.Fill(dt) Refrescar() Actualiza() dataAdapter.Dispose() Else MsgBox("No se ha seleccionado registro a eliminar") End If

End Sub

Botn Consultas:
Private Sub ButtonCC3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCC3.Click Me.Close() Consulta_De_Materias.Show() End Sub

Botn Modificaciones:
Private Sub ButtonCC4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCC4.Click Me.Close() ModificacionesDeMaterias.Show() End Sub

Botn Regresar:
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCC6.Click Me.Close() Form1.Show() End Sub

Botn Anterior:

Private Sub ButtonCC7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCC7.Click If (fila > 0 And fila <= dt.Rows.Count - 1) Then fila = fila - 1 Actualiza() Else MsgBox("Primer Registro Encontrado", MsgBoxStyle.Information, "Mensaje") End If End Sub

Botn Siguiente:
Private Sub ButtonCC8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCC8.Click If (fila >= 0 And fila < dt.Rows.Count - 1) Then fila = fila + 1 Actualiza() Else MsgBox("Ultimo Registro Encontrado", MsgBoxStyle.Information, "Mensaje") End If End Sub

Mtodo Actualizar:

Public Sub Actualiza() TextBox1.Text = TextBox2.Text = TextBox3.Text = TextBox4.Text = TextBox5.Text = End Sub

CStr(dt.Rows(fila)("Clavemat")) CStr(dt.Rows(fila)("Nombre")) CInt(dt.Rows(fila)("Horatotales")) CInt(dt.Rows(fila)("Horasp")) CInt(dt.Rows(fila)("Horast"))

Mtodo Refrescar:

Private Sub Refrescar() dt.Reset()

En EL Formulario Materias:

fila = 0 Dim RefrescarDatos As String = "Select * from Materias" Dim dataAdapter As New OleDb.OleDbDataAdapter(RefrescarDatos, cn) dataAdapter.Fill(dt) Actualiza() dataAdapter.Dispose() End Sub

Private Sub Materias_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load dt.Reset() fila = 0 Dim RefrescarDatos As String = "Select * from Materias" Dim dataAdapter As New OleDb.OleDbDataAdapter(RefrescarDatos, cn) dataAdapter.Fill(dt) Actualiza() dataAdapter.Dispose() End Sub

Botn Guardar:
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 Materias(Clavemat,Nombre,Horatotales,Horasp,Horast)" & "Values('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "')" Dim dataAdapter As New OleDb.OleDbDataAdapter(GuardarDatos, cn) dataAdapter.Fill(dt) MsgBox("Se Agrego registro Correctamente", MsgBoxStyle.Information, "Mensaje") ' Limpiar() dataAdapter.Dispose() cn.Close() End Sub

Botn Regresar Al Men Materias:


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() Materias.Show() End Sub

Botn Buscar:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click cn.Open() Dim strSQL As String = "Select * from Materias where Clavemat= " & CInt(CCABox1.Text) Dim dataAdapter As New OleDb.OleDbDataAdapter(strSQL, cn) dt.Reset() dataAdapter.Fill(dt) ' Limpiar() fila = 0 Actualiza() dataAdapter.Dispose() cn.Close() End Sub

Botn Regresar:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() Materias.Show() End Sub

Mtodo Actualizar:
Public Sub Actualiza() CCABox1.Text = CInt(dt.Rows(fila)("Clavemat")) CCABox2.Text = CStr(dt.Rows(fila)("Nombre")) CCABox3.Text = CStr(dt.Rows(fila)("Horatotales"))

CCABox4.Text = CStr(dt.Rows(fila)("Horasp")) CCABox5.Text = CStr(dt.Rows(fila)("Horast")) End Sub

Botn Buscar:
Private Sub car1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles car1.Click cn.Open() Dim strSQL As String = "Select * from Materias where Clavemat= " & CInt(CCABox1.Text) Dim dataAdapter As New OleDb.OleDbDataAdapter(strSQL, cn) dt.Reset() dataAdapter.Fill(dt) ' Limpiar() fila = 0 Actualiza() dataAdapter.Dispose() cn.Close() End Sub

Botn Modificar:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click cn.Open() Dim ModificaDatos As String = "Update Materias set Clavemat= '" & CCABox1.Text() & "', Nombre = '" & CCABox2.Text() & "' , Horatotales ='" & CCABox3.Text() & "', Horasp ='" & CCABox4.Text() & "', Horast ='" & CCABox5.Text() & "' WHERE clavemat= " & CInt(CCABox1.Text()) Dim dataAdapter As New OleDb.OleDbDataAdapter(ModificaDatos, cn) dataAdapter.Fill(dt) dataAdapter.Dispose() MsgBox("Registro Modificado", MsgBoxStyle.Information, "Mensaje") cn.Close() End Sub

Botn Regresar:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() Materias.Show() End Sub

Mtodo Actualizar:
Public Sub Actualiza() CCABox1.Text = CCABox2.Text = CCABox3.Text = CCABox4.Text = CCABox5.Text = End Sub CInt(dt.Rows(fila)("Clavemat")) CStr(dt.Rows(fila)("Nombre")) CStr(dt.Rows(fila)("Horatotales")) CStr(dt.Rows(fila)("Horasp")) CStr(dt.Rows(fila)("Horast"))

Botn Altas:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Hide() AltasGrupos.Show() End Sub

Botn Bajas:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If ((MsgBox("... Desea Eliminar ? " + CStr(CCABox1.Text), MsgBoxStyle.OkCancel, "Mensaje")) = 1) Then Dim strSQL As String = "DELETE FROM Grupos WHERE Numgrupo=" & CInt(CCABox1.Text) Dim dataAdapter As New OleDb.OleDbDataAdapter(strSQL, cn) dataAdapter.Fill(dt) Refrescar() Actualiza()

dataAdapter.Dispose() Else MsgBox("No se ha seleccionado registro a eliminar") End If End Sub

Botn Consultas:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() Consulta_De_Grupos.Show() End Sub

Botn Modificaciones:
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Me.Close() Modificacion_de_Grupos.Show() End Sub

Botn Regresar:

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click Me.Close() Form1.Show() End Sub

Botn Anterior:
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click If (fila > 0 And fila <= dt.Rows.Count - 1) Then fila = fila - 1 Actualiza() Else MsgBox("Primer Registro Encontrado", MsgBoxStyle.Information, "Mensaje") End If End Sub

Botn Siguiente:
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click If (fila >= 0 And fila < dt.Rows.Count - 1) Then fila = fila + 1 Actualiza() Else MsgBox("Ultimo Registro Encontrado", MsgBoxStyle.Information, "Mensaje") End If End Sub

Mtodo Actualizar:
Public Sub Actualiza() CCABox1.Text = CInt(dt.Rows(fila)("Numgrupo")) CCABox2.Text = CStr(dt.Rows(fila)("Cantidadalumnos")) CCABox3.Text = CStr(dt.Rows(fila)("Clavemat")) End Su

Mtodo Refrescar:
Private Sub Refrescar() dt.Reset() fila = 0 Dim RefrescarDatos As String = "Select * from Grupos" Dim dataAdapter As New OleDb.OleDbDataAdapter(RefrescarDatos, cn) dataAdapter.Fill(dt) Actualiza() dataAdapter.Dispose() End Sub

En El Formulario Grupos_Menu:
Private Sub Grupos_Menu_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load dt.Reset() fila = 0 Dim RefrescarDatos As String = "Select * from Grupos" Dim dataAdapter As New OleDb.OleDbDataAdapter(RefrescarDatos, cn) dataAdapter.Fill(dt) Actualiza() dataAdapter.Dispose() End Sub

Botn Guardar:
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 Grupos(NumGrupo,Cantidadalumnos,Clavemat)" & "Values('" & CCABox1.Text & "','" & CCABox2.Text & "','" & CCABox3.Text & "')" Dim dataAdapter As New OleDb.OleDbDataAdapter(GuardarDatos, cn) dataAdapter.Fill(dt) MsgBox("Se Agrego registro Correctamente", MsgBoxStyle.Information, "Mensaje") ' Limpiar() dataAdapter.Dispose()

cn.Close() End Sub

Botn Regresar Al Men Grupos:


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() Grupos_Menu.Show() End Sub

Botn Buscar:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click cn.Open() Dim IntSQL As String = "Select * from Grupos where Numgrupo= " & CInt(CCABox1.Text) Dim dataAdapter As New OleDb.OleDbDataAdapter(IntSQL, cn) dt.Reset() dataAdapter.Fill(dt) ' Limpiar() fila = 0 Actualiza() dataAdapter.Dispose() cn.Close() End Sub

Botn Regresar:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() Grupos_Menu.Show() End Sub

Mtodo Actualizar:

Public Sub Actualiza() CCABox1.Text = CInt(dt.Rows(fila)("Numgrupo"))

CCABox2.Text = CInt(dt.Rows(fila)("Cantidadalumnos")) CCABox3.Text = CInt(dt.Rows(fila)("Clavemat")) End Sub

Botn Buscar:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCCA1.Click cn.Open() Dim strSQL As String = "Select * from Grupos where Numgrupo= " & CInt(CCABox1.Text) Dim dataAdapter As New OleDb.OleDbDataAdapter(strSQL, cn) dt.Reset() dataAdapter.Fill(dt) ' Limpiar() fila = 0 Actualiza() dataAdapter.Dispose() cn.Close() End Sub

Botn Modificar:
Private Sub ButtonCCA2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCCA2.Click cn.Open() Dim ModificaDatos As String = "Update Grupos set Numgrupo= '" & CCABox1.Text() & "', Cantidadalumnos = '" & CCABox2.Text() & "' , Clavemat ='" & CCABox3.Text() & "' WHERE Numgrupo= " & CInt(CCABox1.Text()) Dim dataAdapter As New OleDb.OleDbDataAdapter(ModificaDatos, cn) dataAdapter.Fill(dt) dataAdapter.Dispose() MsgBox("Registro Modificado", MsgBoxStyle.Information, "Mensaje") cn.Close() End Sub

Botn Regresar:
Private Sub ButtonCCA3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCCA3.Click Me.Close() Grupos_Menu.Show() End Sub

Mtodo Actualizar:
Public Sub Actualiza() CCABox1.Text = CInt(dt.Rows(fila)("Numgrupo")) CCABox2.Text = CInt(dt.Rows(fila)("Cantidadalumnos")) CCABox3.Text = CInt(dt.Rows(fila)("Clavemat")) End Sub

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy