public ActionResult LoggedInLanding() { string username = (string)Session["username"]; UserSqlDal dal = new UserSqlDal(); bool inGame = dal.CheckStatus(username); if (inGame) { return(RedirectToAction("LeaveTable", "Table")); } return(View("LoggedInLanding")); }
public ActionResult Logout() { UserModel user = new UserModel(); user = (UserModel)Session["user"]; string username = (string)Session["username"]; UserSqlDal dal = new UserSqlDal(); bool inGame = dal.CheckStatus(username); if (inGame) { return(RedirectToAction("LeaveTable", "Table")); } if (user != null) { user.IsOnline = false; Session.Abandon(); } return(RedirectToAction("Index", "Home")); }