private string obtenerRecursosReconexion(string sAp1, string sAp2, string sNombre) { string sResul = ""; StringBuilder strBuilder = new StringBuilder(); int i = 0; strBuilder.Append("<table id='tblDatos' class='texto' style='width: 396px; BORDER-COLLAPSE: collapse; ' cellSpacing='0' border='0'>"); strBuilder.Append("<colgroup><col style='width:40px;' /><col style='width:340px;padding-left:5px;' /></colgroup>"); try { SqlDataReader dr = Recursos.CargarRecursos(sAp1, sAp2, sNombre, 1, 0); while (dr.Read()) { if (i % 2 == 0) { strBuilder.Append("<tr class=FA "); } else { strBuilder.Append("<tr class=FB "); } strBuilder.Append("id='" + dr["num_empleado"].ToString() + "' codred='" + dr["T001_CODRED"].ToString() + "' onclick=\"ms(this)\" ondblclick=\"aceptarClick(this.rowIndex)\" onmouseover=TTip(event);>"); strBuilder.Append("<td style='text-align:right;padding-right:5px;'>" + dr["num_empleado"].ToString() + "</td><td><nobr style='width:340px;' class='NBR'>" + dr["tecnico"].ToString() + "</nobr></td>"); strBuilder.Append("</tr>"); i++; } dr.Close(); dr.Dispose(); strBuilder.Append("</table>"); sResul = "OK@@" + strBuilder.ToString(); } catch (Exception ex) { sResul = "Error@@" + ex.ToString(); } return(sResul); }
protected string ObtenerRecursos(string strApellido1, string strApellido2, string strNombre, int intColuma, int intOrden) { try { System.Text.StringBuilder sbuilder = new System.Text.StringBuilder(); dr = null; dr = Recursos.CargarRecursos(strApellido1, strApellido2, strNombre, intColuma, intOrden); sbuilder.Append("<table id='tblCatalogo' align='left' style='width:390px'>" + (char)13); int i = 0; while (dr.Read()) { sbuilder.Append("<tr id='" + dr["T001_IDFICEPI"].ToString() + "/" + dr["T001_CODRED"].ToString() + "' "); //if (i % 2 == 0) // sbuilder.Append("class='FA' "); //else // sbuilder.Append("class='FB' "); sbuilder.Append(" onclick=mm(event); "); sbuilder.Append(" ondblclick=this.className='FS';anadirSeleccionados(); "); sbuilder.Append(" style='cursor: pointer;height:16px'><td"); if (i == 0) { sbuilder.Append(" width='100%'"); } sbuilder.Append("> " + dr["TECNICO"].ToString() + "</td></tr>" + (char)13); i++; } dr.Close(); dr.Dispose(); sbuilder.Append("</table>"); return(sbuilder.ToString()); } catch (System.Exception objError) { return("N@@" + Errores.mostrarError("Error al leer catálogo de recursos.", objError)); } }