Académique Documents
Professionnel Documents
Culture Documents
Data
Imports System.Data.OleDb
End If
Try
Dim tblClientes As DataTable
Dim dr As DataRow
da = New OleDbDataAdapter("select * from clientes where dnicliente='" & codigo
& "'", con)
ds = New DataSet
da.Fill(ds, "BK")
tblClientes = ds.Tables("BK")
total = tblClientes.Rows.Count
dr = tblClientes.Rows(0)
dniclientes.Text = dr("dnicliente")
apellidonombre.Text = dr("apellidonombre")
direccion.Text = dr("direccion")
telefono.Text = dr("telefono")
If IsDBNull(dr("dnicliente")) Then
dniclientes.Text = ""
Else
dniclientes.Text = dr("dnicliente")
If IsDBNull(dr("telefono")) Then
telefono.Text = ""
Else
telefono.Text = dr("telefono")
End If
End If
'agregar 00 a telefono
telefono.Text = "00"
DateTimePicker1.Visible = False
Timer1.Start()
'inabilitando
dniclientes.Enabled = False
apellidonombre.Enabled = False
direccion.Enabled = False
telefono.Enabled = False
email.Enabled = False
DataGridView1.DataSource = ds.Tables("BK").DefaultView
Catch ex As Exception
MessageBox.Show("ERROR AL LEER .. " & vbCrLf & ex.Message)
End Try
con.Close()
dniclientes.CharacterCasing = CharacterCasing.Upper
apellidonombre.CharacterCasing = CharacterCasing.Upper
direccion.CharacterCasing = CharacterCasing.Upper
telefono.CharacterCasing = CharacterCasing.Upper
email.CharacterCasing = CharacterCasing.Upper
'foto
picfoto.SizeMode = PictureBoxSizeMode.StretchImage
End Sub
End If
Catch ex As Exception
MessageBox.Show("error al leer la tabla ... " & ex.Message)
End Try
DataGridView1.DataSource = ds.Tables("BK").DefaultView
Catch ex As Exception
MessageBox.Show("error al borrar desde la tabla ... " & ex.Message)
End Try
btnvertodo.PerformClick()
End Sub
End If
cmd.ExecuteNonQuery()
con.Close()
MsgBox("nuevo cliente registrado")
dniclientes.Text = ""
apellidonombre.Text = ""
direccion.Text = ""
telefono.Text = ""
picfoto.Text = ""
email.Text = ""
Catch ex As Exception
MsgBox("por favor cierre la base de datos")
End Try
btnvertodo.PerformClick()
Else
MsgBox("ESTE NUMERO DE RESERVA YA EXISTE " & vbCrLf & "" & vbCrLf &
End If
Catch ex As Exception
End Try
'inabilitando
dniclientes.Enabled = False
apellidonombre.Enabled = False
direccion.Enabled = False
telefono.Enabled = False
email.Enabled = False
btngrabar.Enabled = False
End Sub
da.Fill(ds, "BK")
con.Close()
DataGridView1.DataSource = ds.Tables("BK").DefaultView
Catch ex As Exception
MessageBox.Show("ERROR AL LEER .. " & vbCrLf & ex.Message)
End Try
con.Close()
End Sub
End Sub
DataGridView1.Refresh()
Catch ex As Exception
End Try
End Sub
End Sub
Label12.Text = TimeOfDay
End Sub
If Char.IsDigit(e.KeyChar) Then
e.Handled = False
ElseIf Char.IsControl(e.KeyChar) Then
e.Handled = False
Else
e.Handled = True
End If
End Sub
End Sub
Catch ex As Exception
End Try
End Sub
End Sub
End If
End Sub
End Sub
If Char.IsDigit(e.KeyChar) Then
e.Handled = False
ElseIf Char.IsControl(e.KeyChar) Then
e.Handled = False
Else
e.Handled = True
End If
End Sub
End Class