Exemple #1
0
        public static bool Existe(LoginCliente login)
        {
            DBContext db  = new DBContext();
            bool      ret = false;

            try
            {
                ret = db.LoginClientes.Where(x => x.Usuario == login.Usuario).Any();
            }
            catch (EntityException e)
            {
                return(ret);
            }
            return(ret);
        }
Exemple #2
0
        public static LoginCliente ValidarUsuario(string login, string senha)
        {
            DBContext    db  = new DBContext();
            LoginCliente ret = null;

            senha = CriptoHelper.HashMD5(senha);
            try
            {
                ret = db.LoginClientes.Where(x => x.Usuario == login && x.Senha == senha).SingleOrDefault();
            }catch (EntityException e)
            {
                return(new LoginCliente());
            }
            return(ret);
        }