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

            ViewBag.SiteId = new SelectList(db.Site, "Id", "Nome", secao.SiteId);
            return View(secao);
        }
示例#2
0
 public ActionResult Edit(Secao secao)
 {
     if (ModelState.IsValid)
     {
         db.Entry(secao).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.SiteId = new SelectList(db.Site, "Id", "Nome", secao.SiteId);
     return View(secao);
 }