public ActionResult Edit(PlayerModel model,bool continueEditing) { var player = _playerService.GetById(model.Id); if (player == null) return RedirectToAction("List"); player = model.ToEntity(); _playerService.Update(player); if (continueEditing) { return RedirectToAction("Edit", new {id = model.Id }); } return RedirectToAction("List"); }
public PlayerDetailsModel() { GeneralInfo = new PlayerModel(); PlannedMatches = new List<MatchModel>(); PlayedMatches = new List<MatchModel>(); }
public ActionResult Create(PlayerModel model, bool continueEditing) { var player = model.ToEntity(); _playerService.Add(player); return continueEditing ? RedirectToAction("Edit", new { id = player.Id }) : RedirectToAction("List"); }
//create public ActionResult Create() { var model = new PlayerModel(); return View(model); }