public void CanCreateCupWinner() { CupWinner cupWinner = new CupWinner(season, cup, team); Assert.That(cupWinner.Season.Id, Is.EqualTo(season.Id)); Assert.That(cupWinner.Cup.Id, Is.EqualTo(cup.Id)); Assert.That(cupWinner.Team.Id, Is.EqualTo(team.Id)); }
public ActionResult Edit(CupWinner @cupWinner) { if (ModelState.IsValid) { cupWinnerService.Update(@cupWinner); cupWinnerService.Commit(); SuccessMessage(FormMessages.SaveSuccess); return(RedirectToAction("Index")); } return(View(@cupWinner)); }
public ActionResult Create(CupWinnerViewModel model) { if (ModelState.IsValid) { CupWinner leagueWinner = new CupWinner(competitionService.GetCurrentSeason(), cupService.Get(model.CupId), teamService.Get(model.TeamId)); this.cupWinnerService.Insert(leagueWinner); this.cupWinnerService.Commit(); SuccessMessage(FormMessages.SaveSuccess); return(RedirectToAction("Index")); } PopulateStaticData(model); return(View(model)); }
public void MapToModel(CupWinner leagueWinner) { this.CupWinnerId = leagueWinner.Id; this.CupId = leagueWinner.Cup.Id; TeamId = leagueWinner.Team.Id; }
public ActionResult Edit(int id) { CupWinner @cupWinner = cupWinnerService.Get(id); return(View(@cupWinner)); }