Esempio n. 1
0
        public ActionResult Create(Menu menu)
        {
            if (ModelState.IsValid)
            {
                menu.id = db.Channels.Max(c => c.id) + 1;
                db.Menus.Add(menu);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(menu);
        }
Esempio n. 2
0
 public ActionResult Edit(Menu menu)
 {
     if (ModelState.IsValid)
     {
         db.Entry(menu).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(menu);
 }