示例#1
0
        public virtual async Task UpdateOptionAsync(TblProductCheckoutAttributeOptions record)
        {
            var oldRecord = await FindOptionByIdAsync(record.Id);

            _dbContext.ProductCheckoutAttributeOptions.AddOrUpdate(record);
            await _dbContext.SaveChangesAsync();

            QueryCacheManager.ExpireTag(CacheTags.ProductCheckoutAttribute);

            _eventPublisher.EntityUpdated(record, oldRecord);
        }
示例#2
0
        public virtual async Task <int> AddOptionAsync(TblProductCheckoutAttributeOptions record)
        {
            _dbContext.ProductCheckoutAttributeOptions.Add(record);
            await _dbContext.SaveChangesAsync();

            QueryCacheManager.ExpireTag(CacheTags.ProductCheckoutAttribute);

            _eventPublisher.EntityInserted(record);

            return(record.Id);
        }
示例#3
0
 public virtual async Task <string> GenerateLicenseForProductAttributeOptionAsync(TblInvoices invoice, TblUsers user,
                                                                                  TblProductCheckoutAttributeOptions attributeOption, int quantity)
 {
     return("Test product checkout attribute option license for : " + attributeOption.GetLocalized(p => p.Name));
 }
示例#4
0
        public virtual async Task <ProductCheckoutAttributeOptionModel> PrepareProductCheckoutAttributeOptionModelAsync(TblProductCheckoutAttributeOptions option, int attributeId)
        {
            ProductCheckoutAttributeOptionModel result;

            if (option == null)
            {
                result = new ProductCheckoutAttributeOptionModel();
            }
            else
            {
                result = option.Adapt <ProductCheckoutAttributeOptionModel>();
                await option.LoadAllLocalizedStringsToModelAsync(result);
            }

            result.ProductCheckoutAttributeId = attributeId;
            return(result);
        }