public ActionResult Edit(Team team, long id) { if (ModelState.IsValid) { team.TeamId = id; team.PlayersConcat = PlayersConverter.ConvertListToString(team.Players); _list.Update(team); return(RedirectToAction("Details", new { id = team.TeamId })); } return(ViewForm("Edit", "Edit", team)); }
public ActionResult Create(Team team) { if (ModelState.IsValid) { team.PlayersConcat = PlayersConverter.ConvertListToString(team.Players); _list.Create(team); UpdateTeams(team.TeamId); return(RedirectToAction("Details", new { id = team.TeamId })); } return(RedirectToAction("Index")); }
public ActionResult FixBensTeam(int id) { Team team = _list.Read((long)id); team.Players = PlayersConverter.ParseStringToList(team.PlayersConcat); string pr = "8471469"; string ma = "8470594"; //getting player's from db List <string> pIds = team.Players; pIds.Remove(pr); pIds.Add(ma); team.Players = pIds; team.PlayersConcat = PlayersConverter.ConvertListToString(team.Players); _list.Update(team); return(RedirectToAction("Index")); }