예제 #1
0
        public ArticlePageViewModel CreateEventListModel(ArticlePageViewModel articlePageViewModel)
        {
            ArticlePageViewModel articleDetailModel = new ArticlePageViewModel();
            ArticleBll           acBll = new ArticleBll();

            articleDetailModel.page_size        = 20;
            articleDetailModel.page_index       = articlePageViewModel.page_index;
            articleDetailModel.articleRightList = acBll.GetEventPageList(new ArticlePageViewModel {
                article_state = 1, page_index = 1, page_size = 15, category_id = articlePageViewModel.category_id
            });
            articleDetailModel.category_id     = articlePageViewModel.category_id;
            articleDetailModel.articlePageList = acBll.GetEventPageList(articleDetailModel);

            ArticleCategoryBll categoryBll = new ArticleCategoryBll();

            articleDetailModel.ThisArticleCategory = categoryBll.GetCategory(new ArticleCategory {
                category_id = articlePageViewModel.ThisArticleCategory.category_id
            });
            articleDetailModel.ThisArticleFatherCategory = categoryBll.GetCategory(new ArticleCategory {
                category_id = articlePageViewModel.ThisArticleCategory.category_father_id
            });
            articleDetailModel.ArticleCategoryList = categoryBll.GetCategoryList(new ArticleCategory {
                category_father_id = articleDetailModel.ThisArticleCategory.category_father_id
            });
            return(articleDetailModel);
        }
예제 #2
0
        public IEnumerable <Article> GetArticleByFatherCategory(string father_category_code, int number)
        {
            ArticleCategoryBll articleCategoryBll = new ArticleCategoryBll();
            Article            article            = new Article();

            article.category_id   = articleCategoryBll.GetCategoryIdByCode(father_category_code);
            article.article_state = 1;
            var articleList = articleDao.Select(article, number).ToList();//获取网站公告

            articleList.ForEach(t => t.category_name     = acdBll.GetCategory(t.category_id).category_name);
            articleList.ForEach(t => t.article_click_url = string.IsNullOrEmpty(t.article_click_url) ? "/article/article_" + t.article_id + ".html" : t.article_click_url);
            return(articleList);
        }
예제 #3
0
        public ArticlePageViewModel CreateArticleDetailModel(int article_id, int type = 0)
        {
            ArticlePageViewModel articleDetailModel = new ArticlePageViewModel();

            try
            {
                ArticleBll acBll = new ArticleBll();
                Article    ac    = new Article();
                ac.article_id = article_id;
                Article acNew = acBll.GetArticle(ac);

                articleDetailModel.articleModel = acNew;

                ArticleCategoryBll acateBll = new ArticleCategoryBll();
                articleDetailModel.ThisArticleCategory       = acBll.GetArticleCategoryByArticle(article_id);
                articleDetailModel.ThisArticleFatherCategory = acBll.GetArticleFatherCategoryByArticle(article_id);
                if (0 == type)
                {
                    articleDetailModel.articleRightList = acBll.GetArticlePageList(new ArticlePageViewModel {
                        category_id = acNew.category_id, article_state = 1, page_index = 1, page_size = 20
                    });
                }
                if (1 == type)
                {
                    articleDetailModel.articleRightList = acBll.GetEventArticlePageList(new ArticlePageViewModel {
                        category_id = acNew.category_id, article_state = 1, page_index = 1, page_size = 20
                    });
                }
                if (2 == type)
                {
                    articleDetailModel.articleRightList = acBll.GetZazhiArticlePageList(new ArticlePageViewModel {
                        category_id = acNew.category_id, article_state = 1, page_index = 1, page_size = 20
                    });
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(articleDetailModel);
        }
예제 #4
0
        public ArticlePageViewModel CreateArticleListModel(ArticlePageViewModel articlePageViewModel)
        {
            ArticlePageViewModel articleDetailModel = new ArticlePageViewModel();
            ArticleBll           acBll = new ArticleBll();

            articleDetailModel.page_size        = 20;
            articleDetailModel.page_index       = articlePageViewModel.page_index;
            articleDetailModel.articleRightList = acBll.GetArticlePageListOrderByNewId(new ArticlePageViewModel {
                article_state = 1, page_index = 1, page_size = 20
            });
            articleDetailModel.category_id     = articlePageViewModel.category_id;
            articleDetailModel.articlePageList = acBll.GetArticlePageList(articleDetailModel);

            ArticleCategoryBll categoryBll = new ArticleCategoryBll();

            articleDetailModel.ThisArticleCategory = categoryBll.GetCategory(new ArticleCategory {
                category_id = articlePageViewModel.ThisArticleCategory.category_id
            });
            articleDetailModel.ThisArticleFatherCategory = categoryBll.GetCategory(new ArticleCategory {
                category_id = articleDetailModel.ThisArticleCategory.category_father_id
            });

            articleDetailModel.ArticleCategoryList = categoryBll.GetCategoryList(new ArticleCategory {
                category_father_id = articleDetailModel.ThisArticleCategory.category_father_id
            });

            if (articleDetailModel.ThisArticleFatherCategory.category_level > 2)
            {
                //ArticleCategory acFather  =  categoryBll.GetCategory(new ArticleCategory { category_id = articleDetailModel.ThisArticleFatherCategory.category_father_id });
                articleDetailModel.FatherBrotherCategoryList = categoryBll.GetCategoryList(new ArticleCategory {
                    category_father_id = articleDetailModel.ThisArticleFatherCategory.category_father_id, category_level = 2, category_id = articleDetailModel.ThisArticleFatherCategory.category_id
                });
            }


            return(articleDetailModel);
        }
예제 #5
0
 public HomePageBll()
 {
     articleBll         = new ArticleBll();
     articleCategoryBll = new ArticleCategoryBll();
     acDao = new ArticleCategoryDao();
 }
예제 #6
0
 public ArticleBll()
 {
     articleDao = new ArticleDao();
     acdBll     = new ArticleCategoryBll();
 }