public ActionResult LogIn(UserLoginView ULV, string returnUrl) { if (ModelState.IsValid) { UserRepository UM = new UserRepository(); var CurrUSer = UM.AuthenticateUser(ULV.Email, ULV.Password); if ((bool)CurrUSer.IsLoginSuccess) { FormsAuthentication.SetAuthCookie(ULV.Email, false); var role = CurrUSer.Role; return RedirectToAction("DashBoard", role); } else if (!(bool)CurrUSer.IsLoginSuccess) { ModelState.AddModelError("", "The user login or password provided is incorrect."); return View(ULV); } else return View(ULV); } else return View(); }