public ActionResult LoginUser(LoginVM login) { if (userbll.checkUserLogin(login) != null) { var user = userbll.checkUserLogin(login); Session["user_id"] = user.user_id; var role = user.role; if (role == true) { return(RedirectToAction("getAllCourses", "Course", new { area = "AdminArea" })); } int user_id = int.Parse(Session["user_id"].ToString()); return(RedirectToAction("Index", "Home")); } else { return(RedirectToAction("LoginUser", "Home")); } }
public ActionResult login(LoginVM login) { if (userbll.checkUserLogin(login) != null) { return(RedirectToAction("Index", "Users")); } else { return(RedirectToAction("login", "Users")); } }