Example #1
0
 public ActionResult CreateItem(int ID, MenuItemModel item)
 {
     if (ModelState.IsValid)
     {
         MenuItemManager.Insert(item);
         return(RedirectToAction("EditMenu", "Vendor", new { id = item.MenuItem }));
     }
     else
     {
         return(View(item));
     }
 }
Example #2
0
        public void InsertTest()
        {
            MenuItem menuItem = new MenuItem
            {
                Id       = Guid.NewGuid(),
                ItemName = "Garlic Bread",
                Price    = (float)3.99
            };

            bool result = MenuItemManager.Insert(menuItem);

            Assert.IsTrue(result);
        }
Example #3
0
 // POST: api/MenuItem
 public void Post([FromBody] MenuItem make)
 {
     MenuItemManager.Insert(make);
 }