Esempio n. 1
0
        public async Task CreateWithCostAsync(Product productToAdd, decimal?productCost_DL, decimal?productCost_DLP, decimal?productCost_ISL, decimal?productCost_IND, Boolean addToAllCustomer)
        {
            await productRepository.CreateAsync(productToAdd);

            saleModalityProductRepository.DeleteByProduct(productToAdd.ProductID);

            await CreateProductCost(productToAdd.ProductID, 1, productCost_DL);
            await CreateProductCost(productToAdd.ProductID, 2, productCost_DLP);
            await CreateProductCost(productToAdd.ProductID, 3, productCost_ISL);
            await CreateProductCost(productToAdd.ProductID, 4, productCost_IND);

            if (addToAllCustomer)
            {
                customerProductRepository.AddAllCustomersToProduct(productToAdd.ProductID);
            }
        }