示例#1
0
 private void AddItemToCart(Item item)
 {
     if (_cartManager.CartContainsItem(_cart, item))
     {
         MessageBox.Show($"Item code{ item.ItemCode} already exists in cart.", "Add Item to Cart", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     else
     {
         _cartManager.AddItemToCart(_cart, item);
         lbl_cartSize.Text = $"({_cart.Items.Count})";
         MessageBox.Show($"Item code{ item.ItemCode} was added to cart.", "Add Item to Cart", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }