public ActionResult Login(LoginViewModel model) { mobilborEntities db = new mobilborEntities(); CheckLogin_Result result = db.CheckLogin(model.Email, model.Password).FirstOrDefault(); if (result != null) { if (result.Type == 2) { ViewBag.Error = "Ваш профиль блокирован"; return(RedirectToAction("login", "account")); } Session["Active"] = "1"; Session["User"] = result.ID; Session["us"] = result.ID; Session["Type"] = result.Type; if (Session["User"].ToString() == "1") { return(RedirectToAction("Index", "Cabinet")); } else { return(RedirectToAction("PersonalCabinet", "Home")); } } else { return(RedirectToAction("Login", "Account")); } }
//[ValidateAntiForgeryToken] public ActionResult LoginRu(LoginViewModel model) { mobilborEntities db = new mobilborEntities(); CheckLogin_Result result = db.CheckLogin(model.Email, model.Password).FirstOrDefault(); if (result != null) { Session["Active"] = "1"; Session["User"] = result.ID; if (Session["User"].ToString() == "1") { return(RedirectToAction("Index", "Cabinet")); } else { return(RedirectToAction("Index", "Home")); } } else { return(RedirectToAction("Login", "Account")); } }