Ejemplo n.º 1
0
 public ActionResult Login(AccountLoginViewModel model)
 {
     if (!ModelState.IsValid)
     {
         return View(model);
     }
     var service = Ioc.GetService<Services.IUserService>();
     if (service.CanLogin(model.Username, model.Password))
     {
         Response.SetAuthCookie(model.Username, model.RememberMe);
         GetSession().Login(model.Username);
         return Redirect("/");
     }
     model.Error = "invalid username/password.";
     return AreaView("account/login.cshtml", model);
 }
Ejemplo n.º 2
0
 public ActionResult Login()
 {
     var model = new AccountLoginViewModel();
     return AreaView("account/login.cshtml", model);
 }