Exemplo n.º 1
0
        /// <summary>
        /// 审核
        /// </summary>
        /// <param name="id">兑换id</param>
        /// <param name="official">最终值</param>
        private void ShenHe(int id, string official)
        {
            var exchange = _exchangeService.Find(id);

            exchange.Official = official;  //设置最终值
            exchange.Examine  = "1";
            _exchangeService.Update(exchange);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 租借订单提交
        /// </summary>
        /// <param name="userId">会员id</param>
        /// <param name="exId">兑换id</param>
        /// <param name="address">地址id</param>
        /// <param name="deposit">押金</param>
        /// <param name="method">兑换方式,0为会员租赁,1为单次租赁</param>
        private void RentedConfirm(string userId, string exId, string address, string deposit, string method)
        {
            using (TransactionScope ts = new TransactionScope())
            {
                //添加兑换人员表
                var ep = new Com.Cos.Models.ExchangePerson()
                {
                    UserId  = userId,
                    ExId    = exId,
                    AddTime = DateTime.Now,
                    Examine = "0",
                    Address = address,
                    Status  = 1
                };
                _exchangePersonService.Add(ep);
                //更新兑换表
                var ex = _exchangeService.Find(exId.ToInt32());
                ex.Examine        = "4"; //修改为已兑换
                ex.ExchangePerson = userId;
                _exchangeService.Update(ex);
                //更新会员表
                var member = _memberService.Find(userId.ToInt32());
                member.Deposit = deposit.ToDecimal();
                if (method == "0")  //会员租赁
                {
                    member.RemainingConversions--;
                }
                if (method == "1")  //单次租赁
                {
                    member.Shenjia -= 50;
                }
                _memberService.Update(member);

                ts.Complete();
            }
        }