Botón elimanr grabar etc
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • 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
118
On Slideshare
118
From Embeds
0
Number of Embeds
0

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. 2014 Equipo-CODRED 15/05/2014 Conalep zacualpan 101 Elaboración y mantenimiento de sistemas de información 606 Anayenzi Perez Mena Profesor:Ing.Agustin Hernández Delgado
  • 2. Anayenzi Perez Mena-- 606 ○Botón Consultar○ REM consultas Dim mitabla As DataTable = CODREP_________________________________DataSet.ALTAS Dim cfilas As DataRowCollection = mitabla.Rows Dim nuevafila As DataRow Dim i As Integer Dim n As String n = ALTASBindingSource.Count() Dim bandera As Boolean bandera = True Dim tamaño As Integer tamaño = ALTASBindingSource.Count() i = 1 If (tamaño = 0) Then Else Do If (Trim(MATRICULATextBox.Text) = Trim(TextBox1.Text)) Then bandera = False Else ALTASBindingSource.MoveNext() i = i + 1 End If Loop While (bandera = True And i <= tamaño) End If If (bandera = False) Then MATRICULATextBox.Visible = False NOMBRETextBox.Visible = False APELLIDOTextBox.Visible = False
  • 3. Anayenzi Perez Mena-- 606 ESPECIALIDADTextBox.Visible = False GRUPOTextBox.Visible = False TURNOTextBox.Visible = False MATRICULATextBox.Enabled = False NOMBRETextBox.Enabled = False APELLIDOTextBox.Enabled = False ESPECIALIDADTextBox.Enabled = False GRUPOTextBox.Enabled = False TURNOTextBox.Enabled = False MsgBox("Ya existe") TextBox1.Text = "" TextBox1.Focus() Else MsgBox("Introduce datos") nuevafila = mitabla.NewRow cfilas.Add(nuevafila) ALTASBindingSource.MoveLast() MATRICULATextBox.Enabled = True MATRICULATextBox.Visible = True ID_ALTATextBox.Enabled = True ID_ALTATextBox.Visible = True NOMBRETextBox.Enabled = True NOMBRETextBox.Visible = True APELLIDOTextBox.Enabled = True APELLIDOTextBox.Visible = True ESPECIALIDADTextBox.Enabled = True ESPECIALIDADTextBox.Visible = True GRUPOTextBox.Enabled = True GRUPOTextBox.Visible = True GRUPOTextBox.Enabled = True GRUPOTextBox.Visible = True TURNOTextBox.Enabled = True TURNOTextBox.Visible = True nuevafila(1) = UCase(MATRICULATextBox.Text) nuevafila(2) = UCase(ID_ALTATextBox.Text) nuevafila(3) = UCase(TextBox1.Text) nuevafila(4) = UCase(NOMBRETextBox.Text) nuevafila(5) = UCase(APELLIDOTextBox.Text) nuevafila(6) = UCase(ESPECIALIDADTextBox.Text) nuevafila(7) = UCase(GRUPOTextBox.Text) nuevafila(8) = UCase(TURNOTextBox.Text) End If End Sub
  • 4. Anayenzi Perez Mena-- 606 ○Botón eliminar○ Dim response As MsgBoxResult Dim MSG As String Dim TITULO As String Dim ESTILO As MsgBoxStyle Dim registroactual As DataRowView ESTILO = MsgBoxStyle.YesNo TITULO = "Borrando..." MSG = " ¿Desea Borrar Los Datos.?" Dim c1 As String Dim c2 As String Dim res As Boolean Dim bandera As Boolean bandera = True Dim SI As Integer SI = SI Dim tam As Integer tam = ALTASBindingSource.Count() ALTASBindingSource.MoveFirst() res = False c1 = RTrim(TextBox1.Text) c2 = RTrim(MATRICULATextBox.Text) If (tam = 0) Then MsgBox("tabla vacia") Else ALTASBindingSource.MoveFirst() c1 = UCase(Trim(MATRICULATextBox.Text)) Do
  • 5. Anayenzi Perez Mena-- 606 res = c1 Like c2 If (res = True) Then bandera = False Else ALTASBindingSource.MoveNext() c1 = UCase(Trim(MATRICULATextBox.Text)) SI += 1 End If Loop While (bandera = True And SI <= tam) End If If (bandera = True) Then MATRICULATextBox.Enabled = False MATRICULATextBox.Visible = False NOMBRETextBox.Enabled = False NOMBRETextBox.Visible = False APELLIDOTextBox.Enabled = False APELLIDOTextBox.Visible = False TURNOTextBox.Enabled = False TURNOTextBox.Visible = False GRUPOTextBox.Enabled = False GRUPOTextBox.Visible = False ESPECIALIDADTextBox.Enabled = False ESPECIALIDADTextBox.Visible = False TextBox1.Text = "" TextBox1.Focus() MsgBox("Alumno No Encontrado") Else MATRICULATextBox.Enabled = False MATRICULATextBox.Visible = True NOMBRETextBox.Enabled = False NOMBRETextBox.Visible = True APELLIDOTextBox.Enabled = False APELLIDOTextBox.Visible = True TURNOTextBox.Enabled = False TURNOTextBox.Visible = True GRUPOTextBox.Enabled = False GRUPOTextBox.Visible = True ESPECIALIDADTextBox.Enabled = False ESPECIALIDADTextBox.Visible = True TextBox1.Text = "" TextBox1.Focus() response = MsgBox(MSG, ESTILO, TITULO) If (response = MsgBoxResult.Yes) Then registroactual = ALTASBindingSource.Current registroactual.Row.Delete() Me.ALTASTableAdapter.Update(Me.CODREP_________________________________DataSet.ALTAS) MsgBox("Se Borro EL Registro De la Tabla..") MATRICULATextBox.Enabled = False MATRICULATextBox.Visible = False NOMBRETextBox.Enabled = False
  • 6. Anayenzi Perez Mena-- 606 NOMBRETextBox.Visible = False APELLIDOTextBox.Enabled = False APELLIDOTextBox.Visible = False TURNOTextBox.Enabled = False TURNOTextBox.Visible = False GRUPOTextBox.Enabled = False GRUPOTextBox.Visible = False ESPECIALIDADTextBox.Enabled = False ESPECIALIDADTextBox.Visible = False TextBox1.Text = "" TextBox1.Focus() Else MATRICULATextBox.Enabled = False MATRICULATextBox.Visible = False NOMBRETextBox.Enabled = False NOMBRETextBox.Visible = False APELLIDOTextBox.Enabled = False APELLIDOTextBox.Visible = False TURNOTextBox.Enabled = False TURNOTextBox.Visible = False GRUPOTextBox.Enabled = False GRUPOTextBox.Visible = False ESPECIALIDADTextBox.Enabled = False ESPECIALIDADTextBox.Visible = False TextBox1.Text = "" TextBox1.Focus() MsgBox("NO SE HA BORRADO EL REGISTRO DE LA TABLA...") End If End If End Sub ○Grabando Ahora○ If (CODREP_________________________________DataSet.HasChanges) Then Me.Validate() Me.ALTASBindingSource.EndEdit() Me.ALTASTableAdapter.Update(Me.BaseCODREPDataSet.ALTAS) MsgBox("Datos Grabando ahora") TextBox1.Text = "" TextBox1.Focus() MATRICULATextBox.Enabled = False NOMBRETextBox.Enabled = False APELLIDOTextBox.Enabled = False ESPECIALIDADTextBox.Enabled = False GRUPOTextBox.Enabled = False End If End Sub