validación de campos en los pop up
This commit is contained in:
@@ -26,27 +26,32 @@ public partial class CGame_PopUpBuscarProduccion :ClsPaginas
|
||||
ClsCGame ObjCort = new ClsCGame();
|
||||
if (ObjCort.GetHuerta(UsuarioActual.CveEmpresa))
|
||||
{
|
||||
DdlHuerta.DataSource = ObjCort.DtResultados;
|
||||
DdlHuerta.Items.Insert(0, new ListItem("Todos", "-1"));
|
||||
DdlHuerta.DataBind();
|
||||
}
|
||||
DdlHuerta.DataSource = ObjCort.DtResultados;
|
||||
DdlHuerta.Items.Insert(0, new ListItem("Todos", "-1"));
|
||||
UPDatos.Update();
|
||||
}
|
||||
|
||||
protected void Consultar_Click(object sender, EventArgs e)
|
||||
DdlHuerta.DataBind();
|
||||
}
|
||||
ObjCort.Dispose();
|
||||
UPDatos.Update();
|
||||
}
|
||||
String Folio;
|
||||
if (TxtFolio.Text != "") { Folio = TxtFolio.Text; } else { Folio = "-1"; }
|
||||
ClsCGame ObjCGame = new ClsCGame();
|
||||
if (ObjCGame.GetProduccion(UsuarioActual.CveEmpresa, Folio, -1, DdlHuerta.SelectedValue.ToEntero(), TxtFechaEntregaI.Text.ToDate(), TxtFechaEntregaF.Text.ToDate()))
|
||||
{
|
||||
|
||||
protected void Consultar_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (ValidarFiltrosSeleccionados())
|
||||
{
|
||||
String Folio;
|
||||
if (TxtFolio.Text != "") { Folio = TxtFolio.Text; } else { Folio = "-1"; }
|
||||
ClsCGame ObjCGame = new ClsCGame();
|
||||
if (ObjCGame.GetProduccion(UsuarioActual.CveEmpresa, Folio, -1, DdlHuerta.SelectedValue.ToEntero(), TxtFechaEntregaI.Text.ToDate(), TxtFechaEntregaF.Text.ToDate()))
|
||||
{
|
||||
GvDatos.DataSource = ObjCGame.DtResultados;
|
||||
GvDatos.DataBind();
|
||||
LtlTotalRegistros.Text = ObjCGame.DtResultados.Rows.Count.ToString();
|
||||
if (ObjCGame.DtResultados.Rows.Count < 1)
|
||||
{
|
||||
Alert("No se encontraron resultados con los filtros seleccionados", TipoMensaje.MsgAdvertencia);
|
||||
}
|
||||
else
|
||||
LtlTotalRegistros.Text = ObjCGame.DtResultados.Rows.Count.ToString();
|
||||
if (ObjCGame.DtResultados.Rows.Count < 1)
|
||||
{
|
||||
Alert("No se encontraron resultados con los filtros seleccionados", TipoMensaje.MsgAdvertencia);
|
||||
TblBusqueda.Visible = true;
|
||||
}
|
||||
}
|
||||
@@ -60,4 +65,12 @@ public partial class CGame_PopUpBuscarProduccion :ClsPaginas
|
||||
}
|
||||
|
||||
#region GridView
|
||||
protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
|
||||
e.Row.FCLabel("LblFolio").Text = String.Format("<div class='truncate' style='width:200px;'>{0}{1}</a></div>", "<a href='javascript:Ir("+"" + e.Row.DBCampo("CveProduccion") + ""+");'>", e.Row.DBCampo("Folio"));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -37,19 +37,23 @@ Partial Class CGame_PopUpBuscarOrdenProduccion
|
||||
Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click
|
||||
Dim Folio As String
|
||||
If TxtFolio.Text.Trim <> "" Then Folio = TxtFolio.Text Else Folio = "-1"
|
||||
Dim ObjOP As New ClsCGame
|
||||
If ObjOP.GetOrdenProduccion(-1, UsuarioActual.CveEmpresa, DdlEstatus.SelectedValue.ToEntero, Folio, TxtFechaEntregaI.Text.ToDate, TxtFechaEntregaF.Text.ToDate, DdlCliente.SelectedValue.ToEntero) Then
|
||||
GvOP.DataSource = ObjOP.DtResultados
|
||||
GvOP.DataBind()
|
||||
LtlTotalRegistros.Text = ObjOP.DtResultados.Rows.Count.ToString
|
||||
If Not ObjOP.DtResultados.Rows.Count > 0 Then
|
||||
Alert("No se encontraron resultados con los filtros seleccionados", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
TblBusqueda.Visible = True
|
||||
If ValidarFiltrosSeleccionado() Then
|
||||
Dim ObjOP As New ClsCGame
|
||||
If ObjOP.GetOrdenProduccion(-1, UsuarioActual.CveEmpresa, DdlEstatus.SelectedValue.ToEntero, Folio, TxtFechaEntregaI.Text.ToDate, TxtFechaEntregaF.Text.ToDate, DdlCliente.SelectedValue.ToEntero) Then
|
||||
GvOP.DataSource = ObjOP.DtResultados
|
||||
GvOP.DataBind()
|
||||
LtlTotalRegistros.Text = ObjOP.DtResultados.Rows.Count.ToString
|
||||
If Not ObjOP.DtResultados.Rows.Count > 0 Then
|
||||
Alert("No se encontraron resultados con los filtros seleccionados", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
TblBusqueda.Visible = True
|
||||
End If
|
||||
End If
|
||||
ObjOP.Dispose()
|
||||
UPDatos.Update()
|
||||
Else
|
||||
Alert("Seleccione un criterio de busqueda", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
ObjOP.Dispose()
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub GvOP_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvOP.RowDataBound
|
||||
@@ -57,4 +61,13 @@ Partial Class CGame_PopUpBuscarOrdenProduccion
|
||||
e.Row.FCLabel("LblFolio").Text = String.Format("<div class='truncate' style='width:200px;'>{0}{1}</a></div>", "<a href='javascript:Ir(""" & e.Row.DBCampo("CveOrdenProduccion") & """);'>", e.Row.DBCampo("Folio"))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function ValidarFiltrosSeleccionado() As Boolean
|
||||
If DdlEstatus.SelectedValue.ToEntero > 0 Then Return True
|
||||
If TxtFolio.Text.Length > 0 Then Return True
|
||||
If TxtFechaEntregaI.Text.Length > 0 Then Return True
|
||||
If TxtFechaEntregaF.Text.Length > 0 Then Return True
|
||||
If DdlCliente.SelectedValue.ToEntero > 0 Then Return True
|
||||
Return False
|
||||
End Function
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user