示例#1
0
 public ActionResult AddMenu(Menu model)
 {
     Menu menu = new Menu();
     menu.Title = model.Title;
     menu.Url = model.Url;
     db.Menus.Add(menu);
     db.SaveChanges();
     return RedirectToAction("MenuManager");
 }
示例#2
0
 public ActionResult MenuEdit(Menu model)
 {
     Menu menu = new Menu();
     menu = db.Menus.Find(model.ID);
     menu.Title = model.Title;
     menu.Url = model.Url == null ? "Null" : model.Url;
     db.SaveChanges();
     return RedirectToAction("MenuManager");
 }