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(); } } }
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); } } }
public void AddItem(Cart_itemModel cart_itemModel) { cart_itemModel.PropertyChanged += onTotalPurchaseOrSellingPriceChange; CartItemList.Add(cart_itemModel); onPropertyChange("CartItemList"); }