Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class frm_menu
- Private Structure clientes
- Public codigo As Integer
- Public fecha As String
- Public nombre As String
- Public cuota As Decimal
- End Structure
- Dim matriz() As clientes
- Dim fechaok = True
- Dim cuotaok = False
- Dim Ccuota As String
- Dim controlDecimal = False
- Dim i As Integer
- Private Sub frm_menu_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
- End Sub
- ''Boton agregado
- Private Sub btn_agregar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_agregar.Click
- ''Asignacion de dimension inicial
- If IsNothing(matriz) Then
- ReDim matriz(1)
- End If
- ''Modulo comprobación de fecha
- If txtb_fecha.Text = "" Or CStr(txtb_fecha.Text).Length < 10 Then
- MsgBox("El fecha campo esta incompleto", vbCritical)
- ElseIf (GetChar(CStr(txtb_fecha.Text), 3) <> "/") Or (GetChar(CStr(txtb_fecha.Text), 6) <> "/") Then
- MsgBox("La fecha no está en el formato estándar", vbCritical)
- fechaok = False
- Else
- fechaok = True
- End If
- cuotaok = True
- ''Comprobación de las entradas previas a la insercción en la matriz
- If IsNumeric(txtb_codigo.Text) And fechaok And cuotaok Then
- ''Insertar comprobacion de fecha y nombre
- ReDim matriz(matriz.Length + 1)
- matriz(matriz.Length - 1).codigo = CInt(txtb_codigo.Text)
- matriz(matriz.Length - 1).fecha = CDate(txtb_fecha.Text)
- matriz(matriz.Length - 1).nombre = CStr(Trim(txtb_nombre.Text))
- matriz(matriz.Length - 1).cuota = CDec(txtb_cuota.Text)
- txtb_codigo.Clear()
- txtb_fecha.Clear()
- txtb_nombre.Clear()
- txtb_cuota.Clear()
- MsgBox("Agregado")
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement