示例#1
0
    private void ObtenerSolicitudes(bool forzarBD)
    {
        if (ViewState["lista"] == null || forzarBD)
        {
            SolicitudBC sol = new SolicitudBC();
            DataTable   dt  = sol.ObtenerSolicitudesCarga(int.Parse(ddl_buscarSite.SelectedValue));
            ViewState["lista"] = dt;
            ViewState.Remove("filtrados");
        }
        DataView dw;

        if (ViewState["filtrados"] == null)
        {
            dw = new DataView((DataTable)ViewState["lista"]);
        }
        else
        {
            dw = new DataView((DataTable)ViewState["filtrados"]);
        }
        if (ViewState["sortExpresion"] != null && ViewState["sortExpresion"].ToString() != "")
        {
            dw.Sort = (String)ViewState["sortExpresion"];
        }
        this.gv_listar.DataSource = dw;
        this.gv_listar.DataBind();
    }
示例#2
0
    private void ObtenerSolicitudes(bool forzarBD)
    {
        if (this.ViewState["lista"] == null || forzarBD)
        {
            SolicitudBC sol     = new SolicitudBC();
            int         site_id = Convert.ToInt32(this.ddl_buscarSite.SelectedValue);
            int         play_id = Convert.ToInt32(this.ddl_buscarPlaya.SelectedValue);
            int         luga_id = Convert.ToInt32(this.ddl_buscarAnden.SelectedValue);
            int         nro     = 0;
            if (!string.IsNullOrEmpty(this.txt_buscarNumero.Text))
            {
                nro = Convert.ToInt32(this.txt_buscarNumero.Text);
            }
            int       estado  = Convert.ToInt32(this.ddl_buscarEstado.SelectedValue);
            int       tran_id = Convert.ToInt32(this.ddl_buscarTransportista.SelectedValue);
            string    ruta_id = this.txt_buscarRuta.Text;
            DataTable dt      = sol.ObtenerSolicitudesCarga(site_id, play_id, luga_id, nro, estado, tran_id, ruta_id);
            this.ViewState["lista"] = dt;
        }
        DataView dw = new DataView((DataTable)this.ViewState["lista"]);

        if (this.ViewState["sortExpresion"] != null && this.ViewState["sortExpresion"].ToString() != "")
        {
            dw.Sort = (String)this.ViewState["sortExpresion"];
        }
        this.gv_listar.DataSource = dw.ToTable();
        this.gv_listar.DataBind();
    }