Example #1
0
        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));
        }
Example #2
0
 public ActionResult Edit(CupWinner @cupWinner)
 {
     if (ModelState.IsValid)
     {
         cupWinnerService.Update(@cupWinner);
         cupWinnerService.Commit();
         SuccessMessage(FormMessages.SaveSuccess);
         return(RedirectToAction("Index"));
     }
     return(View(@cupWinner));
 }
Example #3
0
        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;
 }
Example #5
0
        public ActionResult Edit(int id)
        {
            CupWinner @cupWinner = cupWinnerService.Get(id);

            return(View(@cupWinner));
        }