validación de campos en los pop up

This commit is contained in:
Antonio Gonzalez
2020-05-29 19:57:48 -07:00
parent 03e14625a4
commit 58ab0499d0
12 changed files with 325 additions and 163 deletions

View File

@@ -67,23 +67,29 @@ Partial Class Bancos_PopUpBuscarIE
Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click
Dim ObjBancosIE As New ClsBancos
Dim Folio As String = "-1"
If TxtFolio.Text <> "" Then Folio = String.Format("%{0}%", TxtFolio.Text.Trim)
If ObjBancosIE.GetBancosIE(-1, DdlBanco.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, "-1", -1, Folio, "-1", -1, -1, -1, -1, -1, txtFechaI.Text.ToDate, MaxFecha.ToShortDateString.ToDate, MinFecha, MaxFecha, MinFecha, MaxFecha, -1, -1, UsuarioActual.CveEmpresa) Then
DtDatos = ObjBancosIE.DtResultados 'If(TxtFolio.Text <> "", ObjBancosIE.DtResultados.FiltraParametros(String.Format("Folio Like '{0}'", TxtFolio.Text)), ObjBancosIE.DtResultados)
If ValidarFiltrosSeleccionado() Then
Dim ObjBancosIE As New ClsBancos
If ObjBancosIE.GetBancosIE(-1, DdlBanco.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, "-1", -1, Folio, "-1", -1, -1, -1, -1, -1, txtFechaI.Text.ToDate,
MaxFecha.ToShortDateString.ToDate, MinFecha, MaxFecha, MinFecha, MaxFecha, -1, -1, UsuarioActual.CveEmpresa) Then
DtDatos = ObjBancosIE.DtResultados 'If(TxtFolio.Text <> "", ObjBancosIE.DtResultados.FiltraParametros(String.Format("Folio Like '{0}'", TxtFolio.Text)), ObjBancosIE.DtResultados)
Else
Alert("Ocurrió un error al consultar los Anticipos", TipoMensaje.MsgError)
DtDatos = Nothing
End If
ObjBancosIE.Dispose()
If DtDatos IsNot Nothing Then
GvDatos.DataSource = DtDatos
GvDatos.DataBind()
UpDatos.Update()
End If
Else
Alert("Ocurrió un error al consultar los Anticipos", TipoMensaje.MsgError)
DtDatos = Nothing
End If
ObjBancosIE.Dispose()
If DtDatos IsNot Nothing Then
GvDatos.DataSource = DtDatos
GvDatos.DataBind()
UpDatos.Update()
Alert("Asigne un valor a cualquiera de los filtros", TipoMensaje.MsgAdvertencia)
End If
End Sub
@@ -103,4 +109,11 @@ Partial Class Bancos_PopUpBuscarIE
End If
End Sub
Private Function ValidarFiltrosSeleccionado() As Boolean
If DdlBanco.SelectedValue.ToEntero > 0 Then Return True
If DdlCuenta.SelectedValue.ToEntero > 0 Then Return True
If TxtFolio.Text.Length > 0 Then Return True
Return False
End Function
End Class