Пример #1
0
        public JsonResult Delete(SPA model)
        {
            PlayersRepository pRepo = new PlayersRepository();

            //Team 1 is always = deleted players
            pRepo.AssociatePlayerToTeam(model.PlayerId, 1);

            return Json(new { Success = true, Message = $"Deleted player: {model.PlayerName} + {model.PlayerId}" });
        }
Пример #2
0
        public JsonResult PlayerToTeam(SPA model)
        {
            string message = model.PlayerName;
            int id = model.PlayerId;
            int team = model.TeamId;
            PlayersRepository pRepo = new PlayersRepository();
            pRepo.AssociatePlayerToTeam(id, team);

            return Json(new { Success = true, Message = "Moved player: " + message + " ID: " + id + "to team:" + team});
        }