예제 #1
0
        public async Task <ActionResult> Add()
        {
            MenuItemRepository rep = new MenuItemRepository(sqlConnection);
            EditMenuItemModel  md  = new EditMenuItemModel();

            md.ItemCatergories = await rep.GetItemCatergories(User.Identity.GetUserId());


            return(View(md));
        }
예제 #2
0
        public async Task <ActionResult> Edit(long ModelId)
        {
            MenuItemRepository       rep   = new MenuItemRepository(sqlConnection);
            MenuIngredientRepository igrep = new MenuIngredientRepository(sqlConnection);
            EditMenuItemModel        md    = new EditMenuItemModel();

            md.MenuItem = await rep.GetItemById(ModelId);

            md.ItemCatergories = await rep.GetItemCatergories(User.Identity.GetUserId());

            md.AvailableIngredients = await igrep.GetItems(User.Identity.GetUserId());

            md.CurrentIngredients = await rep.GetCurrentItemIngredients(ModelId);

            return(View(md));
        }