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);
 }
 public ActionResult Login()
 {
     var model = new AccountLoginViewModel();
     return AreaView("account/login.cshtml", model);
 }