Exemplo n.º 1
0
        public void UpdatePriceCartList(string itemName)
        {
            foreach (var tempItem in CartItemList)
            {
                if (tempItem.Name == itemName)
                {
                    CartItemList.Remove(tempItem);
                    tempItem.IsChecked = false;
                    if (viewVisible == Visibility.Visible)
                    {
                        BuyingOffer();
                    }
                    return;
                }
            }

            foreach (var tempItem in ItemList)
            {
                if (tempItem.Name == itemName)
                {
                    Item item = CreatCartM.GetItemsByName(itemName).FirstOrDefault();
                    tempItem.Description    = item.Description;
                    tempItem.ImagePath      = item.ImagePath;
                    tempItem.CheapestBranch = CreatCartM.GetCheapestBranch(itemName);
                    tempItem.IsChecked      = true;
                    CartItemList.Add(tempItem);
                    BuyingOffer();
                }
            }
        }
Exemplo n.º 2
0
        public void UpdateOfferCartList(string itemName)
        {
            foreach (var tempItem in CartItemList)
            {
                if (tempItem.Name == itemName)
                {
                    return;
                }
            }

            foreach (var tempItem in ItemList)
            {
                if (tempItem.Name == itemName)
                {
                    Item item = CreatCartM.GetItemsByName(itemName).FirstOrDefault();
                    tempItem.Description    = item.Description;
                    tempItem.ImagePath      = item.ImagePath;
                    tempItem.CheapestBranch = CreatCartM.GetCheapestBranch(itemName);
                    tempItem.IsChecked      = true;
                    CartItemList.Add(tempItem);
                }
            }
        }
Exemplo n.º 3
0
 public void AddItem(Cart_itemModel cart_itemModel)
 {
     cart_itemModel.PropertyChanged += onTotalPurchaseOrSellingPriceChange;
     CartItemList.Add(cart_itemModel);
     onPropertyChange("CartItemList");
 }