예제 #1
0
        private async Task RemoveItem(Guid itemid)
        {
            var items = StateContainer.Items;
            var item  = items.Find(id => id.ItemId == itemid);

            items.Remove(item);
            StateContainer.SetItems(items);
        }
예제 #2
0
        private async Task AddItem()
        {
            UpdatePrice();
            var       items = StateContainer.Items;
            PizzaItem item  = new PizzaItem
            {
                ItemId    = new Guid(),
                Qty       = Qty,
                SizeId    = SelectedSize.SizeId,
                TypeId    = PizzaInfo.Type.Where(o => o.TypeName == PizzaName).FirstOrDefault().TypeId,
                ToppingId = SelectedTopping.ToArray(),
                Subtotal  = SubtotalPrice,
                Tax       = TaxPrice,
                Total     = TotalPrice
            };

            items.Add(item);

            StateContainer.SetItems(items);
        }