0% found this document useful (0 votes)
45 views

Manual Del Programador

The document describes the code for buttons on various menus for a database application. It includes code for buttons that allow adding, deleting, modifying, and viewing data on menus for students, teachers, courses, and groups. The buttons navigate between the different menus and forms for performing common database operations on the different tables.

Uploaded by

YisselAguilar
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

Manual Del Programador

The document describes the code for buttons on various menus for a database application. It includes code for buttons that allow adding, deleting, modifying, and viewing data on menus for students, teachers, courses, and groups. The buttons navigate between the different menus and forms for performing common database operations on the different tables.

Uploaded by

YisselAguilar
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Conalep Jurez 1

Manual del programador


Programacin con sistemas gestores de base de datos
Anahi Yissel Aguilar Hernndez 090260127-7 5102-1

2011

P.S.P Sergio Gonzlez Prez

Botones:

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

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

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

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

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

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

Bajas:
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click If ((MsgBox(" Desea Eliminar ? " + CStr(TextBox1.Text), MsgBoxStyle.OkCancel, "Mensaje")) = 1) Then Dim strSQL As String = "DELETE * FROM Alunmos 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

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

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

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

Siguiente:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.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 Regresar al 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

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

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

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

Modificaciones:
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Me.Hide() Modificar_Maestros.Show() End Sub Private Sub Actualiza() TextBox1yiz.Text = CStr(dt.Rows(fila)("Claveprofe")) TextBox2yiz.Text = CStr(dt.Rows(fila)("Nombre")) TextBox3yiz.Text = CStr(dt.Rows(fila)("Paterno")) TextBox4yiz.Text = CStr(dt.Rows(fila)("Materno")) TextBox5yiz.Text = CStr(dt.Rows(fila)("Profesion")) TextBox6yiz.Text = CStr(dt.Rows(fila)("Fechanac")) End Sub Private Sub ver() Dim ver As String = "SELECT * FROM Maestros" Dim dataAdapter As New OleDb.OleDbDataAdapter(ver, cn) dataAdapter.Fill(dt)

TextBox1yiz.Text = CStr(dt.Rows(fila)("Claveprofe")) TextBox2yiz.Text = CStr(dt.Rows(fila)("Nombre")) TextBox3yiz.Text = CStr(dt.Rows(fila)("Paterno")) TextBox4yiz.Text = CStr(dt.Rows(fila)("Materno")) TextBox5yiz.Text = CStr(dt.Rows(fila)("Profesion")) TextBox6yiz.Text = CStr(dt.Rows(fila)("Fechanac")) dataAdapter.Dispose() End Sub

Mostrar todos los registros:


Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click ver() End Sub

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

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

Regresar al menu principal:


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

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

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

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

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

Mostrar todos los registros:


Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click ver() End Sub

Anterior:
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("Primer Registro Encontrado", MsgBoxStyle.Information, "Mensaje") End If End Sub

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

Regresar al menu principal:


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

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

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

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

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

Mostrar todos los registros:


Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click ver() End Sub

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 Private Sub Refrescar() dt.Reset() fila = 0 Dim RefrescarDatos As String = "Select * from Asignatura" Dim dataAdapter As New OleDb.OleDbDataAdapter(RefrescarDatos, cn) dataAdapter.Fill(dt) Refrescar() dataAdapter.Dispose() End Sub Private Sub Actualiza() TextBox1yiz.Text = CStr(dt.Rows(fila)("Clavemat")) TextBox2yiz.Text = CStr(dt.Rows(fila)("Claveprofe")) TextBox3yiz.Text = CStr(dt.Rows(fila)("Numgrupo")) End Sub Private Sub ver() Dim ver As String = "SELECT * FROM Asignatura" Dim dataAdapter As New OleDb.OleDbDataAdapter(ver, cn) dataAdapter.Fill(dt) TextBox1yiz.Text = CStr(dt.Rows(fila)("Clavemat"))

TextBox2yiz.Text = CStr(dt.Rows(fila)("Claveprofe")) TextBox3yiz.Text = CStr(dt.Rows(fila)("Numgrupo")) dataAdapter.Dispose() End Sub

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

Regresar a men principal:


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

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

Bajas:
Private Sub Button2yiz_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2yiz.Click If ((MsgBox("... Desea Eliminar ? " + CStr(TextBox1yiz.Text), MsgBoxStyle.OkCancel, "Mensaje")) = 1) Then Dim strSQL As String = "DELETE FROM Grupos WHERE Numgrupo='" & CStr(TextBox1yiz.Text) & "';" Dim dataAdapter As New OleDb.OleDbDataAdapter(strSQL, cn) dataAdapter.Fill(dt) Actualiza() MsgBox("Se ha eliminado correctamente un registro") dataAdapter.Dispose() Else MsgBox("No se ha seleccionado registro a eliminar") End If End Sub

Consultas:
Private Sub Button3yiz_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3yiz.Click Me.Hide() Consultar_grupos.Show() End Sub 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) Refrescar() dataAdapter.Dispose() End Sub Private Sub Actualiza() TextBox1yiz.Text = CInt(dt.Rows(fila)("Numgrupo")) TextBox2yiz.Text = CInt(dt.Rows(fila)("Cantidadalumnos")) TextBox3yiz.Text = CInt(dt.Rows(fila)("Clavemat")) End Sub Private Sub ver() Dim ver As String = "SELECT * FROM Grupos" Dim dataAdapter As New OleDb.OleDbDataAdapter(ver, cn) dataAdapter.Fill(dt) TextBox1yiz.Text = CStr(dt.Rows(fila)("Numgrupo")) TextBox2yiz.Text = CStr(dt.Rows(fila)("Cantidadalumnos")) TextBox3yiz.Text = CStr(dt.Rows(fila)("Clavemat")) dataAdapter.Dispose() End Sub

Modificaciones:
Private Sub Button4yiz_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4yiz.Click Me.Hide() Modificar_Grupos.Show() End Sub

Regresar a menu principal:


Private Sub Button5yiz_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5yiz.Click ver() End Sub

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

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

Regresar al men principal: Private Sub Button8yiz_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8yiz.Click Me.Hide() Form1.Show() End Sub

You might also like