Esempio n. 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         _userId = Context.Request.QueryString.Get("id").ToInt32();
         _member = _memberService.Find(_userId);
     }
 }
Esempio n. 2
0
        public ActivityController()
        {
            _memberService  = new Com.Cos.BLL.MemberService();
            _lotteryService = new LotteryService();

            _userId = Com.Cos.Common.Public.GetLoginUid();
            _member = _memberService.Find(_userId);
        }
Esempio n. 3
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();
            }
        }
Esempio n. 4
0
 private void BindData()
 {
     _member = _memberService.Find(_id);
 }