Professional Documents
Culture Documents
A. La clase clsPersona
End Class
B. La clase clsCliente
1
m_RUC = R
End Sub
C. La clase clsEmpleado
D. La clase clsLista
2
End Sub
i = 0
For Each obj In m_Datos
If obj.Codigo = Cod Then
Return i
End If
i = i + 1
Next
Return Nothing
End Function
F. Formulario frmAgregarPersona
3
Imports LibreriaHerencia
If rbtCliente.Checked Then
obj = New clsCliente(txtCodigo.Text, dtpFecha.Value, txtNombres.Text, _
CDbl(txtCredito.Text), txtEmpresa.Text, txtRUC.Text)
Else
obj = New clsEmpleado(txtCodigo.Text, dtpFecha.Value, txtNombres.Text, _
CDbl(txtComision.Text), dtpHoraEntrada.Value, _
dtpHoraSalida.Value, CDbl(txtSueldo.Text))
End If
Lista.Agregar(obj)
MsgBox("Registro con exito", MsgBoxStyle.Information)
End Sub
End Class
G. Formulario frmBuscarPersona
4
Imports LibreriaHerencia
Pos = Lista.BuscarPosicion(txtCodigo.Text)
obj = Lista.getPersona(Pos)
If Not obj Is Nothing Then
If TypeOf obj Is clsCliente Then
gbCliente.Visible = True
gbEmpleado.Visible = False
rbtCliente.Checked = True
txtEmpresa.Text = CType(obj, clsCliente).Empresa
Else
gbCliente.Visible = False
gbEmpleado.Visible = True
rbtEmpleado.Checked = True
txtSueldo.Text = CType(obj, clsEmpleado).Sueldo.ToString
End If
End If
End Sub
End Class
H. Formulario frmListadoPorTipos
5
Imports LibreriaHerencia
lstDatos.Items.Clear()
If cmbTipo.Text = "Cliente" Then
For Each obj In Lista.Datos
If TypeOf obj Is clsCliente Then
Cad = CType(obj, clsCliente).Codigo & " - " & CType(obj, clsCliente).Nombres & _
" - " & CType(obj, clsCliente).Empresa
lstDatos.Items.Add(Cad)
End If
Next
Else
For Each obj In Lista.Datos
If TypeOf obj Is clsEmpleado Then
Cad = CType(obj, clsEmpleado).Codigo & " - " & CType(obj, clsEmpleado).Nombres & _
" - " & CType(obj, clsEmpleado).Sueldo
lstDatos.Items.Add(Cad)
End If
Next
End If
End Sub
End Class
I. Formulario frmModificar
6
Imports LibreriaHerencia
7
Lista.Datos(Pos) = obj
End If
End Sub
End Class
J. Modulo modBasico
Imports LibreriaHerencia
Module modBasico
Public Lista As New clsLista
End Module