コード例 #1
0
        private bool SetLogin()
        {
            AuthUser au = new AuthUser(db);

            ViewBag.User = au.Authorise();
            return(ViewBag.User != null);
        }
コード例 #2
0
        public ActionResult Login(UserViewModels.Login model)
        {
            AuthUser aa = new AuthUser(db);

            bool success = aa.Login(model.EmailAddress, model.Password);

            if (success)
            {
                return(RedirectToAction("Details", aa.Authorise()));
            }
            else
            {
                ModelState.AddModelError("EmailAddress", "That email and password combination was not recognised");
                return(View());
            }
        }