Esempio n. 1
0
        public ActionResult Login(string email, string password)
        {
            bool             emailAndPasswordAreEmpty = string.IsNullOrWhiteSpace(email) && string.IsNullOrWhiteSpace(password);
            UserContextModel userContextModel         = UsersRepository.ValidatePasswordIsCorrect(email, password);

            if (userContextModel == null)
            {
                ViewBag.ErrorMessages = UsersRepository.ErrorList;
                return(View("Index"));
            }
            else
            {
                UserContextHelper.SetUserSession(userContextModel);
                return(RedirectToAction("Index", "SportEvent"));
            }
        }
Esempio n. 2
0
 public ActionResult Logout()
 {
     UserContextHelper.SetUserSession(null);
     return(RedirectToAction("Index"));
 }