protected void grvreportes_PageIndexChanging(object sender, GridViewPageEventArgs e) { paginacion = 0; paginacion = Convert.ToInt32(Request.QueryString["men"]); if (paginacion == 1) { grvreportes.PageIndex = e.NewPageIndex; grvreportes.DataSource = NegIngenieros.listaringenieros(1); grvreportes.Columns[11].HeaderText = "Ing. que atendera"; grvreportes.DataBind(); //Lblcontador.Text = "Total de reportes Abiertos:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); this.grvreportes.Columns[8].Visible = false; this.grvreportes.Columns[10].Visible = false; this.grvreportes.Columns[14].Visible = false; } if (paginacion == 2) { grvreportes.PageIndex = e.NewPageIndex; grvreportes.DataSource = NegTotalreportes.listarreportescerradoss(2); grvreportes.DataBind(); //Lblcontador.Text = "Total de reportes cerrados:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); } if (paginacion == 3) { grvreportes.PageIndex = e.NewPageIndex; grvreportes.DataSource = NegIngenieros.reportesroberto(1); grvreportes.Columns[11].HeaderText = "Ing. que atendera"; grvreportes.DataBind(); //Lblcontador.Text = "Total de reportes Abiertos:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); this.grvreportes.Columns[8].Visible = false; this.grvreportes.Columns[10].Visible = false; this.grvreportes.Columns[14].Visible = false; } if (paginacion == 4) { grvreportes.PageIndex = e.NewPageIndex; grvreportes.DataSource = NegTotalreportes.listarreportescerrados(Txcord.Text, 2); grvreportes.DataBind(); //Lblcontador.Text = "Total de reportes cerrados:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); } if (paginacion == 5) { grvreportes.PageIndex = e.NewPageIndex; grvreportes.DataSource = NegIngenieros.reporteshector(1); grvreportes.Columns[11].HeaderText = "Ing. que atendera"; grvreportes.DataBind(); //Lblcontador.Text = "Total de reportes Abiertos:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); this.grvreportes.Columns[8].Visible = false; this.grvreportes.Columns[10].Visible = false; this.grvreportes.Columns[14].Visible = false; } if (paginacion == 6) { grvreportes.PageIndex = e.NewPageIndex; grvreportes.DataSource = NegTotalreportes.listarreportescerrados(Txcord.Text, 2); grvreportes.DataBind(); //Lblcontador.Text = "Total de reportes cerrados:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); } if (paginacion == 7) { grvreportes.PageIndex = e.NewPageIndex; grvreportes.DataSource = NegIngenieros.reportesfrancisco(1); grvreportes.Columns[11].HeaderText = "Ing. que atendera"; grvreportes.DataBind(); //Lblcontador.Text = "Total de reportes Abiertos:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); this.grvreportes.Columns[8].Visible = false; this.grvreportes.Columns[10].Visible = false; this.grvreportes.Columns[14].Visible = false; } if (paginacion == 8) { grvreportes.PageIndex = e.NewPageIndex; grvreportes.DataSource = NegTotalreportes.listarreportesporingeniero(Txcord.Text, 2); grvreportes.DataBind(); //Lblcontador.Text = "Total de reportes cerrados:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); } if (paginacion == 9) { grvreportes.PageIndex = e.NewPageIndex; grvreportes.DataSource = NegIngenieros.reportessegismundo(1); grvreportes.Columns[11].HeaderText = "Ing. que atendera"; grvreportes.DataBind(); //Lblcontador.Text = "Total de reportes Abiertos:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); this.grvreportes.Columns[8].Visible = false; this.grvreportes.Columns[10].Visible = false; this.grvreportes.Columns[14].Visible = false; } if (paginacion == 10) { grvreportes.PageIndex = e.NewPageIndex; grvreportes.DataSource = NegTotalreportes.listarreportesporingeniero(Txcord.Text, 2); grvreportes.DataBind(); Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); } if (paginacion == 11) { grvreportes.PageIndex = e.NewPageIndex; grvreportes.DataSource = NegIngenieros.reportesrobert(1); grvreportes.Columns[11].HeaderText = "Ing. que atendera"; grvreportes.DataBind(); //Lblcontador.Text = "Total de reportes Abiertos:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); this.grvreportes.Columns[8].Visible = false; this.grvreportes.Columns[10].Visible = false; this.grvreportes.Columns[14].Visible = false; } if (paginacion == 12) { grvreportes.PageIndex = e.NewPageIndex; grvreportes.DataSource = NegTotalreportes.listarreportesporingeniero(Txcord.Text, 2); grvreportes.DataBind(); //Lblcontador.Text = "Total de reportes cerrados:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); } if (paginacion == 13) { grvreportes.PageIndex = e.NewPageIndex; grvreportes.DataSource = NegIngenieros.reporteshetor(1); grvreportes.Columns[11].HeaderText = "Ing. que atendera"; grvreportes.DataBind(); //Lblcontador.Text = "Total de reportes Abiertos:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); this.grvreportes.Columns[8].Visible = false; this.grvreportes.Columns[10].Visible = false; this.grvreportes.Columns[14].Visible = false; } if (paginacion == 14) { grvreportes.PageIndex = e.NewPageIndex; grvreportes.DataSource = NegTotalreportes.listarreportesporingeniero(Txcord.Text, 2); grvreportes.DataBind(); //Lblcontador.Text = "Total de reportes cerrados:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); } if (paginacion == 15) { grvreportes.PageIndex = e.NewPageIndex; grvreportes.DataSource = NegIngenieros.reportesangel(1); grvreportes.Columns[11].HeaderText = "Ing. que atendera"; grvreportes.DataBind(); //Lblcontador.Text = "Total de reportes Abiertos:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); this.grvreportes.Columns[8].Visible = false; this.grvreportes.Columns[10].Visible = false; this.grvreportes.Columns[14].Visible = false; } if (paginacion == 16) { grvreportes.PageIndex = e.NewPageIndex; grvreportes.DataSource = NegTotalreportes.listarreportesporingeniero(Txcord.Text, 2); grvreportes.DataBind(); Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); } //if (paginacion==5) //{ // grvreportes.PageIndex = e.NewPageIndex; //grvreportes.DataSource = NegIngenieros.reporteshector(1); //grvreportes.DataBind(); //Txtcontador.Visible = true; //Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); //} }
private void reportescerrados() { mes = 0; string mess = ""; diademes = 0; diademess = 1; string mesactual = DateTime.Now.Month.ToString(); string añoactual = DateTime.Now.Year.ToString(); string diaactual = DateTime.Now.Day.ToString(); var _FormatoIdioma = new CultureInfo("en-US"); var _oF1 = DateTime.Parse(Txtfecha.Text, _FormatoIdioma); var _oF2 = DateTime.Parse(Txfinal.Text, _FormatoIdioma); List <EntIngenieros> lista = NegTotalreportes.fechafinalgrafica(_oF1, _oF2); if ((lista.Count) == 0) { if (diadehoy.Month == Convert.ToInt32(cmbmes.Text)) { if (diadehoy.Year == Convert.ToInt32("20" + cmbano.Text)) { for (int x = 1; x <= Convert.ToInt32(diaactual); x++) { celda.Text = Convert.ToString(totalre); celda.Width = 300; fila.Cells.Add(celda); totalreportescerrados[diademess] = Convert.ToInt32(celda.Text); fila.HorizontalAlign = HorizontalAlign.Center; fila.VerticalAlign = VerticalAlign.Bottom; pintarfila(); diademess = diademess + 1; totalre = 0; celda = new TableCell(); } diademess = diademess - 1; fecha2 = diademess; } } else { string prueba1 = "1/" + cmbmes.Text + "/" + cmbano.Text; string prueba2 = DateTime.Now.ToShortDateString(); prueba2 = "1/" + diadehoy.Month + "/" + diadehoy.Year; var _FormatoIdiomas = new CultureInfo("en-US"); var _oF11 = DateTime.Parse(prueba1, _FormatoIdioma); var _oF22 = DateTime.Parse(prueba2, _FormatoIdioma); if (_oF11 < _oF22) { for (contador = diademess; contador <= rellenardias; contador++) { celda = new TableCell(); celda.Text = "0"; celda.Width = 300; fila.Cells.Add(celda); totalreportescerrados[diademess] = Convert.ToInt32(celda.Text); fila.HorizontalAlign = HorizontalAlign.Center; fila.VerticalAlign = VerticalAlign.Bottom; pintarfila(); fecha2 = Convert.ToInt32(fecha); diademess = diademess + 1; } } diademess = diademess - 1; fecha2 = diademess; } } else { foreach (EntIngenieros obj in lista) { fecha = obj.fechafinal.Day.ToString(); mess = obj.fechafinal.Month.ToString(); mes = Convert.ToInt32(mess); if (mes == 1 | mes == 3 | mes == 5 | mes == 7 | mes == 8 | mes == 10 | mes == 12) { for (contador = 0; contador < 31; contador++) { if (diademess == Convert.ToInt32(fecha)) { contador = 31; diademess = Convert.ToInt32(fecha); fecha2 = diademess; } else { celda.Text = Convert.ToString(totalre); celda.Width = 300; fila.Cells.Add(celda); totalreportescerrados[diademess] = Convert.ToInt32(celda.Text); fila.HorizontalAlign = HorizontalAlign.Center; fila.VerticalAlign = VerticalAlign.Bottom; pintarfila(); diademess = diademess + 1; totalre = 0; celda = new TableCell(); } } if (fecha2 == Convert.ToInt32(fecha)) { totalre = totalre + 1; } else { celda.Text = Convert.ToString(totalre); celda.Width = 300; fila.Cells.Add(celda); totalreportescerrados[diademess] = Convert.ToInt32(celda.Text); fila.HorizontalAlign = HorizontalAlign.Center; fila.VerticalAlign = VerticalAlign.Bottom; pintarfila(); fecha2 = Convert.ToInt32(fecha); totalre = 0; celda = new TableCell(); } } else if (mes == 2) { for (contador = 0; contador < 29; contador++) { if (diademess == Convert.ToInt32(fecha)) { contador = 31; diademess = Convert.ToInt32(fecha); fecha2 = diademess; } else { celda.Text = Convert.ToString(totalre); celda.Width = 300; fila.Cells.Add(celda); totalreportescerrados[diademess] = Convert.ToInt32(celda.Text); fila.HorizontalAlign = HorizontalAlign.Center; fila.VerticalAlign = VerticalAlign.Bottom; pintarfila(); diademess = diademess + 1; totalre = 0; celda = new TableCell(); } } if (fecha2 == Convert.ToInt32(fecha)) { totalre = totalre + 1; } else { celda.Text = Convert.ToString(totalre); celda.Width = 300; fila.Cells.Add(celda); totalreportescerrados[diademess] = Convert.ToInt32(celda.Text); fila.HorizontalAlign = HorizontalAlign.Center; fila.VerticalAlign = VerticalAlign.Bottom; pintarfila(); fecha2 = Convert.ToInt32(fecha); totalre = 0; celda = new TableCell(); } } else { for (contador = 0; contador < 30; contador++) { if (diademess == Convert.ToInt32(fecha)) { contador = 31; diademess = Convert.ToInt32(fecha); fecha2 = diademess; } else { celda.Text = Convert.ToString(totalre); celda.Width = 300; fila.Cells.Add(celda); totalreportescerrados[diademess] = Convert.ToInt32(celda.Text); fila.HorizontalAlign = HorizontalAlign.Center; fila.VerticalAlign = VerticalAlign.Bottom; pintarfila(); diademess = diademess + 1; totalre = 0; celda = new TableCell(); } } if (fecha2 == Convert.ToInt32(fecha)) { totalre = totalre + 1; } else { celda.Text = Convert.ToString(totalre); celda.Width = 300; fila.Cells.Add(celda); totalreportescerrados[diademess] = Convert.ToInt32(celda.Text); fila.HorizontalAlign = HorizontalAlign.Center; fila.VerticalAlign = VerticalAlign.Bottom; pintarfila(); fecha2 = Convert.ToInt32(fecha); totalre = 0; celda = new TableCell(); } } } celda.Text = Convert.ToString(totalre); celda.Width = 300; fila.Cells.Add(celda); totalreportescerrados[diademess] = Convert.ToInt32(celda.Text); fila.HorizontalAlign = HorizontalAlign.Center; fila.VerticalAlign = VerticalAlign.Bottom; pintarfila(); fecha2 = Convert.ToInt32(fecha); totalre = 0; celda = new TableCell(); diademess = diademess + 1; if (diadehoy.Month == Convert.ToInt32(cmbmes.Text)) { if (diadehoy.Year == Convert.ToInt32("20" + cmbano.Text)) { for (contador = 0; contador < 31; contador++) { if (diademess <= diadehoy.Day) { celda = new TableCell(); celda.Text = "0"; celda.Width = 300; fila.Cells.Add(celda); totalreportescerrados[diademess] = Convert.ToInt32(celda.Text); fila.HorizontalAlign = HorizontalAlign.Center; fila.VerticalAlign = VerticalAlign.Bottom; pintarfila(); fecha2 = Convert.ToInt32(fecha); diademess = diademess + 1; } else { diademess = diademess - 1; fecha2 = diademess; contador = 32; } } } } else { string prueba1 = "1/" + cmbmes.Text + "/" + cmbano.Text; string prueba2 = DateTime.Now.ToShortDateString(); prueba2 = "1/" + diadehoy.Month + "/" + diadehoy.Year; var _FormatoIdiomas = new CultureInfo("en-US"); var _oF11 = DateTime.Parse(prueba1, _FormatoIdioma); var _oF22 = DateTime.Parse(prueba2, _FormatoIdioma); if (_oF11 < _oF22) { for (contador = diademess; contador <= rellenardias; contador++) { celda = new TableCell(); celda.Text = "0"; celda.Width = 300; fila.Cells.Add(celda); totalreportescerrados[diademess] = Convert.ToInt32(celda.Text); fila.HorizontalAlign = HorizontalAlign.Center; fila.VerticalAlign = VerticalAlign.Bottom; pintarfila(); fecha2 = Convert.ToInt32(fecha); diademess = diademess + 1; } } diademess = diademess - 1; } fecha2 = diademess; diademess = 1; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["men"] != null) { int men = Convert.ToInt32(Request.QueryString["men"]); if (men == 1) { Lblreporte.Text = "Reportes Abiertos o en Proceso General"; grvreportes.DataSource = NegIngenieros.listaringenieros(1); grvreportes.Columns[11].HeaderText = "Ing. que atendera"; grvreportes.DataBind(); Lblcontador.Text = "Total de reportes Abiertos:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); this.grvreportes.Columns[8].Visible = false; this.grvreportes.Columns[10].Visible = false; this.grvreportes.Columns[14].Visible = false; } if (men == 2) { Lblreporte.Text = "Reportes Cerrados General"; grvreportes.DataSource = NegTotalreportes.listarreportescerradoss(2); grvreportes.DataBind(); Lblcontador.Text = "Total de reportes cerrados:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); } if (men == 3) { Lblreporte.Text = "Reportes Abiertos o en Proceso Zona Roberto Cortez"; grvreportes.DataSource = NegIngenieros.reportesroberto(1); grvreportes.Columns[11].HeaderText = "Ing. que atendera"; grvreportes.DataBind(); Lblcontador.Text = "Total de reportes Abiertos:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); paginacion = 3; this.grvreportes.Columns[8].Visible = false; this.grvreportes.Columns[10].Visible = false; this.grvreportes.Columns[14].Visible = false; } if (men == 4) { Lblreporte.Text = "Reportes Cerrados Zona Roberto Cortez"; Txcord.Text = "Roberto Cortez"; grvreportes.DataSource = NegTotalreportes.listarreportescerrados(Txcord.Text, 2); grvreportes.DataBind(); Lblcontador.Text = "Total de reportes cerrados:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); } if (men == 5) { Lblreporte.Text = "Reportes Abiertos o en Proceso Zona Hector Ruiz"; grvreportes.DataSource = NegIngenieros.reporteshector(1); grvreportes.Columns[11].HeaderText = "Ing. que atendera"; grvreportes.DataBind(); Lblcontador.Text = "Total de reportes Abiertos:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); paginacion = 5; this.grvreportes.Columns[8].Visible = false; this.grvreportes.Columns[10].Visible = false; this.grvreportes.Columns[14].Visible = false; } if (men == 6) { Lblreporte.Text = "Reportes Cerrados Zona Hector Ruiz"; Txcord.Text = "Hector Ruiz"; grvreportes.DataSource = NegTotalreportes.listarreportescerrados(Txcord.Text, 2); grvreportes.DataBind(); Lblcontador.Text = "Total de reportes cerrados:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); } if (men == 7) { Lblreporte.Text = "Reportes Abiertos o en Proceso Francisco Nonato"; grvreportes.DataSource = NegIngenieros.reportesfrancisco(1); grvreportes.Columns[11].HeaderText = "Ing. que atendera"; grvreportes.DataBind(); Lblcontador.Text = "Total de reportes Abiertos:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); this.grvreportes.Columns[8].Visible = false; this.grvreportes.Columns[10].Visible = false; this.grvreportes.Columns[14].Visible = false; } if (men == 8) { Lblreporte.Text = "Reportes Cerrados Francisco Nonato"; Txcord.Text = "Francisco Nonato"; grvreportes.DataSource = NegTotalreportes.listarreportesporingeniero(Txcord.Text, 2); grvreportes.DataBind(); Lblcontador.Text = "Total de reportes cerrados:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); } if (men == 9) { Lblreporte.Text = "Reportes Abiertos o en Proceso Segismundo Mateos"; grvreportes.DataSource = NegIngenieros.reportessegismundo(1); grvreportes.Columns[11].HeaderText = "Ing. que atendera"; grvreportes.DataBind(); Lblcontador.Text = "Total de reportes Abiertos:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); this.grvreportes.Columns[8].Visible = false; this.grvreportes.Columns[10].Visible = false; this.grvreportes.Columns[14].Visible = false; } if (men == 10) { Lblreporte.Text = "Reportes Cerrados Segismundo Mateos"; Txcord.Text = "Segismundo Mateos"; grvreportes.DataSource = NegTotalreportes.listarreportesporingeniero(Txcord.Text, 2); grvreportes.DataBind(); Lblcontador.Text = "Total de reportes cerrados:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); } if (men == 11) { Lblreporte.Text = "Reportes Abiertos o en Proceso Roberto Cortez"; Txcord.Text = "Roberto Cortez"; grvreportes.DataSource = NegTotalreportes.listarreportesporingenieroabiertos(Txcord.Text, 1); grvreportes.Columns[11].HeaderText = "Ing. que atendera"; grvreportes.DataBind(); Lblcontador.Text = "Total de reportes Abiertos:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); this.grvreportes.Columns[8].Visible = false; this.grvreportes.Columns[10].Visible = false; this.grvreportes.Columns[14].Visible = false; } if (men == 12) { Lblreporte.Text = "Reportes Cerrados Roberto Cortez"; Txcord.Text = "Roberto Cortez"; grvreportes.DataSource = NegTotalreportes.listarreportesporingeniero(Txcord.Text, 2); grvreportes.DataBind(); Lblcontador.Text = "Total de reportes cerrados:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); } if (men == 13) { Lblreporte.Text = "Reportes Abiertos o en Proceso Hector Ruiz"; Txcord.Text = "Hector Ruiz"; grvreportes.DataSource = NegTotalreportes.listarreportesporingenieroabiertos(Txcord.Text, 1); grvreportes.Columns[11].HeaderText = "Ing. que atendera"; grvreportes.DataBind(); Lblcontador.Text = "Total de reportes Abiertos:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); this.grvreportes.Columns[8].Visible = false; this.grvreportes.Columns[10].Visible = false; this.grvreportes.Columns[14].Visible = false; } if (men == 14) { Lblreporte.Text = "Reportes Cerrados Hector Ruiz"; Txcord.Text = "Hector Ruiz"; grvreportes.DataSource = NegTotalreportes.listarreportesporingeniero(Txcord.Text, 2); grvreportes.DataBind(); Lblcontador.Text = "Total de reportes cerrados:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); } if (men == 15) { Lblreporte.Text = "Reportes Abiertos o en Proceso Angel Cordero"; Txcord.Text = "Angel Cordero"; grvreportes.DataSource = NegTotalreportes.listarreportesporingenieroabiertos(Txcord.Text, 1); grvreportes.Columns[11].HeaderText = "Ing. que atendera"; grvreportes.DataBind(); Lblcontador.Text = "Total de reportes Abiertos:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); this.grvreportes.Columns[8].Visible = false; this.grvreportes.Columns[10].Visible = false; this.grvreportes.Columns[14].Visible = false; } if (men == 16) { Lblreporte.Text = "Reportes Cerrados Angel Cordero"; Txcord.Text = "Angel Cordero"; grvreportes.DataSource = NegTotalreportes.listarreportesporingeniero(Txcord.Text, 2); grvreportes.DataBind(); Lblcontador.Text = "Total de reportes cerrados:"; Txtcontador.Visible = true; Txtcontador.Text = this.grvreportes.Rows.Count.ToString(); } } else { } buscaratrasados(); } }
private void inicializarinterfaz1() { string mess = ""; string añño = ""; diademes = 0; diademess = 1; var _FormatoIdioma = new CultureInfo("en-US"); var _oF1 = DateTime.Parse(Txtfecha.Text, _FormatoIdioma); var _oF2 = DateTime.Parse(Txfinal.Text, _FormatoIdioma); List <EntIngenieros> lista = NegTotalreportes.fechainicialgrafica(_oF1, _oF2); if ((lista.Count) == 0) { if (Convert.ToString(diadehoy.Month) == cmbmes.Text & Convert.ToString(diadehoy.Year) == "20" + cmbano.Text) { if (diadehoy.Day == 1 | diadehoy.Day == 2 | diadehoy.Day == 3) { List <Entreportespendientes> list = NegReportesatrasados.checarbandera(diadehoy.Month, diadehoy.Year); if ((list.Count) == 0) { } else { celda = new TableCell(); foreach (Entreportespendientes obj in list) { celda.Text = Convert.ToString(obj.cantidad); } celda.Width = 300; fila.Cells.Add(celda); totalreportes[diademess] = Convert.ToInt32(celda.Text); fila.HorizontalAlign = HorizontalAlign.Center; fila.VerticalAlign = VerticalAlign.Bottom; pintarfila(); diademess = diademess + 1; totalre = 0; } } } else { Lblsindados.Visible = true; Lblsindados.Text = "No se cuenta con registros del mes y año seleccionados"; ii = 8; j = 32; Panel1.Visible = false; ddlChartTypes.Visible = false; Chart1.Visible = false; Lblatrasados.Visible = false; Lblatrasadoss.Visible = false; } } else { List <Entreportespendientes> list = NegReportesatrasados.checarbandera(Convert.ToInt32(cmbmes.Text), Convert.ToInt32(cmbano.Text)); if ((list.Count) == 0) { } else { foreach (Entreportespendientes obj in list) { atrasados = obj.cantidad; } } Lblatrasados.Visible = true; Lblatrasadoss.Text = Convert.ToString(atrasados); Lblatrasadoss.Visible = true; foreach (EntIngenieros obj in lista) { fecha = obj.fechainicio.Day.ToString(); mess = obj.fechainicio.Month.ToString(); añño = obj.fechainicio.Year.ToString(); año = Convert.ToInt32(añño); mes = Convert.ToInt32(mess); if (mes == 1 | mes == 3 | mes == 5 | mes == 7 | mes == 8 | mes == 10 | mes == 12) { rellenardias = 31; for (contador = 0; contador < 32; contador++) { if (diademess == Convert.ToInt32(fecha)) { contador = 32; diademess = Convert.ToInt32(fecha); fecha2 = diademess; } else { celda = new TableCell(); if (diademess == 1) { totalre = totalre + atrasados; celda.Text = Convert.ToString(totalre); } else { celda.Text = Convert.ToString(totalre); } celda.Width = 300; fila.Cells.Add(celda); totalreportes[diademess] = Convert.ToInt32(celda.Text); fila.HorizontalAlign = HorizontalAlign.Center; fila.VerticalAlign = VerticalAlign.Bottom; pintarfila(); diademess = diademess + 1; totalre = 0; } } if (fecha2 == Convert.ToInt32(fecha)) { totalre = totalre + 1; } else { celda = new TableCell(); if (diademess == 1) { totalre = totalre + atrasados; celda.Text = Convert.ToString(totalre); } else { celda.Text = Convert.ToString(totalre); } celda.Width = 300; fila.Cells.Add(celda); totalreportes[diademess] = Convert.ToInt32(celda.Text); fila.HorizontalAlign = HorizontalAlign.Center; fila.VerticalAlign = VerticalAlign.Bottom; pintarfila(); fecha2 = Convert.ToInt32(fecha); totalre = 0; } } else { rellenardias = 30; for (contador = 0; contador < 31; contador++) { if (diademess == Convert.ToInt32(fecha)) { contador = 32; diademess = Convert.ToInt32(fecha); fecha2 = diademess; } else { celda = new TableCell(); if (diademess == 1) { totalre = totalre + atrasados; celda.Text = Convert.ToString(totalre); } else { celda.Text = Convert.ToString(totalre); } celda.Width = 300; fila.Cells.Add(celda); totalreportes[diademess] = Convert.ToInt32(celda.Text); fila.HorizontalAlign = HorizontalAlign.Center; fila.VerticalAlign = VerticalAlign.Bottom; pintarfila(); diademess = diademess + 1; totalre = 0; } } if (fecha2 == Convert.ToInt32(fecha)) { totalre = totalre + 1; } else { celda = new TableCell(); if (diademess == 1) { totalre = totalre + atrasados; celda.Text = Convert.ToString(totalre); } else { celda.Text = Convert.ToString(totalre); } celda.Width = 300; fila.Cells.Add(celda); totalreportes[diademess] = Convert.ToInt32(celda.Text); fila.HorizontalAlign = HorizontalAlign.Center; fila.VerticalAlign = VerticalAlign.Bottom; pintarfila(); fecha2 = Convert.ToInt32(fecha); totalre = 0; celda = new TableCell(); } } } if (diademess == 1) { celda = new TableCell(); totalre = totalre + atrasados; celda.Text = Convert.ToString(totalre); celda.Width = 300; fila.Cells.Add(celda); totalreportes[diademess] = Convert.ToInt32(celda.Text); fila.HorizontalAlign = HorizontalAlign.Center; fila.VerticalAlign = VerticalAlign.Bottom; pintarfila(); } else { celda = new TableCell(); celda.Text = Convert.ToString(totalre); celda.Width = 300; fila.Cells.Add(celda); totalreportes[diademess] = Convert.ToInt32(celda.Text); fila.HorizontalAlign = HorizontalAlign.Center; fila.VerticalAlign = VerticalAlign.Bottom; pintarfila(); } if (diademess == diadehoy.Day) { } else { diademess = diademess + 1; if (diadehoy.Month == Convert.ToInt32(cmbmes.Text)) { if (diadehoy.Year == Convert.ToInt32("20" + cmbano.Text)) { for (contador = 0; contador < 31; contador++) { if (diademess <= diadehoy.Day) { celda = new TableCell(); celda.Text = "0"; celda.Width = 300; fila.Cells.Add(celda); totalreportes[diademess] = Convert.ToInt32(celda.Text); fila.HorizontalAlign = HorizontalAlign.Center; fila.VerticalAlign = VerticalAlign.Bottom; pintarfila(); fecha2 = Convert.ToInt32(fecha); diademess = diademess + 1; } else { diademess = diademess - 1; contador = 32; } } } } else { string prueba1 = "1/" + cmbmes.Text + "/" + cmbano.Text; string prueba2 = DateTime.Now.ToShortDateString(); prueba2 = "1/" + diadehoy.Month + "/" + diadehoy.Year; var _FormatoIdiomas = new CultureInfo("en-US"); var _oF11 = DateTime.Parse(prueba1, _FormatoIdioma); var _oF22 = DateTime.Parse(prueba2, _FormatoIdioma); if (_oF11 < _oF22) { for (contador = diademess; contador <= rellenardias; contador++) { celda = new TableCell(); celda.Text = "0"; celda.Width = 300; fila.Cells.Add(celda); totalreportes[diademess] = Convert.ToInt32(celda.Text); fila.HorizontalAlign = HorizontalAlign.Center; fila.VerticalAlign = VerticalAlign.Bottom; pintarfila(); fecha2 = Convert.ToInt32(fecha); diademess = diademess + 1; } } diademess = diademess - 1; } } fecha2 = diademess; totalre = 0; diademess = 1; } }