Esempio n. 1
0
        public ActionResult DoLogin(User user)
        {
            var isValidUser = _loginDal.ValidateLogin(user.Username, user.Password);

            if (isValidUser)
            {
                var currentUser = _loginDal.GetUser(user.Username);
                Session[CurrentUserKey] = currentUser;
                return(RedirectToAction("UserInfo"));
            }

            TempData[ErrorMessageKey] = "Invalid login credentials.";
            return(RedirectToAction("Login"));
        }
Esempio n. 2
0
 public Login GetUser(string username, string password)
 {
     return(loginDAL.GetUser(username, password));
 }