Practica porfe agustin eliminar y grabar

  • 40 views
Uploaded on

Archivo del programa

Archivo del programa

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
40
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
0
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Alumno: Joseline Marquez Flores Plantel: Conalep Zacualpan Plantel 101 Modulo:Elaboración y Mantenimiento de Sistemas de Información. Profe: Agustín Hernández Delgado. Eapecialidad: Informatica Grupo. 606
  • 2. Este es mi boton de buscar, se encarga de encontrar los datos pedidos por el programa Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click REM CONSULTAS Dim mitabla As DataTable = CODREP_________________________________DataSet.ALUMNO Dim cfilas As DataRowCollection = mitabla.Rows Dim nuevafila As DataRow Dim i As Integer Dim n As Integer n = ALUMNOBindingSource.Count() Dim bandera As Boolean bandera = True Dim tamaño As Integer tamaño = ALUMNOBindingSource.Count() i = 1 If (tamaño = 0) Then Else Do If (Trim(MATRICULATextBox.Text) = Trim(TextBox1.Text)) Then bandera = False Else ALUMNOBindingSource.MoveNext() i = i + 1 End If Loop While (bandera = True And i <= tamaño) End If If (bandera = False) Then ID_ALUMNOTextBox.Enabled = False ID_ALUMNOTextBox.Visible = False NOMBRETextBox.Enabled = False NOMBRETextBox.Visible = False APELLIDOSTextBox.Enabled = False APELLIDOSTextBox.Visible = False MATRICULATextBox.Enabled = False MATRICULATextBox.Visible = False ESPECIALIDADTextBox.Enabled = False ESPECIALIDADTextBox.Visible = False
  • 3. TURNOTextBox.Enabled = False TURNOTextBox.Visible = False GRUPOTextBox.Enabled = False GRUPOTextBox.Visible = False TELEFONOTextBox.Enabled = False TELEFONOTextBox.Visible = False CORREOTextBox.Enabled = False CORREOTextBox.Visible = False MsgBox("Ya existe") TextBox1.Text = "" TextBox1.Focus() Else MsgBox("Introduce datos") nuevafila = mitabla.NewRow cfilas.Add(nuevafila) ALUMNOBindingSource.MoveLast() ID_ALUMNOTextBox.Enabled = True ID_ALUMNOTextBox.Visible = True NOMBRETextBox.Enabled = True NOMBRETextBox.Visible = True APELLIDOSTextBox.Enabled = True APELLIDOSTextBox.Visible = True MATRICULATextBox.Enabled = True MATRICULATextBox.Visible = True ESPECIALIDADTextBox.Enabled = True ESPECIALIDADTextBox.Visible = True TURNOTextBox.Enabled = True TURNOTextBox.Visible = True GRUPOTextBox.Enabled = True GRUPOTextBox.Visible = True TELEFONOTextBox.Enabled = True TELEFONOTextBox.Visible = True CORREOTextBox.Enabled = True CORREOTextBox.Visible = True nuevafila(1) = UCase(NOMBRETextBox.Text) nuevafila(2) = UCase(APELLIDOSTextBox.Text) nuevafila(3) = UCase(TextBox1.Text) nuevafila(4) = UCase(ESPECIALIDADTextBox.Text) nuevafila(5) = UCase(TURNOTextBox.Text)
  • 4. nuevafila(6) = UCase(GRUPOTextBox.Text) nuevafila(7) = UCase(TELEFONOTextBox.Text) nuevafila(8) = UCase(CORREOTextBox.Text) End If End Sub Este es mi boton de grabar , guarda los documentos insertados. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If (CODREP_________________________________DataSet.HasChanges) Then Me.Validate() Me.ALUMNOBindingSource.EndEdit() Me.ALUMNOTableAdapter.Update(Me.CODREP________________________ _________DataSet.ALUMNO) MsgBox("Cargando") TextBox1.Text = "" TextBox1.Focus() ID_ALUMNOTextBox.Enabled = False NOMBRETextBox.Enabled = False APELLIDOSTextBox.Enabled = False MATRICULATextBox.Enabled = False ESPECIALIDADTextBox.Enabled = False TURNOTextBox.Enabled = False GRUPOTextBox.Enabled = False TELEFONOTextBox.Enabled = False CORREOTextBox.Enabled = False End If End Sub
  • 5. Este es el de eliminar, es el que se encarga de dar de baja a un alumno ya no existente Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click REM CONSULTAS Dim mitabla As DataTable = CODREP_________________________________DataSet.ALUMNO Dim cfilas As DataRowCollection = mitabla.Rows Dim nuevafila As DataRow Dim i As Integer Dim n As Integer n = ALUMNOBindingSource.Count() Dim bandera As Boolean bandera = True Dim tamaño As Integer tamaño = ALUMNOBindingSource.Count() i = 1 If (tamaño = 0) Then Else Do If (Trim(MATRICULATextBox.Text) = Trim(TextBox1.Text)) Then bandera = False Else ALUMNOBindingSource.MoveNext() i = i + 1 End If Loop While (bandera = True And i <= tamaño) End If If (bandera = False) Then ID_ALUMNOTextBox.Enabled = False ID_ALUMNOTextBox.Visible = False NOMBRETextBox.Enabled = False NOMBRETextBox.Visible = False APELLIDOSTextBox.Enabled = False APELLIDOSTextBox.Visible = False
  • 6. MATRICULATextBox.Enabled = False MATRICULATextBox.Visible = False ESPECIALIDADTextBox.Enabled = False ESPECIALIDADTextBox.Visible = False TURNOTextBox.Enabled = False TURNOTextBox.Visible = False GRUPOTextBox.Enabled = False GRUPOTextBox.Visible = False TELEFONOTextBox.Enabled = False TELEFONOTextBox.Visible = False CORREOTextBox.Enabled = False CORREOTextBox.Visible = False MsgBox("Ya existe") TextBox1.Text = "" TextBox1.Focus() Else MsgBox("Nuevos datos") nuevafila = mitabla.NewRow cfilas.Add(nuevafila) ALUMNOBindingSource.MoveLast() ID_ALUMNOTextBox.Enabled = True ID_ALUMNOTextBox.Visible = True NOMBRETextBox.Enabled = True NOMBRETextBox.Visible = True APELLIDOSTextBox.Enabled = True APELLIDOSTextBox.Visible = True MATRICULATextBox.Enabled = True MATRICULATextBox.Visible = True ESPECIALIDADTextBox.Enabled = True ESPECIALIDADTextBox.Visible = True TURNOTextBox.Enabled = True TURNOTextBox.Visible = True GRUPOTextBox.Enabled = True GRUPOTextBox.Visible = True TELEFONOTextBox.Enabled = True TELEFONOTextBox.Visible = True CORREOTextBox.Enabled = True CORREOTextBox.Visible = True nuevafila(1) = UCase(NOMBRETextBox.Text) nuevafila(2) = UCase(APELLIDOSTextBox.Text)
  • 7. nuevafila(3) = UCase(TextBox1.Text) nuevafila(4) = UCase(ESPECIALIDADTextBox.Text) nuevafila(5) = UCase(TURNOTextBox.Text) nuevafila(6) = UCase(GRUPOTextBox.Text) nuevafila(7) = UCase(TELEFONOTextBox.Text) nuevafila(8) = UCase(CORREOTextBox.Text) End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If (CODREP_________________________________DataSet.HasChanges) Then Me.Validate() Me.ALUMNOBindingSource.EndEdit() Me.ALUMNOTableAdapter.Update(Me.CODREP________________________ _________DataSet.ALUMNO) MsgBox("Cargando") TextBox1.Text = "" TextBox1.Focus() ID_ALUMNOTextBox.Enabled = False NOMBRETextBox.Enabled = False APELLIDOSTextBox.Enabled = False MATRICULATextBox.Enabled = False ESPECIALIDADTextBox.Enabled = False TURNOTextBox.Enabled = False GRUPOTextBox.Enabled = False TELEFONOTextBox.Enabled = False CORREOTextBox.Enabled = False End If End Sub Private Sub SALIR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SALIR.Click End End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) End Sub
  • 8. Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged TextBox1.Focus() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If (CODREP_________________________________DataSet.HasChanges) Then Me.Validate() Me.ALUMNOBindingSource.EndEdit() Me.ALUMNOTableAdapter.Update(Me.CODREP________________________ _________DataSet.ALUMNO) MsgBox("Cargando") TextBox1.Text = "" TextBox1.Focus() ID_ALUMNOTextBox.Enabled = False NOMBRETextBox.Enabled = False APELLIDOSTextBox.Enabled = False MATRICULATextBox.Enabled = False ESPECIALIDADTextBox.Enabled = False TURNOTextBox.Enabled = False GRUPOTextBox.Enabled = False TELEFONOTextBox.Enabled = False CORREOTextBox.Enabled = False End If End Sub