Esempio n. 1
0
        public async Task CreateOrUpdateProductPriceLevel(ProductPriceLevelInput input)

        {
            if (input.Id == 0)
            {
                await CreateProductPriceLevel(input);
            }
            else
            {
                await UpdateProductPriceLevel(input);
            }
        }
Esempio n. 2
0
        public virtual async Task UpdateProductPriceLevel(ProductPriceLevelInput input)
        {
            var productPricelevel = input.MapTo <ProductPricelevel>();

            var query = _ProductPricelevelRepository.GetAll().Where(p => (p.ProductId == input.ProductId && p.PriceLevelId == input.PriceLevelId) && p.Id != input.Id).FirstOrDefault();

            if (query == null)
            {
                await _ProductPricelevelRepository.UpdateAsync(productPricelevel);
            }
            else
            {
                throw new UserFriendlyException("Ooops!", "Duplicate Data Occured in Product Pricelevel...");
            }
        }