protected void btnBuscarDesdeHasta_Click(object sender, EventArgs e)
        {
            if (txtBuscarNroGuia.Text != "")
            {
                txtFiltroDesde.Text = "";
                txtFiltroHasta.Text = "";
            }

            if (txtFiltroDesde.Text != "" && txtFiltroHasta.Text == "")
            {
                lblError.Visible = true;
                lblError.Text    = "*Debe Ingresar Una Fecha en 'Hasta:'<br/>";
                return;
            }
            else if (txtFiltroDesde.Text == "" && txtFiltroHasta.Text != "")
            {
                lblError.Visible = true;
                lblError.Text    = "*Debe Ingresar Una Fecha en 'Desde:'<br/>";
                return;
            }
            else
            {
                lblError.Visible = false;
                lblError.Text    = string.Empty;
            }


            SisPackController.AdministrarGrillas.Configurar(this.dtgGuiasTransfarmacoCierreOperativo, "guiaid", 400);
            IGuiasTransfarmaco guiastransfarmaco = GuiasTransfarmacoFactory.GetGuiasTransfarmaco();
            DataSet            ds = new DataSet();

            string desde = this.txtFiltroDesde.Text == "" ? "01/01/1900" : this.txtFiltroDesde.Text;
            string hasta = this.txtFiltroHasta.Text == "" ? "01/01/1900" : this.txtFiltroHasta.Text;

            DateTime desdeDateTime = DateTime.ParseExact(desde, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            DateTime hastaDateTime = DateTime.ParseExact(hasta, "dd/MM/yyyy", CultureInfo.InvariantCulture);

            guiastransfarmaco.FechaDesde = desdeDateTime;
            guiastransfarmaco.FechaHasta = hastaDateTime;
            guiastransfarmaco.NroGuia    = txtBuscarNroGuia.Text == "" ? 0 : Convert.ToInt32(txtBuscarNroGuia.Text);

            ds = guiastransfarmaco.GetGuiasSinCierreOperativo(int.Parse(Session["AgenciaConectadaID"].ToString()));

            this.dtgGuiasTransfarmacoCierreOperativo.DataSource = ds.Tables[0];

            this.dtgGuiasTransfarmacoCierreOperativo.CurrentPageIndex = 0;

            this.dtgGuiasTransfarmacoCierreOperativo.DataBind();

            this.Session["DsGridView"] = ds;
        }
        private void BindGrid(int currentPage)
        {
            SisPackController.AdministrarGrillas.Configurar(this.dtgGuiasTransfarmacoCierreOperativo, "guiaid", 400);
            IGuiasTransfarmaco guiastransfarmaco = GuiasTransfarmacoFactory.GetGuiasTransfarmaco();
            DataSet            ds = new DataSet();

            ds = guiastransfarmaco.GetGuiasSinCierreOperativo(int.Parse(Session["AgenciaConectadaID"].ToString()));

            this.dtgGuiasTransfarmacoCierreOperativo.DataSource = ds.Tables[0];

            this.dtgGuiasTransfarmacoCierreOperativo.CurrentPageIndex = currentPage;

            this.dtgGuiasTransfarmacoCierreOperativo.DataBind();

            //this.Session["DsGridView"] = ds;
        }