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