public ActionResult Edit(int id, TeamModel model) { try { var ts = new TeamService(AllTeamRepository); ts.AddOrUpdate(model.GetTeam()); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public ActionResult Create(TeamModel model) { try { var ts = new TeamService(AllTeamRepository); ts.AddOrUpdate(model.GetTeam()); } catch (ArgumentException e) { TempData["MsgError"] = e.Message; } return(RedirectToAction(nameof(Index))); }