Exemplo n.º 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 }));
        }
Exemplo n.º 2
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));
        }