Sie sind auf Seite 1von 41

Boton Menu de grupo:

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

Boton Menu Materias:


Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click Me.Hide() Form14.Show() End Sub

Boton Menu Profesores:


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

Boton Menu Alumnos:


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

Boton Menu Asignatura:


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

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

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

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

Boton Modificaciones:
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Me.Hide() Form5.show() End Sub

Boton Dar De Baja Registro:


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If ((MsgBox("... Desea Eliminar la matricula " + 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

Boton 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

Boton 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 End Sub

Boton Menu Principal:


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

Boton 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,Numgrupo)" & "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

Boton Regresar menu de alumnos:


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

Boton 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='" & (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 Public Sub Actualiza() TextBox1.Text = CStr(dt.Rows(fila)("Matricula")) TextBox2.Text = CStr(dt.Rows(fila)("Nombre")) TextBox3.Text = CStr(dt.Rows(fila)("Paterno")) TextBox4.Text = CStr(dt.Rows(fila)("Materno")) TextBox5.Text = CStr(dt.Rows(fila)("direccion")) TextBox6.Text = CStr(dt.Rows(fila)("NumGrupo")) End Sub 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

Boton Anterior:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.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

Boton Siguiente:
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.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

Boton Regresar a menu alumnos:


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

Boton Siguiente:
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.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

Boton Anterior:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.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

Boton 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='" & (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 Public Sub Actualiza() TextBox1.Text = CStr(dt.Rows(fila)("Matricula")) TextBox2.Text = CStr(dt.Rows(fila)("Nombre")) TextBox3.Text = CStr(dt.Rows(fila)("Paterno")) TextBox4.Text = CStr(dt.Rows(fila)("Materno")) TextBox5.Text = CStr(dt.Rows(fila)("direccion")) TextBox6.Text = CStr(dt.Rows(fila)("NumGrupo")) End Sub 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

Boton Regresar Menu Alumnos:


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

Boton 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) fila = 0 Actualiza() dataAdapter.Dispose() cn.Close() End Sub 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

Boton 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 & "', Numgrupo ='" & TextBox6.Text & "' where Matricula='" & CStr(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

Boton Regresar al Menu Alumnos:


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

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

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

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

Boton 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

Boton 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

End Sub

Boton dar de baja registro:


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If ((MsgBox("... Desea Eliminar la clave " + CStr(TextBox1.Text), MsgBoxStyle.OkCancel, "Mensaje")) = 1) Then Dim strSQL As String = "DELETE FROM Maestros WHERE Claveprofe='" & 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 regresar al men:


Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click Me.Hide() Form1.Show() End Sub End Class

Pantalla altas de maestro_

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 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 principal:


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

Menu consultar maestros_

Boton anterior:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.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

Boton siguiente:
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.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

Boton 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 Maestros where Claveprofe='" & (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

Boton regresar al menu de profesores:


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

Menu modificar:

Boton 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 Maestros where Claveprofe= '" & (CStr(TextBox1.Text)) & "'" Dim dataAdapter As New OleDb.OleDbDataAdapter(strSQL, cn) dt.Reset() dataAdapter.Fill(dt) fila = 0 Actualiza() dataAdapter.Dispose() cn.Close() End Sub

Boton 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 Maestros set Claveprofe= '" & TextBox1.Text & "', Nombre = '" & TextBox2.Text & "' , Paterno ='" & TextBox3.Text & "', Materno ='" & TextBox4.Text & "', Profesion ='" & TextBox5.Text & "', Fechanac ='" & TextBox6.Text & "' where Claveprofe='" & CStr(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

Boton menu de profesores:


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.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='" & CStr(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

Menu asignaturas:

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

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

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

Boton 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

Boton 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 End Sub

Boton dar de bajas registros:


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If ((MsgBox("... Desea Eliminar la clave " + CStr(TextBox1.Text), MsgBoxStyle.OkCancel, "Mensaje")) = 1) Then Dim strSQL As String = "DELETE FROM Asignatura WHERE Clavemat='" & 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

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

Menu altas asignaturas:

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 Asignatura(Clavemat,Claveprofe,Numgrupo)" & "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

Regresar al menu de almunos:


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

Menu consulta asignatura:

Boton anterior:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.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 Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.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

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 Asignatura where Clavemat='" & (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 regresar al men:


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

Modificar asignaturas:

Boton 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 Asignatura where Clavemat= '" & (CStr(TextBox1.Text)) & "'" Dim dataAdapter As New OleDb.OleDbDataAdapter(strSQL, cn) dt.Reset() dataAdapter.Fill(dt) fila = 0 Actualiza() dataAdapter.Dispose() cn.Close() End Sub

Boton 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 Asignatura set Clavemat= '" & TextBox1.Text & "', Claveprofe = '" & TextBox2.Text & "' , Numgrupo ='" & TextBox3.Text & "' where Clavemat='" & CStr(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

Boton regresar al menu de alumnos:


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

Menu materias.

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

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

Boton modificaciones:
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Me.Hide() Form17.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 dar de baja registro:


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If ((MsgBox("... Desea Eliminar la matricula " + CStr(TextBox1.Text), MsgBoxStyle.OkCancel, "Mensaje")) = 1) Then Dim strSQL As String = "DELETE FROM Materias WHERE Clavemat='" & 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 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 End Sub

Botn men principal:


Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click Me.Hide() Form1.Show() End Sub End Class

Men agregar materia:

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,Horastotales,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 de alumnos:


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

Menu consulta materias:

Boton anterior:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.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

Boton 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 Materias where Clavemat='" & (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

Boton siguiente:
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.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

Botn regresar al men de alumnos:


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

menu modificar material:

Boton 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= '" & (CStr(TextBox1.Text)) & "'" Dim dataAdapter As New OleDb.OleDbDataAdapter(strSQL, cn) dt.Reset() dataAdapter.Fill(dt) fila = 0 Actualiza() dataAdapter.Dispose() cn.Close() End Sub

Boton 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 Materias set Clavemat= '" & TextBox1.Text & "', Nombre = '" & TextBox2.Text & "' , Horastotales ='" & TextBox3.Text & "', Horasp ='" & TextBox4.Text & "', Horast ='" & TextBox5.Text & "' where Clavemat='" & CStr(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

Boton regrsesar al menu de alumnus:


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

Menu grupo:

boton altas :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Close() Form19.Show()

End Sub

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

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

boton 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 End Sub

Botn dar de alta registro:


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If ((MsgBox("... Desea Eliminar la matricula " + CStr(TextBox1.Text), MsgBoxStyle.OkCancel, "Mensaje")) = 1) Then Dim strSQL As String = "DELETE FROM Grupos WHERE Numgrupo='" & 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 men principal:


Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click Me.Hide() Form1.Show()

End Sub

Menu altas grupos:

Boton 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('" & 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 al men principal:


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

Me.Close() Form18.Show() End Sub

Menu consultar grupos:

Boton anterior:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.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

Boton siguiente:
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.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

Boton 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 Grupos where Numgrupo='" & (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

Regresar men de alumnos:


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

Menu modificar grups:

Boton 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 Grupos where Numgrupo= '" & (CStr(TextBox1.Text)) & "'" Dim dataAdapter As New OleDb.OleDbDataAdapter(strSQL, cn) dt.Reset() dataAdapter.Fill(dt) fila = 0 Actualiza() dataAdapter.Dispose() cn.Close() End Sub

Boton 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 Grupos set Numgrupo= '" & TextBox1.Text & "', Cantidadalumnos = '" & TextBox2.Text & "' , Clavemat ='" & TextBox3.Text & "' where Numgrupo='" & CStr(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

Boton regresar al menu grupos:


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

Das könnte Ihnen auch gefallen