You are on page 1of 5

Colegio de educación profesional técnica del

estado de chihuahua

Programación con sistemas gestores de bases de


datos

Ing. Sergio González Pérez

Practica # 23

Sonia Yadira Chávez Saucedo

5101 080260266-4
Lista de Cotejo

Práctica # 23 Manejo de procedimientos

Nombre de la Materia: Plantel: Conalep Juárez I


Programación Básica
Instructor: Ing. Sergio González Pérez Grupo: 5101
Alumno: Sonia Yadira Chávez Saucedo Fecha de aplicación :

INSTRUCCIONES DE APLICACIÓN.
Verifique que se encuentren los componentes señalados abajo y marque con una √ el registro
de cumplimiento correspondiente.

REGISTRO DE

No Características a verificar CUMPLIMIENTO OBSERVACIONES


SI NO
1 Inicia el Sistema Gestor de Base de Datos √

2 Abre la Base de Datos que será utilizada √


3 Realiza los pasos de la practica √
4 Manipula correctamente el SGBD √
5 Almacena en su carpeta las actividades planteadas √
6 Realiza el reporte del resultado del programa. √
DESARROLLO

REGISTRO DE

No Actividades a desarrollar CUMPLIMIENTO OBSERVACIONES


SI NO
1 Inicializa Lenguaje de Programación √
2 Agrega Formulario √
3 Diseña los Controles del Formulario √
4 Realiza Código para Manejo de Precios √

Firma del Alumnos Firma del Instructor


Salarios
Horas Pagoxhora Bruto Descuento Total Mensaje
18 80 1440 144 1296 sigue adelante
800 75 60000 6000 54000 bien hecho
90 80 7200 720 6480 bien hecho
360 85 30600 3060 27540 bien hecho

Calcular
Private Sub cmdcalc_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdcalc.Click

txtbruto.Text = Int(txthoras.Text) * Int(txtpago.Text)


txtdescuento.Text = Int(txtbruto.Text) * 0.1
txttotal.Text = Int(txtbruto.Text) - Int(txtdescuento.Text)

If (Int(txttotal.Text) >= 1800) Then


txtmensaje.Text = "bien hecho"
Else
txtmensaje.Text = "sigue adelante"
End If

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

Private Sub actualizar()


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"))
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

You might also like