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")); }
public Login GetUser(string username, string password) { return(loginDAL.GetUser(username, password)); }