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

            return View(section);
        }
示例#2
0
 public ActionResult Edit(Section section)
 {
     if (ModelState.IsValid)
     {
         db.Entry(section).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(section);
 }