Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Boton eliminar rosalia

241 views

Published on

  • Be the first to comment

  • Be the first to like this

Boton eliminar rosalia

  1. 1. Conalep Zacualpan Nombre: Rosalía Lara Santos Grupo: 606 Botones de Registro. IMPLEMENTACIÓN DE SISTEMAS DE INFORMACIÓN.
  2. 2. CODIGO DE GRABAR If (DirectorioDataSet.haschange) Then Me.Validate() Me.registro.EndEdit() Me.RegistroTableAdapter.Update(Me.BaseCarpDataSet.registro) MsgBox("Grabando") IdTextBox.Enabled = False RFCTextBox.Enabled = False Nombre_de_la_empresaTextBox.Enabled = False DireccionTextBox.Enabled = False LocalidadTextBox.Enabled = False ProvinciaTextBox.Enabled = False Codigo_postalTextBox.Enabled = False TelefonoTextBox.Enabled = False Pagina_webTextBox.Enabled = False Codigo de eliminar Private Sub Button2_Click_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim response As MsgBoxResult Dim MSG As String Dim TITULO As String Dim ESTILO As MsgBoxStyle Dim registroactual As DataRowView ESTILO = MsgBoxStyle.YesNo TITULO = "Eliminar los datos" MSG = " ¿Desesa que sean eliminados Los Datos?" Dim c1 As String Dim c2 As String Dim res As Boolean Dim bandera As Boolean bandera = True
  3. 3. Dim SI As Integer SI = SI Dim tam As Integer tam = RegistroBindingSource.Count() RegistroBindingSource.MoveFirst() res = False c1 = RTrim(TextBox1.Text) c2 = RTrim(IdTextBox.Text) Do res = c2 Like c1 If (res = True) Then bandera = False Else RegistroBindingSource.MoveNext() c2 = RTrim(IdTextBox.Text) SI += 1 End If Loop While (bandera = True And SI <= tam) If (bandera = True) Then IdTextBox.Visible = False RFCTextBox.Visible = False Nombre_de_la_empresaTextBox.Visible = False DireccionTextBox.Visible = False LocalidadTextBox.Visible = False ProvinciaTextBox.Visible = False Codigo_postalTextBox.Visible = False TelefonoTextBox.Visible = False Pagina_webTextBox.Visible = False TextBox1.Text = "" TextBox1.Focus() MsgBox("Registro no encontrado") Else IdTextBox.Visible = True RFCTextBox.Visible = True Nombre_de_la_empresaTextBox.Visible = True DireccionTextBox.Visible = True LocalidadTextBox.Visible = True
  4. 4. ProvinciaTextBox.Visible = True Codigo_postalTextBox.Visible = True TelefonoTextBox.Visible = True Pagina_webTextBox.Visible = True IdTextBox.Enabled = False RFCTextBox.Enabled = False Nombre_de_la_empresaTextBox.Enabled = False DireccionTextBox.Enabled = False LocalidadTextBox.Enabled = False ProvinciaTextBox.Enabled = False Codigo_postalTextBox.Enabled = False TelefonoTextBox.Enabled = False Pagina_webTextBox.Enabled = False TextBox1.Text = "" TextBox1.Focus() response = MsgBox(MSG, ESTILO, TITULO) If (response = MsgBoxResult.Yes) Then registroactual = RegistroBindingSource.Current registroactual.Row.Delete() '7Me.DatosTableAdapter.Update(Me.SipretDataSet.Datos) MsgBox("Registro eliminado") IdTextBox.Visible = False RFCTextBox.Visible = False Nombre_de_la_empresaTextBox.Visible = False DireccionTextBox.Visible = False LocalidadTextBox.Visible = False ProvinciaTextBox.Visible = False Codigo_postalTextBox.Visible = False TelefonoTextBox.Visible = False Pagina_webTextBox.Visible = False Else IdTextBox.Visible = False RFCTextBox.Visible = False Nombre_de_la_empresaTextBox.Visible = False DireccionTextBox.Visible = False
  5. 5. LocalidadTextBox.Visible = False ProvinciaTextBox.Visible = False Codigo_postalTextBox.Visible = False TelefonoTextBox.Visible = False Pagina_webTextBox.Visible = False TextBox1.Text = "" TextBox1.Focus() MsgBox("El registro no se a eliminado") End If End Sub

×