private string Grabar(string sDatosAlertas)
    {
        try
        {
            PSNALERTAS.EstablecerAlertaDetalleProyecto(sDatosAlertas);

            return("OK@#@");
        }
        catch (Exception ex)
        {
            return("Error@#@" + Errores.mostrarError("Error al establecer las alertas a nivel de proyecto.", ex));
        }
    }
Exemplo n.º 2
0
    private string setTrasladarAlertas(byte nOpcion, byte nNivel, int nCodigo)
    {
        try
        {
            PSNALERTAS.TrasladarAlertaEstructura(nOpcion, nNivel, nCodigo);

            return("OK@#@");
        }
        catch (Exception ex)
        {
            return("Error@#@" + Errores.mostrarError("Error al trasladar las alertas.", ex));
        }
    }
Exemplo n.º 3
0
    private string setAlerta(int nNivel, int nCodigo, byte nAlerta, bool bHabilitada)
    {
        try
        {
            PSNALERTAS.EstablecerAlertaEstructura(nNivel, nCodigo, nAlerta, bHabilitada);

            return("OK@#@");
        }
        catch (Exception ex)
        {
            return("Error@#@" + Errores.mostrarError("Error al habilitar/deshabilitar la alerta.", ex));
        }
    }
 private string ObtenerAlertasGestion(
     string sIdProyectosubnodo,
     string sEstadoProy,
     string sIdNodo,
     string sIdCliente,
     string sIdInterlocutor,
     string sHabilitada,
     string sAsunto,
     string sGestor,
     string sStandby,
     string sSeguimiento,
     string sIdResponsable,
     string sGrupo
     )
 {
     try
     {
         byte?idGrupo = null;
         if (sGrupo != "")
         {
             idGrupo = (byte?)byte.Parse(sGrupo);
         }
         return("OK@#@" + PSNALERTAS.ObtenerAlertasMiGestion(
                    (sIdProyectosubnodo == "0")? null: (int?)int.Parse(sIdProyectosubnodo),
                    (sEstadoProy == "") ? null : sEstadoProy,
                    (sIdNodo == "0")? null: (int?)int.Parse(sIdNodo),
                    (sIdCliente == "0") ? null : (int?)int.Parse(sIdCliente),
                    (sIdInterlocutor == "0") ? null : (int?)int.Parse(sIdInterlocutor),
                    (sHabilitada == "") ? null : (bool?)((sHabilitada == "1")?true:false),
                    (sAsunto == "-1" || sAsunto == "") ? null : (byte?)byte.Parse(sAsunto),
                    (sGestor == "-1")? null: (int?)int.Parse(sGestor),
                    (sStandby == "1")? true:false,
                    (sSeguimiento == "1")? true:false,
                    (sIdResponsable == "0") ? null : (int?)int.Parse(sIdResponsable),
                    idGrupo
                    ));
     }
     catch (Exception ex)
     {
         return("Error@#@" + Errores.mostrarError("Error al obtener los diálogos bajo mi gestión.", ex));
     }
 }
    public void ObtenerAlertas()
    {
        StringBuilder sb = new StringBuilder();

        #region Cabecera tabla HTML
        sb.Append(@"<table id='tblOtrasAlertas' style='width:500px;' border='1'>
            <colgroup>
                <col style='width: 215px;' />
                <col style='width: 25px;' />
                <col style='width: 100px;' />
                <col style='width: 120px;' />
                <col style='width: 40px;' />
            </colgroup>");
        #endregion

        DataSet ds = PSNALERTAS.ObtenerCatalogoByDialogo(int.Parse(hdnIdDialogo.Value), int.Parse(Session["UsuarioActual"].ToString()));
        int     i  = 0;
        foreach (DataRow oFila in ds.Tables[0].Rows)
        {
            if (i == 0)
            {
                txtAsunto.Text         = oFila["t820_denominacion"].ToString();
                chkHabilitada.Checked  = (bool)oFila["t830_habilitada"];
                txtIniStby.Text        = (oFila["t830_inistandby"] != DBNull.Value) ? Fechas.AnnomesAFechaDescLarga((int)oFila["t830_inistandby"]) : "";
                txtFinStby.Text        = (oFila["t830_finstandby"] != DBNull.Value) ? Fechas.AnnomesAFechaDescLarga((int)oFila["t830_finstandby"]) : "";
                hdnGrupoOC.Value       = oFila["grupoOC"].ToString();
                this.hdnTipoOCFA.Value = oFila["t820_tipo"].ToString();

                ObtenerMotivos(this.hdnTipoOCFA.Value);

                this.hdnMotivoOCFA.Value = oFila["t840_idmotivo"].ToString();
                if (this.hdnMotivoOCFA.Value == "" && (hdnGrupoOC.Value == "1"))
                {
                    //Si el dialogo es de OC o FA y no tiene asignado motivo busco si existe un dialogo anterior cerrado del que heredar el motivo por defecto
                    this.hdnMotivoOCFA.Value = PSNALERTAS.MotivoCierreDefecto(null, int.Parse(oFila["t305_idproyectosubnodo"].ToString()), int.Parse(oFila["t820_idalerta"].ToString()));
                }
                cboMotivo.SelectedValue = this.hdnMotivoOCFA.Value;

                if ((bool)oFila["t830_habilitada"])
                {
                    txtIniStby.Style.Add("cursor", "pointer");
                    txtIniStby.Attributes.Add("onclick", "getPeriodo(this.parentNode.parentNode)");
                    txtFinStby.Style.Add("cursor", "pointer");
                    txtFinStby.Attributes.Add("onclick", "getPeriodo(this.parentNode.parentNode)");
                }
                chkSeguimiento.Checked = (oFila["t830_txtseguimiento"].ToString() != "") ? true : false;
                imgSegAlertaActual.Style.Add("visibility", (oFila["t830_txtseguimiento"].ToString() != "") ? "visible" : "hidden");

                trAlertaActual.Attributes.Add("idPSN", oFila["t305_idproyectosubnodo"].ToString());
                trAlertaActual.Attributes.Add("idAlerta", oFila["t820_idalerta"].ToString());
                trAlertaActual.Attributes.Add("inistandby", oFila["t830_inistandby"].ToString());
                trAlertaActual.Attributes.Add("finstandby", oFila["t830_finstandby"].ToString());
                trAlertaActual.Attributes.Add("seg", Utilidades.escape(oFila["t830_txtseguimiento"].ToString()));

                sTooltipInfoProy  = "<label style=width:80px;>Proyecto:</label>" + ((int)ds.Tables[1].Rows[0]["t301_idproyecto"]).ToString("#,###") + " - " + ds.Tables[1].Rows[0]["t301_denominacion"].ToString();
                sTooltipInfoProy += "<br><label style=width:80px;>Responsable:</label>" + ds.Tables[1].Rows[0]["Responsable"].ToString();
                sTooltipInfoProy += "<br><label style=width:80px;>" + Estructura.getDefCorta(Estructura.sTipoElem.NODO) + ":</label>" + ds.Tables[1].Rows[0]["t303_denominacion"].ToString();
                sTooltipInfoProy += "<br><label style=width:80px;>Cliente:</label>" + ds.Tables[1].Rows[0]["t302_denominacion"].ToString();

                sTooltipInfoProy = Utilidades.escape(sTooltipInfoProy);
            }
            else
            {
                sb.Append("<tr bd='' idPSN='" + oFila["t305_idproyectosubnodo"].ToString() + "' ");
                sb.Append("idAlerta='" + oFila["t820_idalerta"].ToString() + "' ");
                sb.Append("a=" + (((bool)oFila["t830_habilitada"]) ? "1" : "0") + " ");
                sb.Append("inistandby='" + oFila["t830_inistandby"].ToString() + "' ");
                sb.Append("finstandby='" + oFila["t830_finstandby"].ToString() + "' ");
                sb.Append("seg=\"" + Utilidades.escape(oFila["t830_txtseguimiento"].ToString()) + "\">");

                sb.Append("<td style='text-align:left;'><nobr class='NBR W200' onmouseover='TTip(event)'>" + oFila["t820_denominacion"].ToString() + "</nobr></td>");
                sb.Append("<td><input type='checkbox' class='check' " + (((bool)oFila["t830_habilitada"]) ? "checked" : "") + " onclick='setHabilitada(this);' style='cursor:pointer;' /></td>");
                //if ((bool)oFila["t830_habilitada"])
                //{
                //    sb.Append("<td style='cursor:pointer;' onclick='getPeriodo(this.parentNode)'>" + ((oFila["t830_inistandby"] != DBNull.Value) ? Fechas.AnnomesAFechaDescLarga((int)oFila["t830_inistandby"]) : "") + "</td>");
                //    sb.Append("<td style='cursor:pointer;' onclick='getPeriodo(this.parentNode)'>" + ((oFila["t830_finstandby"] != DBNull.Value) ? Fechas.AnnomesAFechaDescLarga((int)oFila["t830_finstandby"]) : "") + "</td>");
                //}
                //else
                //{
                sb.Append("<td style='text-align:left;'></td>");
                sb.Append("<td style='text-align:left;'></td>");
                //}
                sb.Append("<td>");
                sb.Append("<input type='checkbox' class='check' " + ((oFila["t830_txtseguimiento"].ToString() != "") ? "checked" : "") + " onclick='setSeguimiento()' style='cursor:pointer;' />");
                sb.Append("<img src='../../../../images/imgSeguimiento.png' onclick='ModificarSeguimiento(this)' style='cursor:pointer;vertical-align:middle; margin-left:2px; border: 0px;visibility:" + ((oFila["t830_txtseguimiento"].ToString() != "") ? "visible" : "hidden") + "; width:16px; height:16px;' />");
                sb.Append("</td>");

                sb.Append("</tr>");
            }
            i++;
        }
        ds.Dispose();

        sb.Append("</table>");
        strTablaHTMLAlertas = sb.ToString();
    }