using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI.WebControls; using Extensiones; using System.Data; using static Extensiones.ModExtensiones; public partial class CGame_PopUpBuscarProduccion :ClsPaginas { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ((BaseMasterPage) this.Master).EsPopup = true; TxtFechaEntregaI.Text = DateTime.Now.ToString(); TxtFechaEntregaF.Text = DateTime.Now.ToString(); CargaHuerta(); } } protected void CargaHuerta() { ClsCGame ObjCort = new ClsCGame(); if (ObjCort.GetHuerta(UsuarioActual.CveEmpresa)) { DdlHuerta.DataSource = ObjCort.DtResultados; DdlHuerta.Items.Insert(0, new ListItem("Todos", "-1")); DdlHuerta.DataBind(); } ObjCort.Dispose(); UPDatos.Update(); } 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(),TopSelect:100)) { 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 { TblBusqueda.Visible = true; } } ObjCGame.Dispose(); UPDatos.Update(); }else { Alert("Seleccione un criterio de busqueda",TipoMensaje.MsgAdvertencia); } } #region GridView protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.FCLabel("LblFolio").Text = String.Format("
{0}{1}
", "", e.Row.DBCampo("Folio")); } } #endregion private bool ValidarFiltrosSeleccionados() { if(TxtFolio.Text.Length > 0) return true; if(DdlHuerta.SelectedValue.ToEntero() > 0) return true; if(TxtFechaEntregaI.Text.Length > 0) return true; if(TxtFechaEntregaF.Text.Length > 0) return true; return false; } }