Exemplo n.º 1
0
        /// <summary>
        /// 初始化充值界面
        /// </summary>
        /// <returns></returns>
        public ActionResult Recharge(int Id)
        {
            var    result = _memberContract.Edit(Id);
            Member member = _memberContract.View(Id);

            ViewBag.MemberId     = Id;
            ViewBag.MemberTypeId = result.MemberTypeId;
            var     memberDepList = _memberDepositContract.MemberDeposits.Where(x => x.IsDeleted == false && x.IsEnabled == true && x.MemberId == Id);
            decimal price         = 0;
            decimal score         = 0;

            if (memberDepList.Count() > 0)
            {
                foreach (var memberDep in memberDepList)
                {
                    price = price + memberDep.Price;
                    score = score + memberDep.Score;
                }
            }
            ViewBag.Balance = member.Balance;
            ViewBag.Price   = price;
            ViewBag.Score   = score;
            MemberDepositDto dto = new MemberDepositDto();

            dto.MemberId = Id;

            return(PartialView(dto));
        }
Exemplo n.º 2
0
        public JsonResult Recharge(MemberDepositDto dto)
        {
            OperationResult oper = _memberDepositContract.Insert(dto);

            return(Json(oper));
        }
        public ActionResult Update(MemberDepositDto dto)
        {
            var result = _memberdepositContract.Update(dto);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }