Exemplo n.º 1
0
 public ListModel InitializeListModel(ArticleQueryItem queryItem)
 {
     var model = new ListModel();
     queryItem.UnitId = NpcMainWebContext.CurrentUnit.Id;
     model.ArticleQueryItem = queryItem;
     model.ArticleQueryItem.IsShow = true;
     model.Articles = _articleRepository.Query(queryItem).ToList();
     model.ListTitle = "文章列表";
     var categoryId = queryItem.CategoryId ?? queryItem.CategoryIdLike;
     if (categoryId.HasValue)
     {
         var category = _articleCategoryRepository.Find(categoryId.Value);
         if (category != null)
             model.ListTitle = category.CategoryName;
     }
     model.ArticleQueryItem = queryItem;
     return model;
 }
Exemplo n.º 2
0
 public ListModel()
 {
     ArticleQueryItem=new ArticleQueryItem();
 }
Exemplo n.º 3
0
 public ArtilceSearchModel()
 {
     ArticleQueryItem = new ArticleQueryItem();
 }