Validacion de fecha de ajuste
This commit is contained in:
@@ -7130,12 +7130,22 @@ Partial Class PV
|
||||
'End Sub
|
||||
|
||||
Private Function CalculaMesesUso() As Boolean
|
||||
Dim FechaI As Date = TxtFechaAjuste.Text.ToDate.AddDays(1)
|
||||
Dim FechaI As Date = Now
|
||||
|
||||
If IsDate(TxtFechaAjuste.Text) Then
|
||||
FechaI = TxtFechaAjuste.Text.ToDate.AddDays(1)
|
||||
Else
|
||||
TxtMesesUso.Text = ""
|
||||
Alert("La fecha de ajuste no tiene el formato correcto", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
|
||||
Dim FechaF As Date = Now
|
||||
|
||||
If FechaI.AddDays(-1) > FechaF Then
|
||||
TxtMesesUso.Text = ""
|
||||
TxtFechaAjuste.Text = FechaF.ToString("dd/MM/yyyy")
|
||||
Alert("La fecha de ajuste debe ser menor a la fecha actual", TipoMensaje.ToastAdventencia)
|
||||
Alert("La fecha de ajuste debe ser menor a la fecha actual", TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
|
||||
|
||||
Reference in New Issue
Block a user