Beispiel #1
0
        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"));
        }
Beispiel #2
0
        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"));
        }