Пример #1
0
        public ActionResult Add(long?id, string name, long parentId)
        {
            ArticleCategoryInfo articleCategoryInfo = new ArticleCategoryInfo()
            {
                Id               = id.GetValueOrDefault(),
                Name             = name,
                ParentCategoryId = parentId
            };
            ArticleCategoryInfo     articleCategoryInfo1   = articleCategoryInfo;
            IArticleCategoryService articleCategoryService = ServiceHelper.Create <IArticleCategoryService>();

            if (articleCategoryService.CheckHaveRename(articleCategoryInfo1.Id, articleCategoryInfo1.Name))
            {
                return(Json(new { success = false, msg = "不可添加、修改为同名栏目!" }));
            }
            long?nullable = id;

            if ((nullable.GetValueOrDefault() <= 0 ? true : !nullable.HasValue))
            {
                articleCategoryService.AddArticleCategory(articleCategoryInfo1);
            }
            else
            {
                articleCategoryService.UpdateArticleCategory(articleCategoryInfo1);
            }
            return(Json(new { success = true }));
        }
        public ProductPartialController(
            IMemberIntegralService iMemberIntegralService,
            IProductService iProductService,
            ICouponService iCouponService,
            IShopBonusService iShopBonusService,
            IArticleService iArticleService,
            IArticleCategoryService iArticleCategoryService,
            INavigationService iNavigationService,
            IHomeCategoryService iHomeCategoryService,
            IBrandService iBrandService,
            ICategoryService iCategoryService,
            ICustomerService iCustomerService,
            ISlideAdsService iSlideAdsService

            )
        {
            _iMemberIntegralService  = iMemberIntegralService;
            _iProductService         = iProductService;
            _iCouponService          = iCouponService;
            _iShopBonusService       = iShopBonusService;
            _iArticleService         = iArticleService;
            _iArticleCategoryService = iArticleCategoryService;
            _iNavigationService      = iNavigationService;
            _iHomeCategoryService    = iHomeCategoryService;
            _iBrandService           = iBrandService;
            _iCategoryService        = iCategoryService;
            _iCustomerService        = iCustomerService;
            _iSlideAdsService        = iSlideAdsService;
        }
Пример #3
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"));
        }
Пример #4
0
 public AjaxController(IBaseRepository <Article> articleRep, IUnitOfWork unitOfWork, IArticleService articleService, IArticleCategoryService articleCategoryService)
 {
     _articleRep             = articleRep;
     _unitOfWork             = unitOfWork;
     _articleService         = articleService;
     _articleCategoryService = articleCategoryService;
 }
Пример #5
0
        public static string GetCategoryBreadCrumb(this ArticleCategory category, IArticleCategoryService categoryService, IDictionary <int, ArticleCategory> mappedCategories = null)
        {
            string result = string.Empty;

            while (category != null && !category.Deleted)
            {
                // codehint: sm-edit
                if (String.IsNullOrEmpty(result))
                {
                    result = category.GetFullCategoryName();
                }
                else
                {
                    result = category.GetFullCategoryName() + " >> " + result;
                }

                int parentId = category.ParentCategoryId;
                if (mappedCategories == null)
                {
                    category = categoryService.GetArticleCategoryById(parentId);
                }
                else
                {
                    category = mappedCategories.ContainsKey(parentId) ? mappedCategories[parentId] : categoryService.GetArticleCategoryById(parentId);
                }
            }

            return(result);
        }
Пример #6
0
 public CreateModel(
     IArticleService articleService,
     IArticleCategoryService articleCategoryService)
 {
     _articleService         = articleService;
     _articleCategoryService = articleCategoryService;
 }
Пример #7
0
 public HomeController(IQuickLinkService quickLinkService, IUnitOfWorkAsync unitOfWork, IArticleService articleService, IArticleCategoryService articleCategoryService)
 {
     this.quickLinkService = quickLinkService;
     this.articleService = articleService;
     this.unitOfWork = unitOfWork;
     this.articleCategoryService = articleCategoryService;
 }
 public ArticleCategoryController(IArticleCategoryService articleCategoryService,
                                  IHttpContextAccessor httpContextAccessor, IHttpHelper httpHelper, IOptions <PagerOptions> pagerOptions)
     : base(httpContextAccessor)
 {
     _httpHelper             = httpHelper;
     _articleCategoryService = articleCategoryService;
     _pagerOptions           = pagerOptions.Value;
 }
Пример #9
0
 public ArticlesController(
     BlogContext context,
     IArticleCategoryService articleCategoryService
     )
 {
     _context = context;
     _articleCategoryService = articleCategoryService;
 }
Пример #10
0
 /// <summary>
 /// 获取文章分类
 /// </summary>
 /// <param name="parentId"></param>
 /// <returns></returns>
 public List <ListItem> GetArticleCateList(IArticleCategoryService articleCategoryService, string currentId, string parentId, bool containsChild = false)
 {
     if (articleCategoryService == null)
     {
         articleCategoryService = CoreContextProvider.GetService <IArticleCategoryService>();
     }
     return(articleCategoryService.GetCateList(currentId, parentId, containsChild));
 }
Пример #11
0
 public ArticleController(IArticleService bll, IArticleCategoryService catBll, IArticle_CategoryService art_catBll)
 {
     if (bll != null)
     {
         this.bll        = bll;
         this.catBll     = catBll;
         this.art_catBll = art_catBll;
     }
 }
Пример #12
0
 public ArticleCategoryController(
     IArticleCategoryService articleCategoryService,
     IWebHostEnvironment webHostEnvironment,
     IHubContext <HubClient, IHubClient> hubContext)
 {
     _articleCategoryService = articleCategoryService;
     _webHostEnvironment     = webHostEnvironment;
     _hubContext             = hubContext;
 }
Пример #13
0
 //DI
 public ArticleManager(IProjectUnitOfWork uow, IAuthService authService,
                       IUserHistoryService userHistoryService, IArticleCategoryService articleCategoryService,
                       IDocumentService documentService)
 {
     _uow                    = uow;
     _authService            = authService;
     _userHistoryService     = userHistoryService;
     _articleCategoryService = articleCategoryService;
     _documentService        = documentService;
 }
Пример #14
0
 public ArticleCategoryController(IArticleCategoryService articleCategoryService, ILogService logService,
                                  ISystemConfigurationService systemConfigurationService, IArticleAttachService articleAttachService,
                                  IArticleArticleCategoryService articleArticleCategoryService)
 {
     _articleCategoryService        = articleCategoryService;
     _logService                    = logService;
     _systemConfigurationService    = systemConfigurationService;
     _articleAttachService          = articleAttachService;
     _articleArticleCategoryService = articleArticleCategoryService;
 }
Пример #15
0
 public RoleController(IRoleService roleService, ILogService logService, ISystemConfigurationService systemConfigurationService,
                       INavgationService navgationService, IArticleCategoryService articleCategoryService, IActionService actionService, IUserRoleService userRoleService)
 {
     _navgationService           = navgationService;
     _roleService                = roleService;
     _logService                 = logService;
     _systemConfigurationService = systemConfigurationService;
     _articleCategoryService     = articleCategoryService;
     _actionService              = actionService;
     _userRoleService            = userRoleService;
 }
        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="cacheManager">Cache manager</param>
        /// <param name="articleCategoryMappingRepository">ArticleCategory mapping repository</param>
        public ArticleCategoryMappingService(ICacheManager cacheManager,
                                             IArticleCategoryService articleCategoryService,
                                             IRepository <ArticleCategoryMapping> articleCategoryMappingRepository)
        {
            this._cacheManager = cacheManager;

            this._articleCategoryService           = articleCategoryService;
            this._articleCategoryMappingRepository = articleCategoryMappingRepository;

            this.QuerySettings = DbQuerySettings.Default;
        }
        public IActionResult Index([FromServices] IArticleTopicService topicService, [FromServices] IArticleCategoryService articleCategoryService)
        {
            AddPageCrumbs("资源分类");
            var cateList = articleCategoryService.GetCateList(null, null, true);

            //var topicService = SkyCore.GlobalProvider.CoreContextProvider.GetService<IArticleTopicService>();
            ViewBag.TopicCates = topicService.GetTopicCateList(null, null);
            ViewBag.HotTopics  = topicService.GetTopicInfoList(new ArticleTopicSearchView {
                HotTopic = true, TopicStatus = TopicStatus.Audited, IgnoreCate = true
            }, 1, 3);
            return(View(cateList));
        }
Пример #18
0
 public ArticleService(ISysLogRespository sysLogRespository, IArticleRespository respository,
                       IArticleCategoryRespository articleCategoryRespository, IMemberRespository memberService,
                       IArticleCategoryService articleCategoryService
                       )
 {
     _LogRespository             = sysLogRespository;
     _Respository                = respository;
     _ArticleCategoryRespository = articleCategoryRespository;
     _IMemberRespository         = memberService;
     _IArticleCategoryService    = articleCategoryService;
     _logger = CoreContextProvider.GetLogger("ArticleService");
 }
Пример #19
0
 public ArticleController(IArticleService articleService,
                          IArticleTagService articleTagService,
                          ITagService tagService,
                          IOptions <AppSettingsModel> appSettings,
                          IArticleCategoryService articleCategoryService
                          )
 {
     _articleService         = articleService;
     _articleTagService      = articleTagService;
     _tagService             = tagService;
     _appSettings            = appSettings;
     _articleCategoryService = articleCategoryService;
 }
Пример #20
0
 public ArticleService(IUnitOfWork uow,
                       IArticleRepository articleRepository,
                       IArticleTagRepository articleTagRepository,
                       IArticleTagService articleTagService,
                       IArticleCategoryService articleCategoryService,
                       ITagRepository tagRepository, IUrlHelper urlHelper)
     : base(articleRepository)
 {
     _articleRepository      = articleRepository;
     _articleTagRepository   = articleTagRepository;
     _articleTagService      = articleTagService;
     _tagRepository          = tagRepository;
     _articleCategoryService = articleCategoryService;
     _unitOfWork             = uow;
     _urlHelper = urlHelper;
 }
Пример #21
0
 public ArticleCategoryController(
     IModelTemplateService modelTemplateService,
     ILocalizationService localizationService,
     ILocalizedEntityService localizedEntityService,
     IUserService userService,
     UserSettings userSettings,
     IArticleCategoryService categoryService,
     IUrlRecordService urlRecordService,
     ILanguageService languageService,
     IPictureService pictureService,
     IAclService aclService,
     IUserActivityService userActivityService,
     ISiteService siteService, ISiteMappingService siteMappingService,
     IDateTimeHelper dateTimeHelper,
     IEventPublisher eventPublisher,
     ArticleCatalogSettings catalogSettings,
     IPermissionService permissionService,
     IChannelService channelService,
     IWorkContext workContext,
     ISiteContext siteContext,
     SiteInformationSettings siteSettings)
 {
     this._modelTemplateService   = modelTemplateService;
     this._categoryService        = categoryService;
     this._localizedEntityService = localizedEntityService;
     this._urlRecordService       = urlRecordService;
     this._localizationService    = localizationService;
     this._userService            = userService;
     this._userSettings           = userSettings;
     this._userActivityService    = userActivityService;
     this._aclService             = aclService;
     this._languageService        = languageService;
     this._pictureService         = pictureService;
     this._siteService            = siteService;
     this._siteMappingService     = siteMappingService;
     this._dateTimeHelper         = dateTimeHelper;
     this._eventPublisher         = eventPublisher;
     this._workContext            = workContext;
     this._catalogSettings        = catalogSettings;
     this._permissionService      = permissionService;
     this._channelService         = channelService;
     this._siteContext            = siteContext;
     this._siteSettings           = siteSettings;
 }
Пример #22
0
 public HomeController(
     IMemberService iMemberService,
     ISlideAdsService iSlideAdsService,
     IFloorService iFloorService,
     IArticleCategoryService iArticleCategoryService,
     IArticleService iArticleService,
     IBrandService iBrandService,
     ILimitTimeBuyService iLimitTimeBuyService,
     IShopBonusService iShopBonusService)
 {
     _iMemberService          = iMemberService;
     _iSlideAdsService        = iSlideAdsService;
     _iFloorService           = iFloorService;
     _iArticleCategoryService = iArticleCategoryService;
     _iArticleService         = iArticleService;
     _iBrandService           = iBrandService;
     _iLimitTimeBuyService    = iLimitTimeBuyService;
     _iShopBonusService       = iShopBonusService;
 }
Пример #23
0
        //首页
        public IActionResult Index([FromServices] IArticleTopicService articleTopicService,
                                   [FromServices] IHelpService helpService, [FromServices] INewsService newsService
                                   , [FromServices] ILinkService linkService, [FromServices] IArticleCategoryService articleCategoryService)
        {
            ViewBag.TodayArticles = _ArticleService.GetTopArticles(ArticleTopEnum.HotArticle, 10);
            ViewBag.NewArticles   = _ArticleService.GetTopArticles(ArticleTopEnum.NewArticle, 10);

            ViewBag.HotTopics = articleTopicService.GetHotTopics(8);

            ViewBag.BestCates = articleCategoryService.GetCateList(new ArticleCateSearchView {
                IsRemmand = true
            }, 1, 6);

            var tradeScores = _IMemberScoreService.GetList(true, 5);

            ViewBag.TradeScores = tradeScores;
            //PPT
            ViewBag.HotPPT = _ArticleService.GetTopArticles(ArticleTopEnum.HotPPT, 18, null);
            ViewBag.NewPPT = _ArticleService.GetTopArticles(ArticleTopEnum.NewPPT, 18, null);

            //轮播图
            ViewBag.HomeCarousels = helpService.GetHelps(new HelpSearchView()
            {
                HelpCode = HelpCode.HomeCarousel
            }, 1, 10).ToList();
            //公告
            ViewBag.Announcements = newsService
                                    .GetTopNewss(NewsTopEnum.Announcement, 5).ToList();
            //资源总数量
            var totalData = _ArticleService.GetTotalBooks();

            ViewBag.TotalBooks = totalData;


            //友情链接
            ViewBag.FriendLinks = linkService.GetList();


            return(View());
        }
Пример #24
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"));
        }
Пример #25
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));
        }
Пример #26
0
        public ArticleCatalogController(
            ICommonServices services,
            IClientService clientService,
            IArticleCategoryService articlecategoryService,
            IModelTemplateService modelTemplateService,
            IArticleService articleService, IArticleTagService articlesTagService,
            IPictureService pictureService,
            IGenericAttributeService genericAttributeService,
            IAclService aclService,
            ISiteMappingService siteMappingService,
            MediaSettings mediaSettings,
            ArticleCatalogSettings catalogSettings,
            IRecentlyViewedArticlesService recentlyViewedArticlesService,
            //IFilterService filterService,
            ArticleCatalogHelper helper,
            Lazy <ISearchProvider> searchProvider
            )
        {
            this._services                      = services;
            this._clientService                 = clientService;
            this._articlecategoryService        = articlecategoryService;
            this._articleService                = articleService;
            this._articlesTagService            = articlesTagService;
            this._modelTemplateService          = modelTemplateService;
            this._pictureService                = pictureService;
            this._genericAttributeService       = genericAttributeService;
            this._aclService                    = aclService;
            this._siteMappingService            = siteMappingService;
            this._recentlyViewedArticlesService = recentlyViewedArticlesService;
            //this._filterService = filterService;
            this._mediaSettings   = mediaSettings;
            this._catalogSettings = catalogSettings;

            this._helper         = helper;
            this._searchProvider = searchProvider;
            T = NullLocalizer.Instance;
        }
Пример #27
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));
        }
Пример #28
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));
        }
 public ArticleCategoryViewComponent(IArticleCategoryService articleCategoryService)
 {
     _articleCategoryService = articleCategoryService;
 }
Пример #30
0
 public ArticlesController(IArticleCategoryService categoryService, IArticleService articleService)
 {
     _categoryService = categoryService;
     _articleService  = articleService;
 }
 public ArticleCategoryController(IArticleCategoryService articlecategoryService)
 {
     _articlecategoryService = articlecategoryService;
 }
Пример #32
0
 //private readonly IArticleTagsService _articleTagsService;
 public ArticleController(IArticleInfoService articleInfoService, IArticleCategoryService articleCategoryService, IArticleTagsService articleTagsService)
 {
     _articleInfoService     = articleInfoService;
     _articleCategoryService = articleCategoryService;
     _articleTagsService     = articleTagsService;
 }
 public CategoryController(IUserService usersService, IArticleCategoryService categoryService)
     :base(usersService)
 {
     this.categoryService = categoryService;
 }
Пример #34
0
 public ArticleCategoryController(IArticleCategoryService categoryService)
 {
     this.categoryService = categoryService;
 }