예제 #1
0
 // GET: Statistics
 public ActionResult Index()
 {
     var statistics = new StatisticsService().GetStatistics();
     return View(statistics);
 }
예제 #2
0
 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);
     }
 }