コード例 #1
0
        public JsonResult GetArticleCategory(long id)
        {
            var articleCategory = _iArticleCategoryService.GetArticleCategory(id);
            var model           = new { id = id, name = articleCategory.Name, parentId = articleCategory.ParentCategoryId };

            return(Json(model));
        }
コード例 #2
0
        //



        private IResult CheckArticleCategoryExist(long categoryId)
        {
            var category = _articleCategoryService.GetArticleCategory(categoryId).Data;

            if (category == null)
            {
                return(new ErrorResult(Message.ArticleCategoryNotFound));
            }

            return(new SuccessResult());
        }
コード例 #3
0
        private string GetCateNameBySecond(long id)
        {
            var pid = _iArticleCategoryService.GetCategories().FirstOrDefault(c => c.Id.Equals(id)).ParentCategoryId;

            return(_iArticleCategoryService.GetArticleCategory(pid).Name);
        }