Exemplo n.º 1
0
 public JsonResult UpdateGame(string gamename, string description, int gameid)
 {
     using (var gamerepo = new GameRepository())
     {
         var result = gamerepo.UpdateGame(gamename, description, gameid);
         return new JsonResult { Data = new { isOk = result } };
     }
 }
Exemplo n.º 2
0
 public JsonResult DeleteGame(int id)
 {
     using (var gamerepo = new GameRepository())
     {
         var result = gamerepo.DeleteGame(id);
         return new JsonResult { Data = new { isOk = result } };
     }
 }
Exemplo n.º 3
0
 public JsonResult AddGame(string gamename, string description)
 {
     using (var gamerepo = new GameRepository())
     {
         var result = gamerepo.AddGame(gamename, description);
         return new JsonResult { Data = new { isOk = result } };
     }
 }
Exemplo n.º 4
0
 public ActionResult ViewGameList()
 {
     using (var gamerepo = new GameRepository())
     {
         var model = new GameViewModel();
         model.Games = gamerepo.ViewGames();
         return View(model);
     }
 }
Exemplo n.º 5
0
 public ActionResult EditGame(int id)
 {
     using (var gamerepo = new GameRepository())
     {
         var model = new GameEditModel();
         model.Game = gamerepo.GetGameById(id);
         return View(model);
     }
 }