Example #1
0
        public JsResultObject rebateReward(MemberModel member, int rebateAmount, string remark)
        {
            JsResultObject     re      = new JsResultObject();
            MemberAccountModel account = getCurrMemberAccount(member);

            if (member.rebateInd != BaseModel.IND_Y)
            {
                re.code = JsResultObject.CODE_ERROR;
                re.msg  = string.Format("当前用户尚未申请返还", account.newAmount, rebateAmount);
                return(re);
            }
            else if (account.newAmount < rebateAmount)
            {
                re.code = JsResultObject.CODE_ERROR;
                re.msg  = string.Format("当前用户帐户奖励{0},小于{1},返还无效", account.newAmount, rebateAmount);
                return(re);
            }
            MemberAccountModel newAccount = new MemberAccountModel();

            newAccount.createDate = DateTime.Now;
            newAccount.oldAmount  = account.newAmount;
            newAccount.newAmount  = account.newAmount - rebateAmount;
            newAccount.remark     = remark;
            newAccount.memberFk   = member.id;
            newAccount.method     = MemberAccountModel.METHOD_REWARD_REBATE;
            newAccount.setPk(newAccount.createPk());
            newAccount.remark = string.Format("成功为手机号码{0}充值{1}元", member.rebateMoblie, rebateAmount);
            re = BaseZdBiz.Save(newAccount);
            if (re.code == JsResultObject.CODE_SUCCESS)
            {
                MemberRewardLogModel rewardLog = new MemberRewardLogModel();
                rewardLog.createDate = DateTime.Now;
                rewardLog.amount     = rebateAmount;
                rewardLog.moblie     = member.rebateMoblie;
                rewardLog.method     = MemberAccountModel.METHOD_REWARD_REBATE;
                rewardLog.remark     = string.Format("成功为手机号码{0}充值{1}元", member.rebateMoblie, rebateAmount);
                rewardLog.status     = BaseModel.STATUS_ACTIVATE;
                rewardLog.memberFk   = member.id;
                rewardLog.setPk(rewardLog.createPk());
                re = BaseZdBiz.Save(rewardLog);
            }
            return(re);
        }
Example #2
0
        public JsResultObject exchangeReward(MemberRewardLogModel log)
        {
            JsResultObject re = new JsResultObject();

            return(re);
        }
Example #3
0
 public JsResultObject rebateReward(MemberModel member, int rebateAmount, string remark)
 {
     JsResultObject re = new JsResultObject();
     MemberAccountModel account = getCurrMemberAccount(member);
     if (member.rebateInd != BaseModel.IND_Y) {
         re.code = JsResultObject.CODE_ERROR;
         re.msg = string.Format("当前用户尚未申请返还", account.newAmount, rebateAmount);
         return re;
     }
     else if (account.newAmount < rebateAmount)
     {
         re.code = JsResultObject.CODE_ERROR;
         re.msg = string.Format("当前用户帐户奖励{0},小于{1},返还无效", account.newAmount, rebateAmount);
         return re;
     }
     MemberAccountModel newAccount = new MemberAccountModel();
     newAccount.createDate = DateTime.Now;
     newAccount.oldAmount = account.newAmount;
     newAccount.newAmount = account.newAmount - rebateAmount;
     newAccount.remark = remark;
     newAccount.memberFk = member.id;
     newAccount.method = MemberAccountModel.METHOD_REWARD_REBATE;
     newAccount.setPk(newAccount.createPk());
     newAccount.remark = string.Format("成功为手机号码{0}充值{1}元",member.rebateMoblie, rebateAmount);
     re = BaseZdBiz.Save(newAccount);
     if (re.code == JsResultObject.CODE_SUCCESS)
     {
         MemberRewardLogModel rewardLog = new MemberRewardLogModel();
         rewardLog.createDate = DateTime.Now;
         rewardLog.amount = rebateAmount;
         rewardLog.moblie = member.rebateMoblie;
         rewardLog.method = MemberAccountModel.METHOD_REWARD_REBATE;
         rewardLog.remark = string.Format("成功为手机号码{0}充值{1}元", member.rebateMoblie, rebateAmount);
         rewardLog.status = BaseModel.STATUS_ACTIVATE;
         rewardLog.memberFk = member.id;
         rewardLog.setPk(rewardLog.createPk());
         re = BaseZdBiz.Save(rewardLog);
     }
     return re;
 }
Example #4
0
 public JsResultObject exchangeReward(MemberRewardLogModel log)
 {
     JsResultObject re = new JsResultObject();
     return re;
 }