Beispiel #1
0
        public ActionResult Create(Match match)
        {
            if (ModelState.IsValid)
            {
                context.Matches.Add(match);
                context.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.PossibleHomeTeams = context.Teams;
            ViewBag.PossibleAwayTeams = context.Teams;
            ViewBag.PossibleFixtures = context.Fixtures;
            return View(match);
        }
Beispiel #2
0
 public ActionResult Edit(Match match)
 {
     if (ModelState.IsValid)
     {
         context.Entry(match).State = EntityState.Modified;
         context.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.PossibleHomeTeams = context.Teams;
     ViewBag.PossibleAwayTeams = context.Teams;
     ViewBag.PossibleFixtures = context.Fixtures;
     return View(match);
 }