예제 #1
0
 public ActionResult AddLeague(League league)
 {
     if (ModelState.IsValid)
     {
         var manager = new LeagueManager();
         manager.AddLeague(league);
         return RedirectToAction("Leagues");
     }
     return View();
 }
예제 #2
0
 public void AddLeague(League league)
 {
     if (GetAllLeagues().Count != 0)
     {
         league.Id = GetAllLeagues().LastOrDefault().Id + 1;
     }
     else
     {
         league.Id = 1;
     }
     _leaguerepo.AddLeague(league);
 }
예제 #3
0
 /// <summary>
 /// will edit a league taht is passed in and allow them to change the other properties
 /// </summary>
 /// <param name="league"></param>
 public void EditLeague(League league)
 {
     var selectedLeague = _leagues.FirstOrDefault(l => l.Id == league.Id);
     selectedLeague.Name = league.Name;
     WriteFile();
 }
예제 #4
0
 /// <summary>
 /// will add the league to the repository from the league that is passed in 
 /// </summary>
 /// <param name="league"></param>
 public void AddLeague(League league)
 {
     _leagues.Add(league);
     WriteFile();
 }
예제 #5
0
        public ActionResult EditLeague(int id)
        {
            var manager = new LeagueManager();
            League league = new League();
            league.Id = id;
            var editLeague = manager.GetLeagueById(league.Id);

            return View(editLeague);
        }
예제 #6
0
        public ActionResult DeleteLeague(League league)
        {
            var manager = new LeagueManager();
            manager.DeleteLeagueById(league.Id);

            return RedirectToAction("Leagues");
        }
예제 #7
0
 public void EditLeague(League league)
 {
     _leaguerepo.EditLeague(league);
 }
예제 #8
0
 public void AddLeague(League league)
 {
     _leagues.Add(league);
 }