public ActionResult Create(MenuServiceDB menuService) { if (menuService != null) { db.MenuServicedb.Add(menuService); db.SaveChanges(); return(RedirectToAction("Index")); } else { return(View()); } }
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()); } }