示例#1
0
 public async Task CreateOrUpdatePriceLevelProduct(CreatePriceLevelProductInput input)
 {
     if (input.Id == 0)
     {
         await CreatePriceLevelProduct(input);
     }
     else
     {
         await UpdatePriceLevelProduct(input);
     }
 }
示例#2
0
        public async Task CreatePriceLevelProduct(CreatePriceLevelProductInput input)
        {
            input.TenantId = (int)_session.TenantId;
            var quey = input.MapTo <PriceLevelProduct>();
            var val  = _PriceLevelProductRepository
                       .GetAll().Where(p => p.ProductId == input.ProductId && p.PriceLevelId == input.PriceLevelId).FirstOrDefault();

            if (val == null)
            {
                await _PriceLevelProductRepository.InsertAsync(quey);
            }
            else
            {
                throw new UserFriendlyException("Ooops!", "Duplicate Data Occured in PriceLevel");
            }
        }