Ejemplo n.º 1
0
        /// <summary>
        /// 保存积分明细
        /// </summary>
        /// <param name="scoreList">积分明细</param>
        /// <param name="oldScore">原积分</param>
        /// <param name="payType">支付方式</param>
        /// <param name="cash">现金</param>
        /// <param name="code">代码</param>
        /// <returns>1成功</returns>
        public int SaveAddScoreInfo(ME_ScoreList scoreList, int oldScore, int payType, int cash, out string code)
        {
            code = string.Empty;
            BindDb(scoreList);
            scoreList.save();

            if (payType != 3)
            {
                int    accID      = NewObject <MemberAccountManagement>().GetAccountId(scoreList.OperateID, 1);
                string perfChar   = string.Empty;
                string ticketCode = NewObject <InvoiceManagement>().GetInvoiceCurNOAndUse(InvoiceType.账户充值, scoreList.OperateID, out perfChar);
                if (string.IsNullOrEmpty(ticketCode) == false)
                {
                    ticketCode = perfChar + ticketCode;
                }

                ME_Recharge recharge = new HIS_Entity.MemberManage.ME_Recharge();
                recharge.OperateFlag  = 0;
                recharge.OperateID    = scoreList.OperateID;
                recharge.Money        = cash;
                recharge.RechargeCode = ticketCode; //单据号码
                recharge.TypeID       = 2;          //换卡
                recharge.AccountID    = scoreList.AccountID;
                recharge.OperateTime  = System.DateTime.Now;
                recharge.PayType      = payType;
                recharge.Account      = accID;
                this.BindDb(recharge);
                recharge.save();
                code = ticketCode;
            }

            return(NewObject <IOPMemberAccountDao>().UpdateAccountScore(scoreList.AccountID, oldScore, scoreList.OperateDate, scoreList.OperateID));
        }
Ejemplo n.º 2
0
        public ServiceResponseData SaveChangeCardList()
        {
            int resFlag            = 0;
            ME_ChangeCardList list = requestData.GetData <ME_ChangeCardList>(0);
            int workID             = requestData.GetData <int>(1);
            int payType            = requestData.GetData <int>(2);

            //1、更新帐户表
            resFlag = NewDao <IOPMemberAccountDao>().UpdateAccountInfo(list.AccountID, list.NewCardNO, list.OperateID);

            //2、新建换卡纪录
            resFlag = NewObject <MemberAccountManagement>().SaveChangeCardList(list);

            //3、新增换卡费用
            int    accID      = NewObject <MemberAccountManagement>().GetAccountId(list.OperateID, 1);
            string perfChar   = string.Empty;
            string ticketCode = NewObject <InvoiceManagement>().GetInvoiceCurNOAndUse(InvoiceType.账户充值, list.OperateID, out perfChar);

            if (string.IsNullOrEmpty(ticketCode) == false)
            {
                ticketCode = perfChar + ticketCode;
            }

            if (list.Amount > 0)
            {
                ME_Recharge recharge = new HIS_Entity.MemberManage.ME_Recharge();
                recharge.OperateFlag  = 0;
                recharge.OperateID    = list.OperateID;
                recharge.Money        = list.Amount;
                recharge.RechargeCode = ticketCode; //单据号码
                recharge.TypeID       = 1;          //换卡
                recharge.AccountID    = list.AccountID;
                recharge.OperateTime  = System.DateTime.Now;
                recharge.PayType      = payType;
                recharge.Account      = accID;
                this.BindDb(recharge);
                recharge.save();
            }

            responseData.AddData(resFlag);
            responseData.AddData(ticketCode);
            return(responseData);
        }