private void TraeOtMultiple(string cveEmpl, DateTime fechaBusq, int cveSecc) { ComImpresion.Impresiones OT = new ComImpresion.Impresiones(); DataSet dsProgramas = OT.ObtenerOtMultiplesImprimir(fechaBusq, cveEmpl, cveSecc); try { if (dsProgramas != null) { grdvOts.DataSource = dsProgramas; grdvOts.DataBind(); } else { grdvOts.DataSource = ""; grdvOts.DataBind(); } } catch (Exception ex) { ex.Message.ToString(); } finally { dsProgramas.Dispose(); dsProgramas = null; OT = null; } }
public void BindList(string idFabrica, string idSeccion, DateTime fechaInicial, DateTime fechaFinal, string titulo, string tipoOT, string numOT) { ComImpresion.Impresiones OT = new ComImpresion.Impresiones(); DataSet ds = new DataSet(); DataView dv = new DataView(); long numBase = 0; try { ds = OT.ObtenerAgendasImprimir(fechaInicial, fechaFinal, idSeccion, int.Parse(idFabrica), titulo, 0, tipoOT, Convert.ToInt32(numBase), numOT); dv = ds.Tables[0].DefaultView; dv.Sort = "SECC_DESC"; dv.RowFilter = "OTRA_ORIG = 0 AND (OTRA_REPL IS NULL OR OTRA_REPL = '1')"; dltLunes.DataSource = dv; dltLunes.DataBind(); if (ds.Tables[0].Rows.Count > 0) { this.hdnLunes.Value = ds.Tables[0].Rows.Count.ToString(); numBase += ds.Tables[0].Rows.Count; } else { this.hdnLunes.Value = "0"; } } catch (Exception ex) { this.litMensaje.Text = ex.Message.ToString(); } finally { OT = null; if (ds != null) { ds.Dispose(); } ds = null; } }
public void BindList(string idEmpresa, string idFabrica, string idSeccion, DateTime fechaInicial, string CveOrdenTrabajo, string Titulo, string idRepo, string local) { ComImpresion.Impresiones OT = new ComImpresion.Impresiones(); DataTable dt = new DataTable(); DataView dv = new DataView(); string cuerpoReporte = ""; string fabrAct = ""; string seccAct = ""; try { dt = OT.ConsultaOTBitacoraDiaria(idFabrica, idSeccion, fechaInicial.ToShortDateString(), CveOrdenTrabajo, Titulo, idRepo, local); dv = dt.DefaultView; dv.Sort = "OTRA_LLAV_PR DESC"; cuerpoReporte = "<TABLE id='Table3' cellPadding='3' width='100%' border='0'>"; long cont = 0; if (dt.Rows.Count > 0) { foreach (DataRow r in dt.Rows) { if (cont == 0) { // fabrAct = r["FABR_LLAV_PR"].ToString(); seccAct = r["SECC_LLAV_PR"].ToString(); cuerpoReporte += "<TR><TD colspan='2'> </TD></TR><TR>"; cuerpoReporte += "<td colspan='2'>"; cuerpoReporte += "<table id='Table_01' width='100%' height='21' border='0' cellpadding='0' cellspacing='0'>"; cuerpoReporte += "<tr>"; cuerpoReporte += "<td width='15' height='21'>"; cuerpoReporte += "</td>"; cuerpoReporte += "<td width='100%' class='txtNegIzq' height='21'>"; cuerpoReporte += "<font color='#FFFFFF'>" + r["SECC_DESC"].ToString() + "</font>"; cuerpoReporte += "</td>"; cuerpoReporte += "<td width='19' height='21' class='txtNegIzq'>"; cuerpoReporte += "</td>"; cuerpoReporte += "</tr>"; cuerpoReporte += "</table>"; cuerpoReporte += "</td>"; cuerpoReporte += "</TR>"; } if (seccAct != r["SECC_LLAV_PR"].ToString()) { seccAct = r["SECC_LLAV_PR"].ToString(); cuerpoReporte += "<TR><TD colspan='2'> </TD></TR><TR>"; cuerpoReporte += "<td colspan='2'>"; cuerpoReporte += "<table id='Table_01' width='100%' height='21' border='0' cellpadding='0' cellspacing='0'>"; cuerpoReporte += "<tr>"; cuerpoReporte += "<td width='15' height='21'>"; cuerpoReporte += "</td>"; cuerpoReporte += "<td width='100%' class='txtNegIzq' height='21'>"; cuerpoReporte += "<font color='#FFFFFF'>" + r["SECC_DESC"].ToString() + "</font>"; cuerpoReporte += "</td>"; cuerpoReporte += "<td width='19' height='21' class='txtNegIzq'>"; cuerpoReporte += "</td>"; cuerpoReporte += "</tr>"; cuerpoReporte += "</table>"; cuerpoReporte += "</td>"; cuerpoReporte += "</TR>"; } cuerpoReporte += "<TR><TD> </TD></TR><TR>"; cuerpoReporte += "<TD colspan='2' bgColor='#f3f1f2' style='cursor:hand'"; if (r["AGSE_ORIG"].ToString() == "O") { cuerpoReporte += "onclick=\"abreOT('../OT/CreaOTDatosGen.aspx?numOT=" + r["OTRA_LLAV_PR"].ToString() + "')\">"; } else { cuerpoReporte += "onclick=\"abreOT('../Propuesta/CreaPropuesta.aspx?idProp=" + r["OTRA_LLAV_PR"].ToString() + "')\">"; } cuerpoReporte += "<font color=\"Black\" face=\"Arial\" size=\"3\">"; if (r["AGSE_ORIG"].ToString() == "O") { cuerpoReporte += "<strong><font color=\"RED\">(OT: " + r["OTRA_CVEC"].ToString() + ") </font>"; } else { cuerpoReporte += "<strong><font color=\"RED\">(Prop: " + r["OTRA_LLAV_PR"].ToString() + ") </font>"; } cuerpoReporte += r["OTRA_TITU"].ToString() + " </strong><em>" + r["REPORTEROS"].ToString() + "</em>"; cuerpoReporte += "</font>"; cuerpoReporte += "</TD>"; cuerpoReporte += "</td>"; cuerpoReporte += "</TR>"; cuerpoReporte += "<TR>"; cuerpoReporte += "<TD colspan='2' class='txtNormJust' style='cursor:hand' "; if (r["AGSE_ORIG"].ToString() == "O") { cuerpoReporte += " onclick=\"abreOT('../OT/CreaOTDatosGen.aspx?numOT=" + r["OTRA_LLAV_PR"].ToString() + "')\">"; } else { cuerpoReporte += " onclick=\"abreOT('../Propuesta/CreaPropuesta.aspx?idProp=" + r["OTRA_LLAV_PR"].ToString() + "')\">"; } cuerpoReporte += "<font color=\"Black\" face=\"Arial\" size=\"3\">"; cuerpoReporte += r["OTRA_OBJE"].ToString() + "</font></TD>"; cuerpoReporte += "</TR>"; if (r["AVANCES"].ToString() != "") { cuerpoReporte += "<TR><TD colspan='2' class='txtNegIzq' style='cursor:hand' "; if (r["AGSE_ORIG"].ToString() == "O") { cuerpoReporte += " onclick=\"abreOT('../OT/CreaOTDatosGen.aspx?numOT=" + r["OTRA_LLAV_PR"].ToString() + "')\">"; } else { cuerpoReporte += " onclick=\"abreOT('../Propuesta/CreaPropuesta.aspx?idProp=" + r["OTRA_LLAV_PR"].ToString() + "')\">"; } cuerpoReporte += " <em> AVANCES </em></TD></TR><TR>"; cuerpoReporte += "<TR>"; cuerpoReporte += "<TD colspan='2' class='txtNormJust' style='cursor:hand' "; if (r["AGSE_ORIG"].ToString() == "O") { cuerpoReporte += " onclick=\"abreOT('../OT/CreaOTDatosGen.aspx?numOT=" + r["OTRA_LLAV_PR"].ToString() + "')\">"; } else { cuerpoReporte += " onclick=\"abreOT('../Propuesta/CreaPropuesta.aspx?idProp=" + r["OTRA_LLAV_PR"].ToString() + "')\">"; } cuerpoReporte += "<font size='2'>" + r["AVANCES"].ToString() + "</font></TD>"; cuerpoReporte += "</TR>"; } cont++; } cuerpoReporte += "</TABLE>"; this.litReporte.Text = cuerpoReporte; } else { this.litReporte.Text = ""; this.litMensaje.Text = "No se encontraron resultados."; } } catch (Exception ex) { this.litMensaje.Text = ex.Message.ToString(); } finally { OT = null; if (dt != null) { dt.Dispose(); } dt = null; } }