Beispiel #1
0
        protected void Chccerrados_CheckedChanged(object sender, EventArgs e)
        {
            if (Txtfechainicio.Text != "" & Txtfechafinal.Text != "")
            {
                Chcabiertos.Checked = false;
                string ubi            = Cmbubicacion.SelectedItem.Text;
                string ar             = Cmbarea.Text;
                Int32  abier          = 2;
                var    _FormatoIdioma = new CultureInfo("en-US");
                var    _oF1           = DateTime.Parse(TextBox1.Text, _FormatoIdioma);
                var    _oF2           = DateTime.Parse(TextBox2.Text, _FormatoIdioma);

                Lbltitulo.Text = "Reportes Cerrados";

                if (ar != "Todas")
                {
                    GridView1.DataSource = NegIngenieros.busquedafechaarea(ubi, ar, _oF1, _oF2, abier);
                }
                else
                {
                    GridView1.DataSource = NegIngenieros.busquedafechaareatotal(ubi, _oF1, _oF2, abier);
                }


                //GridView1.DataSource = NegIngenieros.busquedafechaarea(ubi, ar, _oF1, _oF2, abier);
                GridView1.Columns[11].HeaderText   = "Ing. que atendio";
                this.GridView1.Columns[8].Visible  = true;
                this.GridView1.Columns[10].Visible = true;
                this.GridView1.Columns[14].Visible = true;
                GridView1.DataBind();
                Lblcontador.Visible = true;
                Lblcontador.Text    = "Total de reportes Cerrados:";
                Txtcontador.Visible = true;
                Txtcontador.Text    = this.GridView1.Rows.Count.ToString();

                if (Convert.ToInt32(Txtcontador.Text) == 0)
                {
                    Lbltitulo.Text      = "No se encontraron registros con los datos proporcionados";
                    Chcabiertos.Checked = false;
                    Chccerrados.Checked = false;
                }

                Chcabiertos.Checked = false;
                Chccerrados.Checked = false;
                Txtbandera.Text     = "2";
            }
            else
            {
                Lbltitulo.Text      = "Falta proporcionar datos";
                Chcabiertos.Checked = false;
                Chccerrados.Checked = false;
            }
        }
Beispiel #2
0
        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            if (Convert.ToInt32(Txtbandera.Text) == 1)

            {
                GridView1.PageIndex = e.NewPageIndex;

                Chccerrados.Checked = false;
                string ubi            = Cmbubicacion.SelectedItem.Text;
                string ar             = Cmbarea.Text;
                Int32  abier          = 1;
                var    _FormatoIdioma = new CultureInfo("en-US");
                var    _oF1           = DateTime.Parse(TextBox1.Text, _FormatoIdioma);
                var    _oF2           = DateTime.Parse(TextBox2.Text, _FormatoIdioma);

                Lbltitulo.Text = "Reportes Abiertos o en Proceso";
                if (ar != "Todas")
                {
                    GridView1.DataSource = NegIngenieros.busquedafechaarea(ubi, ar, _oF1, _oF2, abier);
                }
                else
                {
                    GridView1.DataSource = NegIngenieros.busquedafechaareatotal(ubi, _oF1, _oF2, abier);
                }



                GridView1.Columns[11].HeaderText = "Ing. que atendera";
                GridView1.DataBind();
                Lblcontador.Visible = true;
                Lblcontador.Text    = "Total de reportes Abiertos:";
                Txtcontador.Visible = true;
                Txtcontador.Text    = this.GridView1.Rows.Count.ToString();

                this.GridView1.Columns[8].Visible  = false;
                this.GridView1.Columns[10].Visible = false;
                this.GridView1.Columns[14].Visible = false;
                Chcabiertos.Checked = false;
                Chccerrados.Checked = false;
                Txtbandera.Text     = "1";
            }

            else
            {
                GridView1.PageIndex = e.NewPageIndex;
                Chcabiertos.Checked = false;
                string ubi            = Cmbubicacion.SelectedItem.Text;
                string ar             = Cmbarea.Text;
                Int32  abier          = 2;
                var    _FormatoIdioma = new CultureInfo("en-US");
                var    _oF1           = DateTime.Parse(TextBox1.Text, _FormatoIdioma);
                var    _oF2           = DateTime.Parse(TextBox2.Text, _FormatoIdioma);

                Lbltitulo.Text = "Reportes Cerrados";

                if (ar != "Todas")
                {
                    GridView1.DataSource = NegIngenieros.busquedafechaarea(ubi, ar, _oF1, _oF2, abier);
                }
                else
                {
                    GridView1.DataSource = NegIngenieros.busquedafechaareatotal(ubi, _oF1, _oF2, abier);
                }


                //GridView1.DataSource = NegIngenieros.busquedafechaarea(ubi, ar, _oF1, _oF2, abier);
                GridView1.Columns[11].HeaderText   = "Ing. que atendio";
                this.GridView1.Columns[8].Visible  = true;
                this.GridView1.Columns[10].Visible = true;
                this.GridView1.Columns[14].Visible = true;
                GridView1.DataBind();
                Lblcontador.Visible = true;
                Lblcontador.Text    = "Total de reportes Cerrados:";
                Txtcontador.Visible = true;
                Txtcontador.Text    = this.GridView1.Rows.Count.ToString();

                Chcabiertos.Checked = false;
                Chccerrados.Checked = false;
                Txtbandera.Text     = "2";
            }
        }
Beispiel #3
0
        protected void Chcabiertos_CheckedChanged(object sender, EventArgs e)
        {
            if (Txtfechainicio.Text != "" & Txtfechafinal.Text != "")
            {
                Chccerrados.Checked = false;
                string ubi            = Cmbubicacion.SelectedItem.Text;
                string ar             = Cmbarea.Text;
                Int32  abier          = 1;
                var    _FormatoIdioma = new CultureInfo("en-US");
                //var _oF1 = DateTime.Parse(TextBox1.Text, _FormatoIdioma);
                //var _oF2 = DateTime.Parse(TextBox2.Text, _FormatoIdioma);

                // MM/dd/yyyy
                var FechaIni = TextBox1.Text.Split('/');
                var FechaFin = TextBox2.Text.Split('/');


                //var _oF1 = new DateTime(Convert.ToInt32(FechaIni[2]), Convert.ToInt32(FechaIni[0]), Convert.ToInt32(FechaIni[1]));
                //var _oF2 = new DateTime(Convert.ToInt32(FechaFin[2]), Convert.ToInt32(FechaFin[0]), Convert.ToInt32(FechaFin[1]));


                DateTime _oF1 = Convert.ToDateTime(TextBox1.Text);
                DateTime _oF2 = Convert.ToDateTime(TextBox2.Text);

                //Lbltitulo.Text = "Fecha inicial: "+ _oF1+"   "+"fecha final: "+_oF2;
                Lbltitulo.Text = "Reportes Abiertos o en Proceso";
                if (ar != "Todas")
                {
                    GridView1.DataSource = NegIngenieros.busquedafechaarea(ubi, ar, _oF1, _oF2, abier);
                }
                else
                {
                    GridView1.DataSource = NegIngenieros.busquedafechaareatotal(ubi, _oF1, _oF2, abier);
                }



                GridView1.Columns[11].HeaderText = "Ing. que atendera";
                GridView1.DataBind();
                Lblcontador.Visible = true;
                Lblcontador.Text    = "Total de reportes Abiertos:";
                Txtcontador.Visible = true;
                Txtcontador.Text    = this.GridView1.Rows.Count.ToString();
                if (Convert.ToInt32(Txtcontador.Text) == 0)
                {
                    Lbltitulo.Text      = "No se encontraron registros con los datos proporcionados";
                    Chcabiertos.Checked = false;
                    Chccerrados.Checked = false;
                }
                this.GridView1.Columns[8].Visible  = false;
                this.GridView1.Columns[10].Visible = false;
                this.GridView1.Columns[14].Visible = false;
                Chcabiertos.Checked = false;
                Chccerrados.Checked = false;
                Txtbandera.Text     = "1";
            }
            else
            {
                Lbltitulo.Text      = "Falta proporcionar datos";
                Chcabiertos.Checked = false;
                Chccerrados.Checked = false;
            }
        }