/// <summary> /// Retrieves information about the unprocessed redemption reward specified in the context. /// </summary> /// <returns> /// The ResultCode corresponding to the result of the operation. /// </returns> public ResultCode RetrieveUnprocessedRedemptionReward() { Guid rewardPayoutId = (Guid)Context[Key.RewardPayoutId]; // Marshal sproc parameters. Dictionary <string, object> parameterList = new Dictionary <string, object>(); parameterList.Add("@rewardPayoutId", rewardPayoutId); parameterList.Add("@partnerCardId", (string)Context[Key.PartnerCardId]); parameterList.Add("@partnerRedeemedDealId", (string)Context[Key.PartnerRedeemedDealId]); parameterList.Add("@rewardId", (Guid)Context[Key.RewardId]); // Call the sproc and return the result code. return(SqlProcedure("GetUnprocessedRedemptionReward", parameterList, (sqlDataReader) => { if (sqlDataReader.Read() == true) { // Get the reward payout record. RewardPayoutRecord rewardPayoutRecord = new RewardPayoutRecord { RewardPayoutId = rewardPayoutId, RewardType = (RewardType)sqlDataReader.GetInt32(sqlDataReader.GetOrdinal("RewardTypeId")), Properties = sqlDataReader.GetString(sqlDataReader.GetOrdinal("Properties")), PayeeId = sqlDataReader.GetGuid(sqlDataReader.GetOrdinal("UserId")), PayeeType = PayeeType.User, Rescinded = sqlDataReader.GetBoolean(sqlDataReader.GetOrdinal("Rescinded")) }; Context[Key.RewardPayoutRecord] = rewardPayoutRecord; } })); }
/// <summary> /// Initializes a new instance of the ApplyReferralRewardTask class. /// </summary> /// <param name="rewardPayoutRecord"> /// The RewardPayoutRecord to process. /// </param> /// <param name="userId"> /// The ID of the user who was referred into the system. /// </param> /// <param name="log"> /// The CommerceLog object through which log entries can be made. /// </param> public ApplyRewardTask(RewardPayoutRecord rewardPayoutRecord, string userId, CommerceLog log) { RewardPayoutRecord = rewardPayoutRecord; UserId = userId; Log = log; }
/// <summary> /// Initializes a new instance of the ApplyEarnCredit class. /// </summary> /// <param name="rewardPayoutRecord"> /// The RewardPayoutRecord to process. /// </param> /// <param name="log"> /// The CommerceLog object through which log entries can be made. /// </param> public ApplyEarnCredit(RewardPayoutRecord rewardPayoutRecord, CommerceLog log) { RewardPayoutRecord = rewardPayoutRecord; Log = log; }