private void GameSaveClear() { logger.Info("MinesweeperController GameSaveClear(), Prev game is over. Erasing user save file."); //We are doing this here rather than on the index so such a check is not done everytime the page reloads, only once we need to clear the gamesave. GameDAOService gameDAO = new GameDAOService(); gameDAO.ClearSave(user);//save that null board to database, don't need to inform session as GameOver=true by here. WIll auto make new board. }
public ActionResult OnGameSave() { if (GameOver == false) //Dont want to save a game that is over. { //update the database GameDAOService gameDAO = new GameDAOService(); myBoard.GameAlert = "Game Saved!" + DateTime.Now; gameDAO.SaveGame(user, myBoard); //then update the session Session["User"] = user; //save to DB and inform the session logger.Info("MinesweeperController OnGameSave(), Game saved."); } return(PartialView("_Minesweeper", myBoard)); }