Exemple #1
0
 public ActionResult Create(MenuServiceDB menuService)
 {
     if (menuService != null)
     {
         db.MenuServicedb.Add(menuService);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     else
     {
         return(View());
     }
 }
Exemple #2
0
        public ActionResult Edit(int Id, MenuServiceDB menuServicedb)
        {
            var res = db.MenuServicedb.Find(Id);

            if (res != null)
            {
                res.Id           = menuServicedb.Id;
                res.itemName     = menuServicedb.itemName;
                res.itemPrepTime = menuServicedb.itemPrepTime;
                res.itemPrice    = menuServicedb.itemPrice;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View());
            }
        }