public void llenaTablaCalidad(Word.Table tabla, EntidadNoConformidad[] conf1) { tabla.Borders.InsideLineStyle = Word.WdLineStyle.wdLineStyleSingle; tabla.Borders.InsideColor = Word.WdColor.wdColorBlack; tabla.Borders.OutsideLineStyle = Word.WdLineStyle.wdLineStyleSingle; tabla.Borders.OutsideColor = Word.WdColor.wdColorBlack; tabla.Rows[1].Range.Shading.BackgroundPatternColor = Word.WdColor.wdColorOrange; tabla.Rows[1].Range.Font.Bold = 1; tabla.Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter; tabla.Range.Cells.VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter; tabla.Cell(1, 1).Range.Text = "Estado"; tabla.Cell(1, 2).Range.Text = "Casos"; tabla.Cell(1, 3).Range.Text = "Cantidad"; tabla.Cell(1, 4).Range.Text = "Porcentaje"; tabla.Cell(2, 1).Range.Text = "Satisfactoria"; tabla.Cell(3, 1).Range.Text = "Fallida"; tabla.Cell(4, 1).Range.Text = "Cancelada"; tabla.Cell(5, 1).Range.Text = "Pendiente"; string[] ncs = new string[4]; ncs[0] = ""; ncs[1] = ""; ncs[2] = ""; ncs[3] = ""; float[] acums = new float[4]; acums[0] = 0; acums[1] = 0; acums[2] = 0; acums[3] = 0; foreach (EntidadNoConformidad nc in conf1) { switch (nc.Estado) { case "Satisfactoria": acums[0]++; ncs[0] += nc.IdCaso + " - Tipo: " + nc.Tipo + "\n"; break; case "Fallida": acums[1]++; ncs[1] += nc.IdCaso + " - Tipo: " + nc.Tipo + "\n"; break; case "Cancelada": acums[2]++; ncs[2] += nc.IdCaso + " - Tipo: " + nc.Tipo + "\n"; break; case "Pendiente": acums[3]++; ncs[3] += nc.IdCaso + " - Tipo: " + nc.Tipo + "\n"; break; } } for (int i = 0; i < 4; i++) { if (acums[i] == 0) { ncs[i] = " "; } ncs[i] = ncs[i].Remove(ncs[i].Length - 1, 1); tabla.Cell(i + 2, 2).Range.Text = ncs[i]; tabla.Cell(i + 2, 3).Range.Text = "" + acums[i]; tabla.Cell(i + 2, 4).Range.Text = (acums[i] / conf1.Length) * 100 + "%"; } }
protected void cambiaProyecto2Box(object sender, EventArgs e) { ViewState["estaGuardado"] = false; int[] idsP = (int[])ViewState["idsproys"]; if (proyecto2.SelectedIndex != 0) { ViewState["idproy2"] = idsP[proyecto2.SelectedIndex]; llenaDisenos2(idsP[proyecto2.SelectedIndex]); if (tipo.Value == "progreso") { ViewState["ejec2"] = new EntidadEjecucion(); ; ViewState["conf2"] = new EntidadNoConformidad[1]; } } else { ViewState["idsejec2"] = null; ViewState["idsdise2"] = null; ViewState["idproy2"] = null; ViewState["iddise2"] = null; ViewState["idejec2"] = null; diseno2.Items.Clear(); ejecucion2.Items.Clear(); ViewState["ejec2"] = null; ViewState["conf2"] = null; } }
public void llenaTablaNoConf(Word.Table tabla, EntidadNoConformidad[] conf1) { tabla.Borders.InsideLineStyle = Word.WdLineStyle.wdLineStyleSingle; tabla.Borders.InsideColor = Word.WdColor.wdColorBlack; tabla.Borders.OutsideLineStyle = Word.WdLineStyle.wdLineStyleSingle; tabla.Borders.OutsideColor = Word.WdColor.wdColorBlack; tabla.Rows[1].Range.Shading.BackgroundPatternColor = Word.WdColor.wdColorOrange; tabla.Rows[1].Range.Font.Bold = 1; tabla.Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter; tabla.Range.Cells.VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter; tabla.Cell(1, 1).Range.Text = "No Conformidad"; tabla.Cell(1, 2).Range.Text = "Casos"; tabla.Cell(1, 3).Range.Text = "Cantidad"; tabla.Cell(1, 4).Range.Text = "Porcentaje"; tabla.Cell(2, 1).Range.Text = "Funcionalidad"; tabla.Cell(3, 1).Range.Text = "Validación"; tabla.Cell(4, 1).Range.Text = "Opciones que no funcionaban"; tabla.Cell(5, 1).Range.Text = "Error de usabilidad"; tabla.Cell(6, 1).Range.Text = "Excepciones"; tabla.Cell(7, 1).Range.Text = "No correspondencia"; tabla.Cell(8, 1).Range.Text = "Ortografía"; string[] ncs = new string[7]; ncs[0] = ""; ncs[1] = ""; ncs[2] = ""; ncs[3] = ""; ncs[4] = ""; ncs[5] = ""; ncs[6] = ""; float[] acums = new float[7]; acums[0] = 0; acums[1] = 0; acums[2] = 0; acums[3] = 0; acums[4] = 0; acums[5] = 0; acums[6] = 0; foreach (EntidadNoConformidad nc in conf1) { switch (nc.Tipo) { case "Funcionalidad": acums[0]++; ncs[0] += nc.IdCaso + " - Estado: " + nc.Estado + "\n"; break; case "Validación": acums[1]++; ncs[1] += nc.IdCaso + " - Estado: " + nc.Estado + "\n"; break; case "Opciones que no funcionaban": acums[2]++; ncs[2] += nc.IdCaso + " - Estado: " + nc.Estado + "\n"; break; case "Error de usabilidad": acums[3]++; ncs[3] += nc.IdCaso + " - Estado: " + nc.Estado + "\n"; break; case "Excepciones": acums[4]++; ncs[4] += nc.IdCaso + " - Estado: " + nc.Estado + "\n"; break; case "No correspondencia": acums[5]++; ncs[5] += nc.IdCaso + " - Estado: " + nc.Estado + "\n"; break; case "Ortografía": acums[6]++; ncs[6] += nc.IdCaso + " - Estado: " + nc.Estado + "\n"; break; } } for (int i = 0; i < acums.Length; i++) { if (acums[i] == 0) { ncs[i] = " "; } ncs[i] = ncs[i].Remove(ncs[i].Length - 1, 1); tabla.Cell(i + 2, 2).Range.Text = ncs[i]; tabla.Cell(i + 2, 3).Range.Text = "" + acums[i]; tabla.Cell(i + 2, 4).Range.Text = (acums[i] / conf1.Length) * 100 + "%"; } }
protected void cambiaEjecucion2Box(object sender, EventArgs e) { ViewState["estaGuardado"] = false; int[] idsE = (int[])ViewState["idsejec2"]; if (ejecucion2.SelectedIndex != 0) { ViewState["idejec2"] = idsE[ejecucion2.SelectedIndex]; ViewState["ejec2"] = controlRepo.consultarEjecucion(idsE[ejecucion2.SelectedIndex]); DataTable dt = controlRepo.consultarNoConformidades(idsE[ejecucion2.SelectedIndex]); EntidadNoConformidad[] listNC = new EntidadNoConformidad[dt.Rows.Count]; int i = 0; foreach (DataRow r in dt.Rows) { EntidadNoConformidad nc = new EntidadNoConformidad((int)r[0], (int)r[1], (int)r[2], (string)r[3], (string)r[4], (string)r[5], (string)r[6], (string)r[7], (byte[])r[8]); listNC[i] = nc; i++; } ViewState["conf2"] = listNC; } else { ViewState["idejec2"] = null; ViewState["ejec2"] = null; ViewState["conf2"] = null; } }
public void llenaTablaEstado(Word.Table tabla, EntidadNoConformidad[] conf1) { tabla.Borders.InsideLineStyle = Word.WdLineStyle.wdLineStyleSingle; tabla.Borders.InsideColor = Word.WdColor.wdColorBlack; tabla.Borders.OutsideLineStyle = Word.WdLineStyle.wdLineStyleSingle; tabla.Borders.OutsideColor = Word.WdColor.wdColorBlack; tabla.Rows[1].Range.Shading.BackgroundPatternColor = Word.WdColor.wdColorOrange; tabla.Rows[1].Range.Font.Bold = 1; tabla.Rows[1].Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter; tabla.Range.Cells.VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter; tabla.Cell(1, 1).Range.Text = "Caso"; tabla.Cell(1, 2).Range.Text = "Tipo"; tabla.Cell(1, 3).Range.Text = "Descripción"; tabla.Cell(1, 4).Range.Text = "Justificación"; tabla.Cell(1, 5).Range.Text = "Estado"; for (int i = 0; i < conf1.Length; i++) { tabla.Cell(2 + (i), 1).Range.Text = conf1[i].IdCaso; tabla.Cell(2 + (i), 2).Range.Text = conf1[i].Tipo; tabla.Cell(2 + (i), 3).Range.Text = conf1[i].Descripcion; tabla.Cell(2 + (i), 4).Range.Text = conf1[i].Justificacion; tabla.Cell(2 + (i), 5).Range.Text = conf1[i].Estado; //tabla.Cell(2 + (i * 2), 1).Range.Text = conf1[i].IdCaso; //tabla.Cell(2 + (i * 2), 2).Range.Text = conf1[i].Tipo; //tabla.Cell(2 + (i * 2), 3).Range.Text = conf1[i].Descripcion; //tabla.Cell(2 + (i * 2), 4).Range.Text = conf1[i].Justificacion; //tabla.Cell(2 + (i * 2), 5).Range.Text = conf1[i].Estado; //tabla.Cell(3 + (i * 2), 1).Range.Text = "Imagen"; tabla.Cell(3 + (i * 2), 1).Range.Shading.BackgroundPatternColor = Word.WdColor.wdColorOrange; //tabla.Cell(3 + (i * 2), 1).Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphRight; //tabla.Cell(3 + (i * 2), 1).Range.Font.Bold = 1; //tabla.Cell(3 + (i * 2), 5).Merge(tabla.Cell(3 + (i * 2), 4)); //tabla.Cell(3 + (i * 2), 4).Merge(tabla.Cell(3 + (i * 2), 3)); //tabla.Cell(3 + (i * 2), 3).Merge(tabla.Cell(3 + (i * 2), 2)); //var img = creaImagen(conf1[i].Imagen); //img.Save(HttpRuntime.AppDomainAppPath + "ReportesTMP\\chtemp.jpg"); //tabla.Cell(3 + (i * 2), 5).Range.InlineShapes.AddPicture(HttpRuntime.AppDomainAppPath + "ReportesTMP\\chtemp.jpg"); //tabla.Cell(3 + (i * 2), 5).Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter; } }