// GET: Statistics public ActionResult Index() { var statistics = new StatisticsService().GetStatistics(); return View(statistics); }
private void nextRiddle(CurrentTeamRiddleViewModel model) { var teamQuest = getTeamQuest(model.TeamName); var statisticsService = new StatisticsService(); if (teamQuest.HasNextRiddle()) { var nextRiddle = teamQuest.NextRiddle(); teamQuest.RiddleId = nextRiddle.Id; teamQuest.RiddleStarTime = DateTime.Now; dbQuest.Entry(teamQuest).State = EntityState.Modified; dbQuest.SaveChanges(); statisticsService.UpdateStatictics(model.TeamName); } else { teamQuest.IsTheEnd = true; dbQuest.Entry(teamQuest).State = EntityState.Modified; dbQuest.SaveChanges(); statisticsService.Finish(model.TeamName); } }