示例#1
0
        public ActionResult Create(Season season)
        {
            if (ModelState.IsValid)
            {
                db.Seasons.Add(season);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.ShowID = new SelectList(db.Shows, "ShowID", "Name", season.ShowID);
            return View(season);
        }
示例#2
0
 public ActionResult Edit(Season season)
 {
     if (ModelState.IsValid)
     {
         db.Entry(season).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.ShowID = new SelectList(db.Shows, "ShowID", "Name", season.ShowID);
     return View(season);
 }