This document contains code for a student information system created in Visual Basic. It includes code for three forms - Form1 for student enrollment, Form2 for navigation between forms, and Form3 for an unspecified purpose. Form1 allows entering and saving new student records to a database table. It checks for duplicate student IDs, enables/disables fields, and includes code to add, save, and load student data. Form2 provides buttons to navigate between the other forms.
Unlocking the Future of AI Agents with Large Language Models
Documento de altas
1. COLEGIO DE EDUCACIÓN PROFESIONAL TÉCNICA DEL ESTADO
DE TLAXCALA
PLANTEL CONALEP ZACUALPAN 101
Docente: Ing. Agustín Hernández Delgado.
Módulo: Elaboración y Mantenimiento de Sistemas de
Información.
Alumno:
Sánchez Zempoalteca Alejandro.
Especialidad. Informática.
Grado: 6to Semestre Grupo: 603-Info-V.
2. Menú
Public Class Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Form1.Show()
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Form3.Show()
End Sub
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
End
End Sub
End Class
Altas
Public Class Form1
Private Sub Alta_alumnosBindingNavigatorSaveItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Alta_alumnosBindingNavigatorSaveItem.Click
Me.Validate()
Me.Alta_alumnosBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.SICOHEDataSet)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'TODO: esta línea de código carga datos en la tabla
'SICOHEDataSet.alta_alumnos' Puede moverla o quitarla según sea necesario.
Me.Alta_alumnosTableAdapter.Fill(Me.SICOHEDataSet.alta_alumnos)
IdTextBox.Enabled = False
IdTextBox.Visible = False
EspecialidadTextBox.Enabled = False
EspecialidadTextBox.Visible = False
MatriculaTextBox.Enabled = False
MatriculaTextBox.Visible = False
NombreTextBox.Enabled = False
NombreTextBox.Visible = False
Ap_patTextBox.Enabled = False
Ap_patTextBox.Visible = False
Ap_matTextBox.Enabled = False
Ap_matTextBox.Visible = False
GrupoTextBox.Enabled = False
GrupoTextBox.Visible = False
TurnoTextBox.Enabled = False
TurnoTextBox.Visible = False
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Dim mitabla As DataTable = SICOHEDataSet.alta_alumnos
3. Dim cfilas As DataRowCollection = mitabla.Rows
Dim nuevafila As DataRow
Dim i As Integer
Dim c1 As String
Dim c2 As String
Dim res As Boolean
Dim n As Integer
Dim bandera As Boolean
n = Alta_alumnosBindingSource.Count
Alta_alumnosBindingSource.MoveFirst()
bandera = True
res = False
c1 = (RTrim(TextBox1.Text))
c2 = (RTrim(MatriculaTextBox.Text))
Do
If (Trim(MatriculaTextBox.Text) = Trim(TextBox1.Text)) Then
bandera = False Else
Alta_alumnosBindingSource.MoveNext() i = i + 1
End If
Loop While (bandera = True And i <= n)
If (bandera = False) Then
MsgBox("ERROR, MATRICULA YA REGISTRADA n PRESIONA LA TECLA ENTER PARA
CONTINUAR")
Else
MsgBox("INTRODUCE")
nuevafila = mitabla.NewRow
cfilas.Add(nuevafila)
Alta_alumnosBindingSource.MoveLast()
IdTextBox.Enabled = False
IdTextBox.Visible = False
EspecialidadTextBox.Enabled = True
EspecialidadTextBox.Visible = True
MatriculaTextBox.Enabled = False
MatriculaTextBox.Visible = True
NombreTextBox.Enabled = True
NombreTextBox.Visible = True
Ap_matTextBox.Enabled = True
Ap_matTextBox.Visible = True
Ap_patTextBox.Enabled = True
Ap_patTextBox.Visible = True
GrupoTextBox.Enabled = True
GrupoTextBox.Visible = True
TurnoTextBox.Enabled = True
TurnoTextBox.Visible = True
nuevafila(1) = UCase(TextBox1.Text)
nuevafila(2) = Val(NombreTextBox.Text)
nuevafila(3) = Val(Ap_patTextBox.Text)
nuevafila(4) = Val(Ap_matTextBox.Text)
nuevafila(5) = Val(EspecialidadTextBox.Text)
nuevafila(6) = Val(GrupoTextBox.Text)
nuevafila(7) = Val(TurnoTextBox.Text)
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
End
End Sub
4. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
If (SICOHEDataSet.HasChanges) Then Me.Validate()
Me.Alta_alumnosBindingSource.EndEdit()
Me.Alta_alumnosTableAdapter.Update(Me.SICOHEDataSet)
MsgBox("DATOS GRABADOS")
End If
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
My.Forms.Form2.Visible = True
Me.Visible = False
End Sub
End Class