Exemple #1
0
        public virtual async Task UpdateAsync(TblProductCheckoutAttributes record)
        {
            var oldRecord = await FindByIdAsync(record.Id);

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

            QueryCacheManager.ExpireTag(CacheTags.ProductCheckoutAttribute);

            _eventPublisher.EntityUpdated(record, oldRecord);
        }
Exemple #2
0
        public virtual async Task <int> AddAsync(TblProductCheckoutAttributes record)
        {
            _dbContext.ProductCheckoutAttributes.Add(record);
            await _dbContext.SaveChangesAsync();

            QueryCacheManager.ExpireTag(CacheTags.ProductCheckoutAttribute);

            _eventPublisher.EntityInserted(record);

            return(record.Id);
        }
Exemple #3
0
 public virtual async Task <string> GenerateLicenseForProductAttributeAsync(TblInvoices invoice, TblUsers user, TblProductCheckoutAttributes attribute, int quantity)
 {
     return("Test product checkout attribute license for : " + attribute.GetLocalized(p => p.Name));
 }
Exemple #4
0
        public virtual async Task <ProductCheckoutAttributeModel> PrepareProductCheckoutAttributeModelAsync(TblProductCheckoutAttributes attribute, int productId)
        {
            ProductCheckoutAttributeModel result;

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

            result.ProductId = productId;
            return(result);
        }