public static string[] buscarEnActiveDirectory(string SAMaccount)
    {
        StringBuilder sb = new StringBuilder();
        string        correoElectronico = DGActiveDirectory.obtenerCorreoElectronicoDeLaCuenta(SAMaccount);
        string        nombreCuenta      = DGActiveDirectory.obtenerInformacionDeLaCuenta(SAMaccount, DGActiveDirectory.PROPIEDAD.NombreAMostrar);

        try
        {
            if (correoElectronico == string.Empty && nombreCuenta == string.Empty)
            {
                return(new string[] { "0", "Este usuario no tiene correo en Active Directory", "warning" });
            }
            else
            {
                sb.AppendLine("<span><label class='bold'>Nombre:</label><label>" + nombreCuenta + "</label></span>");
                sb.AppendLine("<span><label class='bold'>Cuenta:</label><labe class='lblCuentaMostrado'>" + SAMaccount + "</label></span>");
                sb.AppendLine("<img src='../comun/img/add-icon.png' id='btnAgregarEmbarques' class='botonAgregar' onclick='agregarCorreos();'>");

                return(new string[] { "1", "ok", sb.ToString() });
            }
        }
        catch (Exception ex)
        {
            log.Error("buscarEnActiveDirectory: " + ex.Message);
            return(new string[] { "0", "Error de sistema", "error" });
        }
    }
Esempio n. 2
0
    public static string[] buscarEnActiveDirectory(string SAMaccount)
    {
        StringBuilder sb = new StringBuilder();
        string        correoElectronico = DGActiveDirectory.obtenerCorreoElectronicoDeLaCuenta(SAMaccount);
        string        nombreCuenta      = DGActiveDirectory.obtenerInformacionDeLaCuenta(SAMaccount, DGActiveDirectory.PROPIEDAD.NombreAMostrar);

        try
        {
            if (correoElectronico == string.Empty && nombreCuenta == string.Empty)
            {
                return(new string[] { "0", "Este usuario no tiene correo en Active Directory", "warning" });
            }
            else
            {
                sb.AppendLine("<span><label for=\"lblNombre\" class=\"lblNombre\">Nombre:</label><label class=\"lblNombreMostrado\">" + nombreCuenta + "</label></span>");
                sb.AppendLine("<span><label for=\"lblCorreo\" class=\"lblCorreo\">Cuenta:</label><label class=\"lblCorreoMostrado\">" + SAMaccount + "</label></span>");
                sb.AppendLine("<img src=\"../comun/img/add-icon.png\" id=\"btnAgregarMonitoreo\" class=\"botonAgregar\" onclick=\"agregarCorreos()\">");

                return(new string[] { "1", "ok", sb.ToString() });
            }
        }
        catch (Exception)
        {
            return(new string[] { "0", "Error de sistema", "error" });
        }
    }
    public static string[] agregarCorreos(string SAMaccount)
    {
        StringBuilder sb = new StringBuilder();
        string        correoElectronico = DGActiveDirectory.obtenerCorreoElectronicoDeLaCuenta(SAMaccount);

        try
        {
            if (SAMaccount == string.Empty)
            {
                return(new string[] { "0", "Ingrese un correo porfavor", "warning" });
            }
            else
            {
                //se procede a verificar la existencia del correo electronico
            }

            if (correoElectronico == string.Empty)
            {
                return(new string[] { "0", "No se pudo procesar la cuenta", "warning" });
            }
            else
            {
                sb.AppendLine("<tr class='Nuevo' miAtributo='LosTRsNuevos'>");
                sb.AppendLine("<td class='invisible' idCaptura='" + idCapturaDefault + "'>" + idCapturaDefault + "</td>");
                sb.AppendLine("<td class='invisible' otherClass='SAMaccount'>" + SAMaccount + "</td>");
                sb.AppendLine("<td class='Correo' otherClass='Correo'>" + correoElectronico + "</td>");
                sb.AppendLine("<td><img src='../comun/img/remove-icon.png' class='btnEliminar' id='" + correoElectronico + "' onclick='EliminarCorreo(this);' /></td>");
                sb.AppendLine("</tr>");

                return(new string[] { "1", "ok", sb.ToString() });
            }
        }
        catch (Exception ex)
        {
            log.Error("agregarCorreos: " + ex.Message);
            return(new string[] { "0", "Error de sistema", "error" });
        }
    }
Esempio n. 4
0
    public static string[] agregarCorreos(string SAMaccount)
    {
        StringBuilder sb = new StringBuilder();
        string        correoElectronico = DGActiveDirectory.obtenerCorreoElectronicoDeLaCuenta(SAMaccount);

        try
        {
            if (SAMaccount == string.Empty)
            {
                return(new string[] { "0", "Ingrese un correo porfavor", "warning" });
            }
            else
            {
                //se procede a verificar la existencia del correo electronico
            }

            if (correoElectronico == string.Empty)
            {
                return(new string[] { "0", "No se pudo procesar la cuenta", "warning" });
            }
            else
            {
                sb.AppendLine("<tr class=\"Nuevo\" miAtributo=\"LosTRsNuevos\">");
                sb.AppendLine("<td class=\"invisible\" idCaptura=\"" + idCapturaDefault + "\">" + idCapturaDefault + "</td>");
                sb.AppendLine("<td class=\"invisible\" otherClass=\"SAMaccount\">" + SAMaccount + "</td>");
                sb.AppendLine("<td class=\"Correo\" otherClass=\"Correo\">" + correoElectronico + "</td>");
                sb.AppendLine("<td><img src=\"../comun/img/remove-icon.png\" class=\"btnEliminar\" id=\"" + correoElectronico + "\" onclick=\"EliminarCorreo($(this),$(this).attr('id'));\" /></td>");
                sb.AppendLine("</tr>");

                return(new string[] { "1", "ok", sb.ToString() });
            }
        }
        catch (Exception)
        {
            return(new string[] { "0", "Error de sistema", "error" });
        }
    }