예제 #1
0
        public void RemoveItem(string product_id)
        {
            RackItem obj = _itemList.FirstOrDefault(x => x._productID.Equals(product_id));

            if (obj != null)
            {
                obj._quantity--;
                _num_items--;
                _expectedPickQuantity--;
                if (obj._quantity == 0)
                {
                    _itemList.Remove(obj);
                }
            }
        }
예제 #2
0
        public void AddItem(string product_id)
        {
            _num_items++;
            _expectedSlotQuantity--;

            RackItem obj = _itemList.FirstOrDefault(x => x._productID.Equals(product_id));

            if (obj != null)
            {
                obj._quantity++;
            }
            else
            {
                _itemList.Add(new RackItem(product_id, 1));
            }
        }