Example #1
0
        /// <summary>
        /// 诊所信息
        /// </summary>
        /// <param name="ids">经营类目ID集</param>
        /// <returns></returns>
        public ActionResult Step5(string ids)
        {
            Cache.Remove(CacheKeyCollection.CACHE_SHOP(CurrentSellerManager.ShopId, true));
            Cache.Remove(CacheKeyCollection.CACHE_SHOPDTO(CurrentSellerManager.ShopId, true));
            var shop = ShopApplication.GetShop(CurrentSellerManager.ShopId, true);

            if (shop.Stage == ShopInfo.ShopStage.CompanyInfo)
            {
                return(RedirectToAction("step3"));
            }
            if (shop.Stage == ShopInfo.ShopStage.FinancialInfo)
            {
                return(RedirectToAction("step4"));
            }

            var step3 = new ShopProfileStep3();

            step3.ShopName  = shop.ShopName;
            step3.ShopGrade = shop.GradeId;
            var gradeInfo = ShopApplication.GetShopGrade(shop.GradeId);

            ViewBag.GradeName            = gradeInfo != null ? gradeInfo.Name : "未选择";//获取等级名称
            ViewBag.ShopBusinessCategory = "未选择";
            ViewBag.BusinessCategoryIds  = string.Empty;
            if (!string.IsNullOrWhiteSpace(ids))
            {
                var idArr = ids.Split(',');
                if (idArr.Length > 0)
                {
                    List <long> idList         = idArr.Select(p => long.Parse(p)).ToList();
                    var         categoriesList = _iCategoryService.GetCategories().Where(p => idList.Contains(p.Id));
                    if (categoriesList.Count() == idArr.Length)
                    {
                        string businessCategory = string.Join("、", categoriesList.Select(x => x.Name).ToArray());
                        ViewBag.ShopBusinessCategory = businessCategory.Length > 0 ? businessCategory : "未选择";
                        ViewBag.BusinessCategoryIds  = ids;
                    }
                }
            }
            else
            {
                var businessCategoryInfo = ShopApplication.GetBusinessCategory(CurrentSellerManager.ShopId);
                if (businessCategoryInfo != null && businessCategoryInfo.Count > 0)
                {
                    List <long> categoryIds = businessCategoryInfo.Select(p => p.CategoryId).ToList();
                    ViewBag.BusinessCategoryIds = string.Join(",", categoryIds.ToArray());
                    string businessCategory = string.Join("、", _iCategoryService.GetCategories().Where(p => categoryIds.Contains(p.Id)).Select(x => x.Name).ToArray());
                    ViewBag.ShopBusinessCategory = businessCategory.Length > 0 ? businessCategory : "未选择";
                }
            }

            return(View(step3));
        }
        public ActionResult Step3()
        {
            ViewBag.ShopGrades     = ShopApplication.GetShopGrades();
            ViewBag.ShopCategories = _iCategoryService.GetMainCategory();
            ViewBag.Username       = CurrentSellerManager.UserName;

            var shop = ShopApplication.GetShop(CurrentSellerManager.ShopId, true);

            if (shop.Stage == Entities.ShopInfo.ShopStage.CompanyInfo)
            {
                return(RedirectToAction("step1"));
            }

            if (shop.Stage == Entities.ShopInfo.ShopStage.FinancialInfo)
            {
                return(RedirectToAction("step2"));
            }

            var BusinessCategory = new List <CategoryKeyVal>();

            foreach (var key in shop.BusinessCategory.Keys)
            {
                BusinessCategory.Add(new CategoryKeyVal
                {
                    CommisRate = shop.BusinessCategory[key],
                    Name       = _iCategoryService.GetCategory(key).Name
                });
            }
            var step3 = new ShopProfileStep3();

            step3.ShopName         = shop.ShopName;
            step3.ShopGrade        = shop.GradeId;
            step3.BusinessType     = shop.BusinessType == null ? Mall.CommonModel.ShopBusinessType.Enterprise : shop.BusinessType.Value;
            step3.BusinessCategory = ShopApplication.GetBusinessCategory(CurrentSellerManager.ShopId);

            return(View(step3));
        }