Esempio n. 1
0
 public JsonResult GetColors()
 {
     logger.Info("Map: GetColors");
     Entities entities = new Entities();
     var colorsList = entities.GetUserColors(WebSecurity.CurrentUserId).ToList();
     var jsonData = JsonConvert.SerializeObject(colorsList);
     return Json(jsonData, JsonRequestBehavior.AllowGet);
 }
 public ActionResult Report()
 {
     int userId = WebSecurity.GetUserId(User.Identity.Name);
     Journal journal = new Journal(eventRepository, userId);
     Game game = Session["Game"] as Game;
     if (game == null) {
         game = new Game();
         Gamer gamer = gamerRepository.Gamers.FirstOrDefault(x => x.type == "human" && x.UserId == userId);
         game.selectedCountry = countryRepository.Countries.FirstOrDefault(x => x.ridgamer == gamer.rid && x.UserId == userId);
     }
     Country country = game.selectedCountry;
     Entities entities = new Entities();
     List<Ev> events = entities.GetReportForCountry(userId, country.rid).ToList();
     return View(events);
 }