Beispiel #1
0
 public string nivelUsuario(string rut)
 {
     try
     {
         Datos.UsuarioDB   uDB = new Datos.UsuarioDB();
         Entidades.Usuario u   = new Entidades.Usuario();
         u = uDB.obtenerDatos(rut);
         if (u != null)
         {
             if (u.nivelId == 8001)
             {
                 return("Administrador");
             }
             else if (u.nivelId == 8000)
             {
                 return("Administrativo");
             }
         }
         return("");
     }
     catch (Exception)
     {
         return("");
     }
 }
Beispiel #2
0
 public bool validarUsuario(string rut, string pass)
 {
     try
     {
         Datos.UsuarioDB uDB = new Datos.UsuarioDB();
         if (uDB.validarUsuario(rut, pass) == true)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }
Beispiel #3
0
 public bool modificarusuario(Entidades.Usuario usuario)
 {
     try
     {
         Datos.UsuarioDB udb = new Datos.UsuarioDB();
         if (usuario != null)
         {
             udb.modificarUsuario(usuario);
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }
Beispiel #4
0
 public Entidades.Usuario cargarUsuario(string rut)
 {
     try
     {
         Datos.UsuarioDB   uDB = new Datos.UsuarioDB();
         Entidades.Usuario u   = new Entidades.Usuario();
         u = uDB.obtenerDatos(rut);
         if (u != null)
         {
             return(u);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
Beispiel #5
0
 public string nombreCompleto(string rut)
 {
     try
     {
         Datos.UsuarioDB   uDB = new Datos.UsuarioDB();
         Entidades.Usuario u   = new Entidades.Usuario();
         u = uDB.obtenerDatos(rut);
         if (u != null)
         {
             string nombre = u.nombres + " " + u.apellidoPaterno + " " + u.apellidoMaterno;
             return(nombre);
         }
         else
         {
             return("Problemas al cargar nombre");
         }
     }
     catch (Exception)
     {
         return("Error al cargar, Solicite ayuda");
     }
 }