Пример #1
0
        public ProductComponent GetProductComponentByName(string productName)
        {
            ProductComponent result = null;

            foreach (ProductComponent current in GetProductComponents())
            {
                if (current.GetNameText().ToLower()
                    .Equals(productName.ToLower()))
                {
                    result = current;
                    break;
                }
            }
            if (result == null)
            {
                // TODO Develop Custom Exception
                throw new Exception("ProductName: " + productName + " not Found.");
            }

            return(result);
        }
        public string GetProductExTax(Product product)
        {
            ProductComponent searchedProduct = productsContainerComponent.GetProductComponentByName(product.Title);

            return(searchedProduct.GetExTax());
        }