Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }