Ejemplo n.º 1
0
        public bool AddNewProduct(Product newProduct)
        {
            bool result       = false;
            int  newProductID = 0;

            try
            {
                newProductID = _productAccessor.InsertNewProduct(newProduct);
                if (newProductID == 0)
                {
                    throw new ApplicationException("New product was not added.");
                }
                result = true;
            }
            catch (Exception ex)
            {
                throw new ApplicationException("Add new product failed.", ex);
            }
            return(result);
        }