Exemplo n.º 1
0
 public ActionResult Edit(Round round, string tournamentSlug)
 {
     if (ModelState.IsValid)
     {
         db.Entry(round).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Standings", "Home", new {tournamentSlug});
     }
     ViewBag.TournamentId = new SelectList(db.Tournaments, "Id", "Name", round.TournamentId);
     return View(round);
 }
Exemplo n.º 2
0
        public ActionResult Create(Round round, string tournamentSlug)
        {
            if (ModelState.IsValid)
            {
                db.Rounds.Add(round);
                db.SaveChanges();
                return RedirectToAction("Standings", "Home", new {tournamentSlug});
            }

            ViewBag.TournamentId = new SelectList(db.Tournaments, "Id", "Name", round.TournamentId);
            return View(round);
        }
        public ActionResult Create(Round round)
        {
            if (ModelState.IsValid)
            {
                db.Rounds.Add(round);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.TournamentId = new SelectList(db.Tournaments, "Id", "Name", round.TournamentId);
            return View(round);
        }
 public ActionResult Edit(Round round)
 {
     if (ModelState.IsValid)
     {
         db.Entry(round).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.TournamentId = new SelectList(db.Tournaments, "Id", "Name", round.TournamentId);
     return View(round);
 }