Exemple #1
0
        public void Add(Item item)
        {
            ShoppingCartLine existingLine = FindLine(item);

            if (existingLine != null)
            {
                existingLine.Quantity += 1;
            }
            else
            {
                _cartLines.Add(new ShoppingCartLine(item));
            }
        }
Exemple #2
0
        public void Add(ShoppingCartLine newLine)
        {
            ShoppingCartLine existingLine = FindLine(newLine);

            if (existingLine != null)
            {
                existingLine.Quantity += newLine.Quantity;
            }
            else
            {
                _cartLines.Add(newLine);
            }
        }
Exemple #3
0
 public ShoppingCartLine FindLine(ShoppingCartLine otherLine)
 {
     return(FindLine(otherLine.Item));
 }
Exemple #4
0
 public void RemoveLine(ShoppingCartLine otherLine)
 {
     RemoveLine(otherLine.Item);
 }