public async Task <IActionResult> ConfirmOrder(decimal milkNeed, decimal coffeNeed, decimal waterNeed, bool milkCheck, bool coffeCheck, bool waterCheck) { ComponentServiceHelper componentService = new ComponentServiceHelper(); var response = await componentService.ConfirmOrderAsync(milkNeed, coffeNeed, waterNeed, milkCheck, coffeCheck, waterCheck); return(Json(response)); }
public async Task <IActionResult> Index() { CoffeServiceHelper coffeService = new CoffeServiceHelper(); List <Coffe> coffeList = await coffeService.GetCoffesAsync(); ComponentServiceHelper componentService = new ComponentServiceHelper(); List <Component> componentList = await componentService.GetStockDataAsync(); ViewBag.CoffeInStock = componentList[0].Stock; ViewBag.CoffeUnitPrice = componentList[0].UnitPrice; ViewBag.MilkInStock = componentList[1].Stock; ViewBag.MilkUnitPrice = componentList[1].UnitPrice; ViewBag.WaterInStock = componentList[2].Stock; ViewBag.WaterUnitPrice = componentList[2].UnitPrice; return(View(coffeList)); }