Professional Documents
Culture Documents
estado de chihuahua
Practica # 23
5101 080260266-4
Lista de Cotejo
INSTRUCCIONES DE APLICACIÓN.
Verifique que se encuentren los componentes señalados abajo y marque con una √ el registro
de cumplimiento correspondiente.
REGISTRO DE
REGISTRO DE
Calcular
Private Sub cmdcalc_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdcalc.Click
End Sub
Limpiar
Private Sub cmdlimp_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdlimp.Click
txthoras.Text = " "
txtpago.Text = " "
txtbruto.Text = " "
txtdescuento.Text = " "
txttotal.Text = " "
txtmensaje.Text = " "
End Sub
Almacenar
Private Sub cmdalmacen_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdalmacen.Click
cn.Open()
Dim GuardarDatos As String = "insert into
salarios(Horas,Pagoxhora,Bruto,Descuento,Total,Mensaje)" & "Values('"
& txthoras.Text & "' , '" & txtpago.Text & "','" & txtbruto.Text &
"','" & txtdescuento.Text & "','" & txttotal.Text & "','" &
txtmensaje.Text & "')"
Dim dataAdapter As New OleDb.OleDbDataAdapter(GuardarDatos,
cn)
dataAdapter.Fill(dt)
MsgBox("Se agrego el registro correctmente",
MsgBoxStyle.Information, "Mensaje")
dataAdapter.Dispose()
cn.Close()
End Sub
Modificar
Private Sub cmdmodif_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdmodif.Click
cn.Open()
Dim ModificarDatos As String = "Update salarios set Horas='" &
txthoras.Text & "' , Pagoxhora='" & txtpago.Text & "' ,Bruto='" &
txtbruto.Text & "', Descuento= '" & txtbruto.Text & "', Total='" &
txttotal.Text & "', Mensaje='modificado' where Horas=" &
CInt(txthoras.Text)
Dim dataAdapter As New OleDb.OleDbDataAdapter(ModificarDatos,
cn)
dataAdapter.Fill(dt)
txthoras.Text = CInt(dt.Rows(fila)("Horas"))
txtpago.Text = CInt(dt.Rows(fila)("Pagoxhora"))
txtbruto.Text = CInt(dt.Rows(fila)("Bruto"))
txtdescuento.Text = CInt(dt.Rows(fila)("Descuento"))
txttotal.Text = CInt(dt.Rows(fila)("Total"))
txtmensaje.Text = CStr(dt.Rows(fila)("Mensaje"))
MsgBox("Registro modificado correctamente")
cn.Close()
End Sub
Consultar
Private Sub cmdcons_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdcons.Click
cn.Open()
dt.Reset()
Dim ConsultarDatos As String = "Select *From salarios Where
horas=" & (CInt(txthoras.Text))
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos,
cn)
dataAdapter.Fill(dt)
fila = 0
actualizar()
MsgBox("Se encontro el registro correctmente",
MsgBoxStyle.Information, "Mensaje")
dataAdapter.Dispose()
cn.Close()
End Sub
Eliminar
Private Sub cmddel_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmddel.Click
Dim BorrarDatos As String = "Delete * From Salarios where
Horas=" & CInt(txthoras.Text)
Dim dataAdapter As New OleDb.OleDbDataAdapter(BorrarDatos, cn)
dataAdapter.Fill(dt)
refrescar()
actualizar()
dataAdapter.Dispose()
cn.Close()
End Sub
Metodos:
Private Sub refrescar()
dt.Reset()
fila = 0
Dim refrescar As String = "select * from Salarios"
Dim adapter As New OleDb.OleDbDataAdapter(refrescar, cn)
adapter.Fill(dt)
End Sub
salarios
Horas Pagoxhora Bruto Descuento Total Mensaje
30 50 1500 150 1350 sigue adelante
23 35 805 80 725 sigue adelante
111 40 4440 444 3996 bien hecho
salarios
Horas Pagoxhora Bruto Descuento Total Mensaje
30 50 1500 150 1350 sigue adelante
23 35 805 80 725 sigue adelante
#Eliminado