CONTROL DE PAGOS(diseño)
CONTROL DE PAGOS(Codigo)
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnaceptar.Click
If txtuser.Text = "jhonny" And txtpassword.Text = "password" Then
MessageBox.Show("Bienvenido Señor Jhonny Al Sistema...", "Mensaje al Usuario")
Me.Hide()
Form2.Show()
Else
MessageBox.Show()
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncancelar.Click
End
End Sub
End Class
----------------------------------------------------------------------------------------------------
Public Class Form2
Private Sub btncalcular_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncalcular.Click
If rboejecutivo.Checked Then
txtsalarioxdtrab.Text = 70 * txtdiastrabajados.Text
ElseIf rboempleado.Checked Then
txtsalarioxdtrab.Text = 35 * txtdiastrabajados.Text
ElseIf rboobrero.Checked Then
txtsalarioxdtrab.Text = 20 * txtdiastrabajados.Text
End If
If rboejecutivo.Checked Then
txtpagoxhora.Text = 20 * txthorasextras.Text
ElseIf rboempleado.Checked Then
txtpagoxhora.Text = 10 * txthorasextras.Text
ElseIf rboobrero.Checked Then
txtpagoxhora.Text = 5 * txthorasextras.Text
End If
If Val(txthorasextras.Text) > 8 Then
MessageBox.Show("Maximo de horas extras es 8", "Mensaje")
End If
lblresultado.Text = "El Sr " + txtname.Text + " ha trabajado " + txtdiastrabajados.Text + " dias y tiene " + txthorasextras.Text + " horas extras"
txttotalpago.Text = txtdiastrabajados.Text + txthorasextras.Text
End Sub
Private Sub btnnuevo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnnuevo.Click
Dim ctl As Object
For Each ctl In Me.Controls
If TypeOf ctl Is CheckBox Then
ctl.Value = False
ElseIf TypeOf ctl Is TextBox Then
ctl.Text = ""
ElseIf TypeOf ctl Is ComboBox Then
ctl.Text = ""
ctl.Clear()
End If
Next
End Sub
Private Sub btnsalir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsalir.Click
End
End Sub
End Class
No hay comentarios:
Publicar un comentario