Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Class frm_menu
  2.     Private Structure clientes
  3.         Public codigo As Integer
  4.         Public fecha As String
  5.         Public nombre As String
  6.         Public cuota As Decimal
  7.     End Structure
  8.     Dim matriz() As clientes
  9.  
  10.     Dim fechaok = True
  11.     Dim cuotaok = False
  12.     Dim Ccuota As String
  13.     Dim controlDecimal = False
  14.     Dim i As Integer
  15.     Private Sub frm_menu_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
  16.     End Sub
  17.     ''Boton agregado
  18.    Private Sub btn_agregar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_agregar.Click
  19.         ''Asignacion de dimension inicial
  20.        If IsNothing(matriz) Then
  21.             ReDim matriz(1)
  22.         End If
  23.         ''Modulo comprobación de fecha
  24.        If txtb_fecha.Text = "" Or CStr(txtb_fecha.Text).Length < 10 Then
  25.             MsgBox("El fecha campo esta incompleto", vbCritical)
  26.         ElseIf (GetChar(CStr(txtb_fecha.Text), 3) <> "/") Or (GetChar(CStr(txtb_fecha.Text), 6) <> "/") Then
  27.             MsgBox("La fecha no está en el formato estándar", vbCritical)
  28.             fechaok = False
  29.         Else
  30.             fechaok = True
  31.         End If
  32.         cuotaok = True
  33.             ''Comprobación de las entradas previas a la insercción en la matriz
  34.            If IsNumeric(txtb_codigo.Text) And fechaok And cuotaok Then
  35.                 ''Insertar comprobacion de fecha y nombre
  36.  
  37.             ReDim matriz(matriz.Length + 1)
  38.             matriz(matriz.Length - 1).codigo = CInt(txtb_codigo.Text)
  39.             matriz(matriz.Length - 1).fecha = CDate(txtb_fecha.Text)
  40.             matriz(matriz.Length - 1).nombre = CStr(Trim(txtb_nombre.Text))
  41.             matriz(matriz.Length - 1).cuota = CDec(txtb_cuota.Text)
  42.             txtb_codigo.Clear()
  43.             txtb_fecha.Clear()
  44.             txtb_nombre.Clear()
  45.             txtb_cuota.Clear()
  46.             MsgBox("Agregado")
  47.  
  48.      
  49.         End If
  50.     End Sub
  51.  
  52.  
  53. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement