Ejemplo n.º 1
0
 public ActionResult Login(LoginUser user)
 {
     if (ModelState.IsValid)
     {
         if (user.IsValid(user.UserName, user.Password))
         {
             var bID = user.getBusinessId(user.UserName);
             System.Web.HttpContext.Current.Session["id"] = bID;
             FormsAuthentication.SetAuthCookie(user.UserName, user.RememberMe);
             return RedirectToAction("Dashboard_v1", "Dashboard");
         }
         else
         {
             ModelState.AddModelError("", "Login data is incorrect!");
         }
     }
     return View(user);
 }