Beispiel #1
0
        public JsonResult AddWithDraw(WithDrawInfo infoModel)
        {
            //info.MembersId = base.CurrentUser.UserName;
            //info.Id = ServiceHelper.Create<IWithDrawService>().GetNextWithDrawId();
            //ServiceHelper.Create<IWithDrawService>().AddWithDraw(info);
            //return Json(new { success = true });

            IWithDrawService withDrawService = ServiceHelper.Create <IWithDrawService>();
            WithDrawInfo     withDrawInfo    = new WithDrawInfo()
            {
                Id            = infoModel.Id,
                WithdrawType  = infoModel.WithdrawType,
                AccountNumber = infoModel.AccountNumber,
                Name          = infoModel.Name,
                IdNo          = infoModel.IdNo,
                Mobile        = infoModel.Mobile,
                MembersId     = base.CurrentSellerManager.UserName
            };
            WithDrawInfo withDrawInfo1 = withDrawInfo;

            if (withDrawInfo1.Id <= 0)
            {
                withDrawInfo1.Id = ServiceHelper.Create <IWithDrawService>().GetNextWithDrawId();
                withDrawService.AddWithDraw(withDrawInfo1);
            }
            else
            {
                withDrawService.UpdateWithDraw(withDrawInfo1);
            }
            return(Json(new { success = true }));
        }
Beispiel #2
0
 public void AddWithDraw(WithDrawInfo model)
 {
     if (model == null)
     {
         throw new ArgumentNullException("model", "添加一个提现信息,Model为空");
     }
     context.WithDrawInfo.Add(model);
     context.SaveChanges();
     Cache.Remove("Cache-WithDraw");
 }
Beispiel #3
0
        public void UpdateWithDraw(WithDrawInfo model)
        {
            WithDrawInfo name = context.WithDrawInfo.FindById <WithDrawInfo>(model.Id);

            name.WithdrawType  = model.WithdrawType;
            name.AccountNumber = model.AccountNumber;
            name.Name          = model.Name;
            name.IdNo          = model.IdNo;
            name.Mobile        = model.Mobile;
            context.SaveChanges();
            Cache.Remove("Cache-WithDraw");
        }
Beispiel #4
0
        public ActionResult AddWithDraw(long?id)
        {
            List <SelectListItem> items = new List <SelectListItem>();

            items.Add(new SelectListItem {
                Text = "PayPal", Value = "PayPal"
            });
            items.Add(new SelectListItem {
                Text = "Alipay", Value = "Alipay"
            });
            items.Add(new SelectListItem {
                Text = "WeiXin", Value = "WeiXin"
            });

            this.ViewData["list"] = items;

            WithDrawInfo     withDrawInfo;
            WithDrawInfo     withDrawModel;
            IWithDrawService withDrawService = ServiceHelper.Create <IWithDrawService>();

            if (id.HasValue)
            {
                long?nullable = id;
                if ((nullable.GetValueOrDefault() <= 0 ? true : !nullable.HasValue))
                {
                    withDrawInfo  = new WithDrawInfo();
                    withDrawModel = new WithDrawInfo()
                    {
                        Id            = withDrawInfo.Id,
                        WithdrawType  = withDrawInfo.WithdrawType,
                        AccountNumber = withDrawInfo.AccountNumber,
                        Name          = withDrawInfo.Name,
                        IdNo          = withDrawInfo.IdNo,
                        Mobile        = withDrawInfo.Mobile
                    };
                    return(View(withDrawModel));
                }
                withDrawInfo  = withDrawService.GetWithDrawById(id.Value);
                withDrawModel = new WithDrawInfo()
                {
                    Id            = withDrawInfo.Id,
                    WithdrawType  = withDrawInfo.WithdrawType,
                    AccountNumber = withDrawInfo.AccountNumber,
                    Name          = withDrawInfo.Name,
                    IdNo          = withDrawInfo.IdNo,
                    Mobile        = withDrawInfo.Mobile
                };
                return(View(withDrawModel));
            }
            withDrawInfo  = new WithDrawInfo();
            withDrawModel = new WithDrawInfo()
            {
                Id            = withDrawInfo.Id,
                WithdrawType  = withDrawInfo.WithdrawType,
                AccountNumber = withDrawInfo.AccountNumber,
                Name          = withDrawInfo.Name,
                IdNo          = withDrawInfo.IdNo,
                Mobile        = withDrawInfo.Mobile
            };
            return(View(withDrawModel));
        }
Beispiel #5
0
 public JsonResult EditWithDraw(WithDrawInfo info)
 {
     info.MembersId = this.CurrentUser.UserName;
     ServiceHelper.Create <IWithDrawService>().UpdateWithDraw(info);
     return(Json(new { success = true, msg = "Update Success", id = info.Id }));
 }