コード例 #1
0
        /// <summary>
        /// Updates the outstanding referred redemption rewards in the record list to the reward payout status specified.
        /// </summary>
        /// <param name="records">
        /// The list of records whose status to update.
        /// </param>
        /// <param name="rewardPayoutStatus">
        /// The reward payout status to which to set the records.
        /// </param>
        private void UpdateOutstandingReferredRedemptionRewards(Collection <OutstandingReferredRedemptionReward> records,
                                                                RewardPayoutStatus rewardPayoutStatus)
        {
            Collection <int> trackedRedemptionRewardsIds = new Collection <int>();

            foreach (OutstandingReferredRedemptionReward record in records)
            {
                trackedRedemptionRewardsIds.Add(record.TrackedRedemptionRewardsId);
            }
            WorkerActions.UpdateOutstandingReferredRedemptionRewards(trackedRedemptionRewardsIds, rewardPayoutStatus, RewardOperations, Context);
        }
コード例 #2
0
        /// <summary>
        /// Updates the reward payout records for those in the ID list to the reward payout status specified.
        /// </summary>
        /// <param name="trackedRedemptionRewardsIds">
        /// The IDs of reward payout records whose status to update.
        /// </param>
        /// <param name="rewardPayoutStatus">
        /// The reward payout status to which to set the records.
        /// </param>
        /// <param name="rewardOperations">
        /// The object to use to perform reward operations.
        /// </param>
        /// <param name="context">
        /// The context of the worker action being executed.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// * Parameter rewardOperations cannot be null.
        /// -OR-
        /// * Parameter context cannot be null.
        /// </exception>
        public static void UpdateOutstandingReferredRedemptionRewards(Collection <int> trackedRedemptionRewardsIds,
                                                                      RewardPayoutStatus rewardPayoutStatus,
                                                                      IRewardOperations rewardOperations,
                                                                      CommerceContext context)
        {
            if (rewardOperations == null)
            {
                throw new ArgumentNullException("rewardOperations", "Parameter rewardOperations cannot be null.");
            }

            if (context == null)
            {
                throw new ArgumentNullException("context", "Parameter context cannot be null.");
            }

            context.Log.Verbose("Updating specified reward payout records to credit status {0}.", rewardPayoutStatus);
            context[Key.TrackedRedemptionRewardsIds] = trackedRedemptionRewardsIds;
            context[Key.RewardPayoutStatus]          = rewardPayoutStatus;
            rewardOperations.UpdatePendingReferredRedemptionRewards();
        }