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}" }); }
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}); }