示例#1
0
 public IActionResult Index()
 {
     ViewBag.NewsList = ArticleContentDAL.Query(m => m.TypeID == 5, null, null).list.OrderBy(m => m.SortNum).Take(4).ToList();
     ViewBag.ZList    = ArticleContentDAL.Query(m => m.TypeID == 3 || m.TypeID == 4, null, null).list.OrderBy(m => m.SortNum).Take(4).ToList();
     ViewBag.Banner   = ArticleContentDAL.Query(m => m.TypeID == 7, null, null).list.ToList();
     return(View());
 }
示例#2
0
        public ReadWikiHepler()
        {
            _ArticleTypeDAL    = new ArticleTypeDAL();
            _ArticleContentDAL = new ArticleContentDAL();
            IsClearDataSync    = AppSettingsManager.Get("PathConfig:IsClearDataSync").ToLower() == "true" ? true : false;

            if (!IsClearDataSync)
            {
                ArticleTypeList    = _ArticleTypeDAL.Query(s => s.Id > 0).list;
                ArticleContentList = _ArticleContentDAL.Query(s => s.Id > 0).list;
            }
        }
示例#3
0
        public JsonResult ArticleContentList(int id, int page, int count)
        {
            var contentlist = ArticleContentDAL.Query(d => d.Status == 1 && d.TypeID == id, new List <SortInfo <ArticleContent, object> >
            {
                new SortInfo <ArticleContent, object> {
                    Orderby = s => s.SortNum, SortMethods = Entity.Enum.SortEnum.Asc
                }
            }, new Entity.Common.PageInfo {
                PageIndex = page, PageSize = count, IsPaging = true
            }).list.OrderBy(s => s.SortNum).ToList();

            return(Json(new { data = contentlist, total = contentlist.Count }));
        }
示例#4
0
        public IActionResult Index(int id, int page = 1, int count = 10)
        {
            var content = ArticleContentDAL.Query(d => d.Status == 1 && d.TypeID == id, new List <SortInfo <ArticleContent, object> >
            {
                new SortInfo <ArticleContent, object> {
                    Orderby = s => s.SortNum, SortMethods = Entity.Enum.SortEnum.Asc
                }
            }, new Entity.Common.PageInfo {
                PageIndex = page, PageSize = count, IsPaging = true
            });
            var contentlist  = content.list.OrderBy(s => s.SortNum).ToList();
            var contentcount = content.count;
            var type         = ArticleTypeDAL.GetByOne(d => d.Id == id);

            ViewBag.DocumentList  = contentlist;
            ViewData["ListCount"] = contentcount;
            ViewData["TypeID"]    = id;
            ViewData["TypeName"]  = type != null ? type.TypeName : string.Empty;
            ViewData["ShowType"]  = id == 6 ? "2" : id == 0 ? "3" : "1";
            return(View());
        }
示例#5
0
 public IActionResult Header()
 {
     ViewBag.pathUrl     = this.HttpContext.Request.Path.Value;
     ViewBag.ArticleList = ArticleContentDAL.Query(s => s.Status == 1, null, null);
     return(PartialView());
 }