public ActionResult Questions(int GameID) { if (CheckLoggedIn()) { return(RedirectToAction("Index", "Login")); } QuestionsViewModel model = new QuestionsViewModel(); model.game = gameHandler.GetGame(GameID); model.game.Questions = question_Handler.GetQuestions(GameID); return(View("Questions", model)); }
// GET: Game public ActionResult Index(string ID) { isLoggedIn(); BrightLearn.ViewModels.Game.IndexViewModel model = new BrightLearn.ViewModels.Game.IndexViewModel(); Game game = gameHandler.GetGame(ID); model.GameID = game.ID; model.Lifes = game.Lifes; model.bonusTime = game.BonusTime; model.Questions = questionHandler.GetQuestions(game.ID); if (model.Questions.Count == 0) { //Display error that there are no questions } return(View(model)); }