public PromotionReward[] GetRewards() { var retVal = new CatalogItemAmountReward { Amount = Amount, AmountType = RewardAmountType.Relative }; return new PromotionReward[] { retVal }; }
public PromotionReward[] GetRewards() { var retVal = new CatalogItemAmountReward { Amount = Amount, AmountType = RewardAmountType.Absolute, ProductId = ProductId }; return new PromotionReward[] { retVal }; }
public PromotionReward[] GetRewards() { var retVal = new CatalogItemAmountReward { Amount = 100, AmountType = RewardAmountType.Relative, Quantity = NumItem, ProductId = ProductId }; return new PromotionReward[] { retVal }; }
public override PromotionReward[] EvaluatePromotion(IEvaluationContext context) { var retVal = new List<PromotionReward>(); var promoContext = context as PromotionEvaluationContext; if (promoContext != null) { foreach (var entry in promoContext.PromoEntries) { var tag = entry.Attributes != null ? entry.Attributes["tag"] : null; var reward = new CatalogItemAmountReward { AmountType = RewardAmountType.Relative, Amount = _discountAmount, IsValid = !String.IsNullOrEmpty(tag) ? _tags.Contains(tag) : false, ProductId = entry.ProductId, Promotion = this }; } } return retVal.ToArray(); }
//Copy constructor protected CatalogItemAmountReward(CatalogItemAmountReward other) : base(other) { ProductId = other.ProductId; }
//Copy constructor protected CatalogItemAmountReward(CatalogItemAmountReward other) : base(other) { ProductId = other.ProductId; }