예제 #1
0
        public void AddSize(string sizeUS, int quantity, string UPC = null)
        {
            SneakerSize size = new SneakerSize(sizeUS);

            if (!String.IsNullOrWhiteSpace(UPC))
            {
                size.upc = UPC;
            }
            if (quantity > 0)
            {
                size.quantity = quantity;
            }
            else
            {
                throw new Exception("попытка добавить товар с нулевым количеством");
            }
            this.sizes.Add(size);
        }