コード例 #1
0
        public ActionResult Login(string email, string password)
        {
            var  mgr = new UserAuthRepository();
            User u   = mgr.GetUser(email, password);

            if (u == null)
            {
                return(View(true));
            }
            else
            {
                mgr.AddAction(u.Id, "Log In", DateTime.Now);
                FormsAuthentication.SetAuthCookie(u.Id.ToString(), true);
                return(RedirectToAction("index", "portal"));
            }
        }