Exemplo n.º 1
0
    private void cargarNodos()
    {
        try
        {
            StringBuilder sb       = new StringBuilder();
            SqlDataReader dr       = NODO.CatalogoConEstructura();
            string        sTootTip = "";

            sb.Append("<table id='tblNodos' style='width: 500px;'>");
            sb.Append("<colgroup><col style='width:70px;' /><col style='width:410px;' /><col style='width:20px;' /></colgroup>");
            sb.Append("<tbody>");
            while (dr.Read())
            {
                sTootTip = "";
                if (Utilidades.EstructuraActiva("SN4"))
                {
                    sTootTip += "<label style='width:60px'>" + Estructura.getDefCorta(Estructura.sTipoElem.SUPERNODO4) + ":</label> " + dr["DES_SN4"].ToString() + "<br>";
                }
                if (Utilidades.EstructuraActiva("SN3"))
                {
                    sTootTip += "<label style='width:60px'>" + Estructura.getDefCorta(Estructura.sTipoElem.SUPERNODO3) + ":</label> " + dr["DES_SN3"].ToString() + "<br>";
                }
                if (Utilidades.EstructuraActiva("SN2"))
                {
                    sTootTip += "<label style='width:60px'>" + Estructura.getDefCorta(Estructura.sTipoElem.SUPERNODO2) + ":</label> " + dr["DES_SN2"].ToString() + "<br>";
                }
                if (Utilidades.EstructuraActiva("SN1"))
                {
                    sTootTip += "<label style='width:60px'>" + Estructura.getDefCorta(Estructura.sTipoElem.SUPERNODO1) + ":</label> " + dr["DES_SN1"].ToString();
                }

                sb.Append("<tr id='" + dr["NODO"].ToString() + "' ");
                sb.Append("style='height:20px;noWrap:true;' title=\"cssbody=[dvbdy] cssheader=[dvhdr] header=[<img src='../../../images/info.gif' style='vertical-align:middle'>  Estructura] body=[" + sTootTip + "] hideselects=[off]\">");
                sb.Append("<td style='text-align:right; padding-right:3px;'>" + dr["NODO"].ToString() + "</td>");
                sb.Append("<td style='padding-left:5px;'>" + dr["denominacion"].ToString() + "</td>");
                sb.Append("<td><input type='checkbox' class='check' style='cursor:pointer' onclick='setNodosCount();borrarCatalogo();'></td>");
                sb.Append("</tr>");
            }
            dr.Close();
            dr.Dispose();
            sb.Append("</tbody>");
            sb.Append("</table>");

            strTablaHTML = sb.ToString();
        }
        catch (Exception ex)
        {
            Master.sErrores += Errores.mostrarError("Error al cargar los nodos", ex);
        }
    }
 private void cargarNodos(string sModulo, bool bSoloActivos)
 {
     try
     {
         //Cargar el combo de nodos accesibles t303_estado
         lblNodo.InnerText = Estructura.getDefCorta(Estructura.sTipoElem.NODO);
         ListItem      oLI = null;
         SqlDataReader dr  = NODO.CatalogoConEstructura();
         while (dr.Read())
         {
             oLI = new ListItem(dr["denominacion"].ToString(), dr["nodo"].ToString());
             cboCR.Items.Add(oLI);
         }
         dr.Close();
         dr.Dispose();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }