public JsonResult GetArticleCategories(long parentId)
        {
            var articleCategories = _iArticleCategoryService.GetArticleCategoriesByParentId(parentId);
            var models            = articleCategories.Select(item => new ArticleCategoryModel()
            {
                Id = item.Id, Name = item.Name, DisplaySequence = item.DisplaySequence, HasChild = false, Depth = 2
            }).ToList();
            var service = _iArticleCategoryService;

            foreach (var model in models)
            {
                model.HasChild = service.GetArticleCategoriesByParentId(model.Id, false).Count() > 0;
            }
            return(Json(models));
        }
Ejemplo n.º 2
0
        public ActionResult Foot()
        {
            IArticleCategoryService articleCategoryService = ServiceHelper.Create <IArticleCategoryService>();
            IArticleService         articleService         = ServiceHelper.Create <IArticleService>();
            ArticleCategoryInfo     specialArticleCategory = articleCategoryService.GetSpecialArticleCategory(SpecialCategory.PageFootService);

            if (specialArticleCategory == null)
            {
                return(base.PartialView("~/Areas/Web/Views/Shared/Foot.cshtml"));
            }
            IQueryable <ArticleCategoryInfo>   articleCategoriesByParentId = articleCategoryService.GetArticleCategoriesByParentId(specialArticleCategory.Id, false);
            IEnumerable <PageFootServiceModel> array =
                from item in articleCategoriesByParentId.ToArray()
                select new PageFootServiceModel()
            {
                CateogryName = item.Name,
                Articles     =
                    from t in articleService.GetArticleByArticleCategoryId(item.Id)
                    where t.IsRelease
                    select t
            };

            ViewBag.PageFootService = array;
            ViewBag.PageFoot        = base.CurrentSiteSetting.PageFoot;
            ViewBag.QRCode          = base.CurrentSiteSetting.QRCode;
            ViewBag.SiteName        = base.CurrentSiteSetting.SiteName;
            return(base.PartialView("~/Areas/Web/Views/Shared/Foot.cshtml"));
        }
Ejemplo n.º 3
0
        public ActionResult Management()
        {
            IArticleCategoryService          articleCategoryService      = ServiceHelper.Create <IArticleCategoryService>();
            IQueryable <ArticleCategoryInfo> articleCategoriesByParentId = articleCategoryService.GetArticleCategoriesByParentId(0, false);

            ArticleCategoryModel[] array = (
                from item in articleCategoriesByParentId.ToArray()
                select new ArticleCategoryModel()
            {
                ParentId = item.ParentCategoryId,
                Name = item.Name,
                DisplaySequence = item.DisplaySequence,
                Id = item.Id,
                IsDefault = item.IsDefault
            }).ToArray();
            ArticleCategoryModel[] articleCategoryModelArray = array;
            for (int i = 0; i < articleCategoryModelArray.Length; i++)
            {
                ArticleCategoryModel articleCategoryModel = articleCategoryModelArray[i];
                articleCategoryModel.HasChild = articleCategoryService.GetArticleCategoriesByParentId(articleCategoryModel.Id, false).Count() > 0;
            }
            return(View(array));
        }
Ejemplo n.º 4
0
        public ActionResult Foot()
        {
            IArticleCategoryService articleCategoryService = ServiceHelper.Create <IArticleCategoryService>();
            IArticleService         articleService         = ServiceHelper.Create <IArticleService>();
            ArticleCategoryInfo     specialArticleCategory = articleCategoryService.GetSpecialArticleCategory(27);

            if (specialArticleCategory == null)
            {
                return(base.PartialView("~/Areas/Web/Views/Shared/Foot.cshtml"));
            }
            IQueryable <ArticleCategoryInfo>   articleCategoriesByParentId = articleCategoryService.GetArticleCategoriesByParentId(specialArticleCategory.Id, false);
            IEnumerable <PageFootServiceModel> array =
                from item in articleCategoriesByParentId.ToArray()
                select new PageFootServiceModel()
            {
                CateogryName = item.Name,
                Articles     =
                    from t in articleService.GetArticleByArticleCategoryId(item.Id)
                    where t.IsRelease
                    select t
            };

            ChemCloud.Service.SiteSettingService a = new ChemCloud.Service.SiteSettingService();
            ViewBag.MaterialsMallURL          = a.GetSiteValue("MaterialMallURL");
            ViewBag.DiscuzURL                 = a.GetSiteValue("BBSURL");
            ViewBag.isShowHaoCai              = a.GetSiteValue("isShowHaoCai");
            ViewBag.isShowHuiYiZhongXin       = a.GetSiteValue("isShowHuiYiZhongXin");
            ViewBag.isShowDaShujuZhongXin     = a.GetSiteValue("isShowDaShujuZhongXin");
            ViewBag.isShowJiShuJiaoYiZhongXin = a.GetSiteValue("isShowJiShuJiaoYiZhongXin");
            ViewBag.isShowRenCaiShiChang      = a.GetSiteValue("isShowRenCaiShiChang");
            ViewBag.isShowLunTan              = a.GetSiteValue("isShowLunTan");
            ViewBag.isShowFaLvFaGui           = a.GetSiteValue("isShowFaLvFaGui");
            ViewBag.PlatCall        = a.GetSiteValue("PlatCall");
            ViewBag.PageFootService = array;
            ViewBag.PageFoot        = base.CurrentSiteSetting.PageFoot;
            ViewBag.QRCode          = base.CurrentSiteSetting.QRCode;
            ViewBag.SiteName        = base.CurrentSiteSetting.SiteName;
            return(base.PartialView("~/Areas/Web/Views/Shared/Foot.cshtml"));
        }
Ejemplo n.º 5
0
        public JsonResult GetFoot()
        {
            IArticleCategoryService articleCategoryService = ServiceHelper.Create <IArticleCategoryService>();
            IArticleService         articleService         = ServiceHelper.Create <IArticleService>();
            ArticleCategoryInfo     specialArticleCategory = articleCategoryService.GetSpecialArticleCategory(SpecialCategory.PageFootService);

            if (specialArticleCategory == null)
            {
                return(Json(new List <PageFootServiceModel>(), JsonRequestBehavior.AllowGet));
            }
            IQueryable <ArticleCategoryInfo>   articleCategoriesByParentId = articleCategoryService.GetArticleCategoriesByParentId(specialArticleCategory.Id, false);
            IEnumerable <PageFootServiceModel> array =
                from item in articleCategoriesByParentId.ToArray()
                select new PageFootServiceModel()
            {
                CateogryName = item.Name,
                Articles     =
                    from t in articleService.GetArticleByArticleCategoryId(item.Id)
                    where t.IsRelease
                    select t
            };

            return(Json(array, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 6
0
        public JsonResult GetArticleCategories(long parentId)
        {
            IQueryable <ArticleCategoryInfo> articleCategoriesByParentId = ServiceHelper.Create <IArticleCategoryService>().GetArticleCategoriesByParentId(parentId, false);

            ArticleCategoryModel[] array = (
                from item in articleCategoriesByParentId
                select new ArticleCategoryModel()
            {
                Id = item.Id,
                Name = item.Name,
                DisplaySequence = item.DisplaySequence,
                HasChild = false,
                Depth = 2
            }).ToArray();
            IArticleCategoryService articleCategoryService = ServiceHelper.Create <IArticleCategoryService>();

            ArticleCategoryModel[] articleCategoryModelArray = array;
            for (int i = 0; i < articleCategoryModelArray.Length; i++)
            {
                ArticleCategoryModel articleCategoryModel = articleCategoryModelArray[i];
                articleCategoryModel.HasChild = articleCategoryService.GetArticleCategoriesByParentId(articleCategoryModel.Id, false).Count() > 0;
            }
            return(Json(array));
        }