1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
| public Presentation Slide(DocumentoOriginal)
{
try
{
Presentation DocumentoPublicacion = new Presentation();
Presentation DocumentoProcesado = new Presentation();
var TipoDocumentoId = DocumentoOriginal.TipoDocumentoId;
var ByteDocumentoOriginal = DocumentoOriginal.Archivo;
MemoryStream StreamDocumentoOriginal = new MemoryStream(ByteDocumentoOriginal);
DocumentoProcesado = new Presentation(StreamDocumentoOriginal);
var respTipoDocumento = PublicacionRepositorio.ObtenerTipoDocumento(TipoDocumentoId).Data;
var respVistaFirma = PublicacionRepositorio.VistFirma(TipoDocumentoId).Data;
ISlide sld = DocumentoProcesado.Slides[0];
int Celda = (int)respV[respV.Count -1].Celda;
double[] dblC = new double[Celda];
int aux =0;
int Mayor=0;
int RowsMayor = 0;
int Rows = 0;
for(int i=0; i<respV.Count; i++)
{
Mayor = respV[i].Contenido.Split(',').Length;
if(Mayor > aux)
{
aux = Mayor;
}
}
double[] dblR = new double[aux+1];
for (int i = 0; i < Celda; i++ )
{
switch (Celda)
{
case 1:
dblC[i] = 300;
break;
case 2:
dblC[i] = 300;
break;
case 3:
dblC[i] = 200;
break;
case 4:
dblC[i] =150;
break;
}
}
for(int j=0; j< aux + 1; j++)
{
dblR[j] = 70;
}
ITable tbl = sld.Shapes.AddTable(100, 82, dblC, dblR);
var LstRevisores = ListaFirmas.Where(x => x.TipoAprovadorId == Int32.Parse(Utilerias.Utilerias.LeerVariableXML("TipoAprobador_Revisor"))).OrderBy(x => x.Orden);
var LstAutorizadores = ListaFirmas.Where(x => x.TipoAprovadorId == Int32.Parse(Utilerias.Utilerias.LeerVariableXML("TipoAprobador_Autorizador"))).OrderBy(x => x.Orden);
var LstValidadores = ListaFirmas.Where(x => x.TipoAprovadorId == Int32.Parse(Utilerias.Utilerias.LeerVariableXML("TipoAprobador_Validador"))).OrderBy(x => x.Orden);
int fila = 0;
foreach (var item in Lista1.ToList())
{
var T;
var P;
var N;
var U;
int auxRows = 0;
for (var fe = 0; fe < respV.Count; fe++)
{<
var Content = resp[fe].Contenido.Split(',');
int columna = 0;
fila = aux;
tbl[columna + (int)respV[fe].Celda - 1,fila].TextFrame.Text = respV[fe].Contenido;
RowsMayor = respV[fe].Contenido.Split(',').Length;
if (RowsMayor > auxRows)
{
auxRows = RowsMayor;
}
int cont = 0;
for (var fc = 0; fc < Content.Length; fc++)
{
cont++;
//fila++;
columna = (int)respV[fe].Celda - 1;
switch (Content[fc])
{
case "N":
tbl[columna, fila].TextFrame.Text = N;
break;
case "P":
tbl[columna, fila].TextFrame.Text = P;
break;
case "F":
break;
case "T":
tbl[columna, fila].TextFrame.Text = T;
break;
}
}//for fc
}//for fe
Rows = auxRows;
}//foreach
}//if Firmavalidadores true
foreach (var item in Lista2.ToList())
{
var T;
var P;
var N;
var U;
for (int i = 0; i < respV.Count; i++)
{
Mayor = respV[i].Contenido.Split(',').Length;
if (Mayor > Rows)
{
Rows = Mayor;
}
}
//dblR = new double[Rows];
for (int j = 0; j < Rows; j++)
{
dblR[j] = 70;
}
dblR = new double[Rows +1];
int auxRows = 0;
for (var fe = 0; fe < respV.Count; fe++)
{
var Content = resp[fe].Contenido.Split(',');
int columna = 0;
fila = aux;
tbl[columna + (int)respV[fe].Celda - 1,fila].TextFrame.Text = respV[fe].Contenido;
RowsMayor = respV[fe].Contenido.Split(',').Length;
if (RowsMayor > auxRows)
{
auxRows = RowsMayor;
}
int cont = 0;
for (var fc = 0; fc < Content.Length; fc++)
{
cont++;
//fila++;
columna = (int)respV[fe].Celda - 1;
switch (Content[fc])
{
case "N":
tbl[columna, fila].TextFrame.Text = N;
break;
case "P":
tbl[columna, fila].TextFrame.Text = P;
break;
case "F":
break;
case "T":
tbl[columna, fila].TextFrame.Text = T;
break;
}
}//for fc
}//for fe
Rows = auxRows;
}//foreach
}//if tipoordenamiento false
}//if FormaFirma
}//if respVistaFirma
}//if ListaFirmas
}//if requierefirma
DocumentoPublicacion = DocumentoProcesado;
StreamDocumentoOriginal.Close();
return DocumentoPublicacion;
}
catch (Exception ex)
{
Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
throw ex;
}
} |
Partager