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" });
        }
    }
Ejemplo 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" });
        }
    }