Ejemplo n.º 1
0
        protected void btnFiltro_Click1(object sender, EventArgs e)
        {
            if (txtNumeroOT.Text.Length > 4)
            {
                RadGrid2.Visible    = false;
                RadGrid1.Visible    = true;
                RadGrid1.DataSource = controldes.ListarDespacho_informePorOT(txtNumeroOT.Text, null, null, null, null, 1);
                RadGrid1.DataBind();

                ibPDF.Visible = false;
            }
            else
            {
                if (txtFechaInicio.Text != "" && txtFechaTermino.Text != "")
                {
                    string   fechaI = txtFechaInicio.Text;
                    string[] str    = fechaI.Split('/');
                    string   dia    = str[0];
                    string   mes    = str[1];
                    string   año    = str[2];
                    año = año.Substring(0, 4);

                    string fechaInicio = año + "-" + mes + "-" + dia;
                    //fechas
                    string   fechaT = txtFechaTermino.Text;
                    string[] str2   = fechaT.Split('/');
                    string   dia2   = str2[0];
                    string   mes2   = str2[1];
                    string   año2   = str2[2];
                    año2 = año2.Substring(0, 4);

                    string fechaTermino = año2 + "-" + mes2 + "-" + dia2;
                    RadGrid1.Visible = false;
                    RadGrid2.Visible = true;
                    //carga con fechas
                    if (fechaInicio == fechaTermino)
                    {
                        fechaInicio  = fechaInicio + " 00:00:00";
                        fechaTermino = fechaTermino + " 23:59:59";
                    }
                    RadGrid2.DataSource = controldes.ListarDespacho_informePorOTAgrupada(txtNombreOT.Text, txtNumeroOT.Text, fechaInicio, fechaTermino, 2);
                    RadGrid2.DataBind();

                    ibPDF.Visible = false;
                }
                else
                {
                    string fi = "2012-01-01 00:00:00";
                    string ft = "2100-01-01 23:59:59";
                    RadGrid1.Visible = false;
                    RadGrid2.Visible = true;
                    //carga con fechas
                    RadGrid2.DataSource = controldes.ListarDespacho_informePorOTAgrupada(txtNombreOT.Text, txtNumeroOT.Text, fi, ft, 3);
                    RadGrid2.DataBind();


                    ibPDF.Visible = false;
                }
            }
        }
        public void CargarGrillaFecha_Filtro()
        {
            string fechaI = DateTime.Now.ToString("dd/MM/yyyy");

            string[] str = fechaI.Split('/');
            string   dia = str[0];
            string   mes = str[1];
            string   año = str[2];

            año = año.Substring(0, 4);

            string fechaInicio = año + "-" + mes + "-" + dia;
            //fechas
            string fechaT = DateTime.Now.ToString("dd/MM/yyyy");

            string[] str2 = fechaT.Split('/');
            string   dia2 = str2[0];
            string   mes2 = str2[1];
            string   año2 = str2[2];

            año2 = año2.Substring(0, 4);

            string fechaTermino = año2 + "-" + mes2 + "-" + dia2 + " 23:59:59";

            RadGrid1.DataSource = controldes.ListarDespacho_informePorOTAgrupada("", "", fechaInicio, fechaTermino, 2);
            RadGrid1.DataBind();
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string ot       = Request.QueryString["ot"];
            string nombreot = Request.QueryString["not"];
            string fi       = Request.QueryString["fi"];
            string ft       = Request.QueryString["ft"];


            if (ot != "")
            {
                lblTitulo2.Text = "OT: " + ot.ToUpper();
            }
            else if (fi != "" && ft != "")
            {
                lblTitulo2.Text = "DESDE " + fi + "  HASTA " + ft;
            }



            if (ot.Length > 4)
            {
                RadGrid2.Visible    = false;
                RadGrid1.Visible    = true;
                RadGrid1.DataSource = controldes.ListarDespacho_informePorOT(ot, null, null, null, null, 1);
                RadGrid1.DataBind();
            }
            else
            {
                if (Request.QueryString["fi"] != "" && Request.QueryString["ft"] != "")
                {
                    string   fechaI = fi;
                    string[] str    = fechaI.Split('/');
                    string   dia    = str[0];
                    string   mes    = str[1];
                    string   año    = str[2];
                    año = año.Substring(0, 4);

                    string fechaInicio = año + "-" + mes + "-" + dia;
                    //fechas
                    string   fechaT = ft;
                    string[] str2   = fechaT.Split('/');
                    string   dia2   = str2[0];
                    string   mes2   = str2[1];
                    string   año2   = str2[2];
                    año2 = año2.Substring(0, 4);

                    string fechaTermino = año2 + "-" + mes2 + "-" + dia2;
                    RadGrid1.Visible = false;
                    RadGrid2.Visible = true;
                    //carga con fechas
                    if (fechaInicio == fechaTermino)
                    {
                        fechaInicio  = fechaInicio + " 00:00:00";
                        fechaTermino = fechaTermino + " 23:59:59";
                    }
                    RadGrid2.DataSource = controldes.ListarDespacho_informePorOTAgrupada(ot, nombreot, fechaInicio, fechaTermino, 2);
                    RadGrid2.DataBind();
                }
                else
                {
                    string fi2 = "2012-01-01 00:00:00";
                    string ft2 = "2100-01-01 23:59:59";
                    RadGrid1.Visible = false;
                    RadGrid2.Visible = true;
                    //carga con fechas
                    RadGrid2.DataSource = controldes.ListarDespacho_informePorOTAgrupada(ot, nombreot, fi2, ft2, 3);
                    RadGrid2.DataBind();
                }
            }
        }