Example #1
0
        public ActionResult Renew()
        {
            //诊所当前信息
            ShopRenewModel model = new ShopRenewModel();

            model.ShopId = CurrentSellerManager.ShopId;
            var oldShopInfo = _iShopService.GetSellerConsoleModel(CurrentSellerManager.ShopId);
            var shopInfo    = _iShopService.GetShop(CurrentSellerManager.ShopId);

            model.ShopName       = shopInfo.ShopName;
            model.ShopCreateTime = shopInfo.CreateDate.ToString("yyyy/MM/dd");
            model.ShopEndTime    = shopInfo.EndDate.HasValue ? shopInfo.EndDate.Value.ToString("yyyy/MM/dd") : string.Empty;
            model.GradeId        = shopInfo.GradeId;
            var shopGrade = _iShopService.GetShopGrades().Where(c => c.Id == shopInfo.GradeId).FirstOrDefault();

            model.GradeName    = shopGrade != null ? shopGrade.Name : string.Empty;
            model.ProductLimit = oldShopInfo.ProductLimit;
            model.ImageLimit   = (int)oldShopInfo.ImageLimit;

            //续费时间
            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 > shopGrade.ChargeStandard);

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

            ViewBag.GradeList = gradeList;
            ViewBag.HasOver   = shopInfo.EndDate.Value <= DateTime.Now;

            return(View(model));
        }
Example #2
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));
        }