-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrmAgregarEmpleado.vb
47 lines (37 loc) · 1.46 KB
/
frmAgregarEmpleado.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Public Class frmAgregarEmpleado
Private Sub cmdCargar_Click(sender As Object, e As EventArgs) Handles cmdCargar.Click
If IND < 100 Then
empleado(IND).codigo = txtCodigo.Text
empleado(IND).nombre = txtNombre.Text
empleado(IND).categoria = txtCategoria.Text
empleado(IND).sueldo = txtSueldo.Text
IND = IND + 1
MessageBox.Show("Datos cargados")
Else
MessageBox.Show("Error!")
End If
txtCodigo.Text = ""
txtNombre.Text = ""
txtCategoria.Text = ""
txtSueldo.Text = ""
End Sub
Private Sub DatosControl() ' Para controlar que los txt tengan datos'
If txtCodigo.Text <> "" And txtNombre.Text <> "" And txtCategoria.Text <> "" And txtSueldo.Text <> "" Then
cmdCargar.Enabled = True
Else
cmdCargar.Enabled = False
End If
End Sub
Private Sub txtCodigo_TextChanged(sender As Object, e As EventArgs) Handles txtCodigo.TextChanged
DatosControl()
End Sub
Private Sub txtNombre_TextChanged(sender As Object, e As EventArgs) Handles txtNombre.TextChanged
DatosControl()
End Sub
Private Sub txtCategoria_TextChanged(sender As Object, e As EventArgs) Handles txtCategoria.TextChanged
DatosControl()
End Sub
Private Sub txtSueldo_TextChanged(sender As Object, e As EventArgs) Handles txtSueldo.TextChanged
DatosControl()
End Sub
End Class