Example #1
0
        public ActionResult Create([Bind(Include = "Id,Category,ImgUrl,ItemAddonHeading")] MenuCategoryEntity menuCategoryEntity)
        {
            if (ModelState.IsValid)
            {
                db.MenuCategories.Add(menuCategoryEntity);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(menuCategoryEntity));
        }
        public ActionResult Create([Bind(Include = "Id,Name,Phone")] ShopEntity shopEntity)
        {
            if (ModelState.IsValid)
            {
                db.Shops.Add(shopEntity);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(shopEntity));
        }
Example #3
0
        public ActionResult Create([Bind(Include = "Id,Heading,Description,Price,ImgUrl,MenuCategoryRefId")] MenuItemEntity menuItemEntity)
        {
            if (ModelState.IsValid)
            {
                db.MenuItems.Add(menuItemEntity);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.MenuCategoryRefId = new SelectList(db.MenuCategories, "Id", "Category", menuItemEntity.MenuCategoryRefId);
            return(View(menuItemEntity));
        }