示例#1
0
        public ActionResult Create(int parentMenuId, MenuItem menuitem)
        {
            if (ModelState.IsValid)
            {
                // TODO: Uncomment the code below
                //Menu menu = db.Menus.Single<Menu>(m => m.Id == parentMenuId);
                //menuitem.ParentMenu = menu;
                //db.MenuItems.Add(menuitem);
                //db.SaveChanges();
                return RedirectToAction("Details", "Menu", new { id = parentMenuId });
            }

            return View(menuitem);
        }
示例#2
0
 public ActionResult Edit(int parentMenuId, MenuItem menuitem)
 {
     if (ModelState.IsValid)
     {
         // TODO: Uncomment the code below
         //db.Entry(menuitem).State = EntityState.Modified;
         //db.SaveChanges();
         return RedirectToAction("Details", "Menu", new { id = parentMenuId });
     }
     return View(menuitem);
 }