public void GetAllTest()
        {
            PrepararTabla();

            //Arrange
            //_UsuarioAdapter = new UsuarioAdapter();
            List <Usuario> usuarios      = new List <Usuario>();
            int            cantRegistros = 2;

            //Act
            usuarios = _UsuarioAdapter.GetAll();

            //Assert
            Assert.AreEqual(usuarios.Count, cantRegistros);
        }
Ejemplo n.º 2
0
        public Usuario LogIn(string user, string pass)
        {
            try
            {
                List <Usuario> listaUsuarios = new List <Usuario>();
                listaUsuarios = usuarioData.GetAll();
                foreach (Usuario u in listaUsuarios)
                {
                    if (u.Clave == pass && u.NombreUsuario == user)
                    {
                        if (u.Habilitado)
                        {
                            u.Permisos = this.pa.GetPorIdUsuario(u.Id);
                            return(u);
                        }
                    }
                }

                return(null);
            }
            catch (NotFoundException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new CustomException(ex);
            }
        }
Ejemplo n.º 3
0
 public List <Usuario> getAll()
 {
     try {
         return(usuarioData.GetAll());
     }
     catch (Exception exc) {
         throw;
     }
 }
Ejemplo n.º 4
0
 public List <Usuario> GetAll()
 {
     try
     {
         return(UsuarioData.GetAll());
     }
     catch (Exception ExcepcionManejada)
     {
         throw ExcepcionManejada;
     }
 }
Ejemplo n.º 5
0
 public List <Usuario> GetAll()
 {
     try
     {
         return(usuarioData.GetAll());
     }
     catch (Exception Ex)
     {
         throw Ex;
     }
 }
Ejemplo n.º 6
0
 public List <Usuario> GetAll(int tipo = 2)
 {
     try
     {
         return(UsuarioData.GetAll(tipo));
     }
     catch (Exception Ex)
     {
         Exception ExcepcionManejada =
             new Exception("Error al recuperar lista de usuarios", Ex);
         throw ExcepcionManejada;
     }
 }
Ejemplo n.º 7
0
 public List <Usuario> GetAll()
 {
     try
     {
         List <Usuario> Usuarios = UsuarioData.GetAll();
         return(Usuarios);
     }
     catch (Exception Ex)
     {
         Exception ExcepcionManejada =
             new Exception("Error al recuperar lista de usuarios", Ex);
         throw ExcepcionManejada;
     }
 }
Ejemplo n.º 8
0
        public void GetAllTest()
        {
            PrepararTabla();

            //Arrange
            _UsuarioAdapter = new UsuarioAdapter();
            List <Usuario> usuarios  = new List <Usuario>();
            int            respuesta = 2;

            //Act
            usuarios = _UsuarioAdapter.GetAll();

            //Assert
            Assert.AreEqual(usuarios.Count, respuesta);
        }
Ejemplo n.º 9
0
 public List <Usuario> GetAll()
 {
     return(UsuarioData.GetAll());
 }
Ejemplo n.º 10
0
 public List <Entities.Usuario> GetAll()
 {
     return(_UsuarioData.GetAll());
 }
Ejemplo n.º 11
0
        public List <Usuario> GetAll()
        {
            UsuarioAdapter usuario = new UsuarioAdapter();

            return(usuario.GetAll());
        }