Example #1
0
        public ActionResult Management()
        {
            var model = _iCashDepositsService.GetCashDepositByShopId(CurrentSellerManager.ShopId);

            ViewBag.NeedPayCashDeposit = _iCashDepositsService.GetNeedPayCashDepositByShopId(CurrentSellerManager.ShopId);
            var shopAccount = ShopApplication.GetShopAccount(CurrentSellerManager.ShopId);

            ViewBag.ShopAccountAmount = shopAccount.Balance.ToString("F2");
            if (ViewBag.NeedPayCashDeposit == -1)
            {
                return(View("UnSet"));
            }
            return(View(model));
        }
Example #2
0
        public JsonResult AccountBalancePay(decimal balance, int type, int value)
        {
            if (balance <= 0)
            {
                return(Json(new Result()
                {
                    success = false, msg = "应缴金额不正确"
                }));
            }

            var shopAccount = ShopApplication.GetShopAccount(CurrentSellerManager.ShopId);

            if (shopAccount == null)
            {
                return(Json(new Result()
                {
                    success = false, msg = "店铺账户信息异常"
                }));
            }

            if (shopAccount.Balance < balance) //店铺余额不足以支付费用
            {
                return(Json(new Result()
                {
                    success = false, msg = "您的店铺余额为:" + shopAccount.Balance + "元,不足以支付此次费用,请先充值。"
                }));
            }

            string trandNo = shopAccount.ShopId + "" + new Random().Next(1000000);

            ShopApplication.ShopReNewPayNotify(trandNo, CurrentSellerManager.ShopId, CurrentSellerManager.UserName, balance, type, value, true);
            ShopApplication.ClearCacheShop(CurrentSellerManager.ShopId);
            return(Json(new Result()
            {
                success = true
            }));
        }
Example #3
0
        public ActionResult Renew()
        {
            //店铺当前信息
            ShopRenewModel model = new ShopRenewModel();

            model.ShopId = CurrentSellerManager.ShopId;

            var shop = _iShopService.GetShop(CurrentSellerManager.ShopId);

            model.ShopName       = shop.ShopName;
            model.ShopCreateTime = shop.CreateDate.ToString("yyyy/MM/dd");
            model.ShopEndTime    = shop.EndDate.ToString("yyyy/MM/dd");

            var grade = ShopApplication.GetShopGrade(shop.GradeId);

            model.GradeName    = grade.Name;
            model.ImageLimit   = grade.ImageLimit;
            model.ProductLimit = grade.ProductLimit;

            //续费时间
            List <SelectListItem> yearList = new List <SelectListItem> {
            };

            yearList.Add(new SelectListItem()
            {
                Selected = true, Text = "一年", Value = "1"
            });
            yearList.Add(new SelectListItem()
            {
                Selected = false, Text = "两年", Value = "2"
            });
            yearList.Add(new SelectListItem()
            {
                Selected = false, Text = "三年", Value = "3"
            });
            yearList.Add(new SelectListItem()
            {
                Selected = false, Text = "四年", Value = "4"
            });
            yearList.Add(new SelectListItem()
            {
                Selected = false, Text = "五年", Value = "5"
            });
            ViewBag.YearList = yearList;

            //可升级套餐
            List <SelectListItem> gradeList = new List <SelectListItem>()
            {
                new SelectListItem()
                {
                    Selected = true, Text = "请选择升级套餐", Value = "0"
                }
            };
            var enableGrade = _iShopService.GetShopGrades().Where(c => c.ChargeStandard >= grade.ChargeStandard && c.Id != shop.GradeId);//要排除自己

            foreach (var item in enableGrade)
            {
                gradeList.Add(new SelectListItem()
                {
                    Selected = false, Text = item.Name, Value = item.Id.ToString()
                });
            }

            ViewBag.GradeList = gradeList;
            ViewBag.HasOver   = shop.EndDate <= DateTime.Now;
            var shopAccount = ShopApplication.GetShopAccount(CurrentSellerManager.ShopId);

            ViewBag.ShopAccountAmount = shopAccount.Balance.ToString("F2");

            return(View(model));
        }
Example #4
0
        public JsonResult AccountBalancePay(decimal balance)
        {
            if (balance <= 0)
            {
                return(Json(new Result()
                {
                    success = false, msg = "应缴金额不正确"
                }));
            }

            var shopAccount = ShopApplication.GetShopAccount(CurrentSellerManager.ShopId);

            if (shopAccount == null)
            {
                return(Json(new Result()
                {
                    success = false, msg = "店铺账户信息异常"
                }));
            }

            if (shopAccount.Balance < balance) //店铺余额不足以支付费用
            {
                return(Json(new Result()
                {
                    success = false, msg = "您的店铺余额为:" + shopAccount.Balance + "元,不足以支付此次费用,请先充值。"
                }));
            }

            var userName       = CurrentSellerManager.UserName;
            var shopId         = CurrentSellerManager.ShopId;
            var accountService = _iCashDepositsService;

            if (accountService.ShopAccountRecord(shopId, balance, "充值保证金", ""))
            {
                Entities.CashDepositDetailInfo model = new Entities.CashDepositDetailInfo();

                model.AddDate     = DateTime.Now;
                model.Balance     = balance;
                model.Description = "充值";
                model.Operator    = userName;

                var list = new List <Entities.CashDepositDetailInfo>();
                list.Add(model);
                if (accountService.GetCashDepositByShopId(shopId) == null)
                {
                    var cashDeposit = new Entities.CashDepositInfo()
                    {
                        CurrentBalance = balance,
                        Date           = DateTime.Now,
                        ShopId         = shopId,
                        TotalBalance   = balance,
                        EnableLabels   = true,
                    };
                    accountService.AddCashDeposit(cashDeposit, list);
                }
                else
                {
                    model.CashDepositId = accountService.GetCashDepositByShopId(shopId).Id;
                    _iCashDepositsService.AddCashDepositDetails(model);
                }
            }
            return(Json(new Result()
            {
                success = true
            }));
        }