コード例 #1
0
        public ActionResult Index(SystemMessageInfoCondition condition)
        {
            var news   = service.SearchAllSystemMessageInfo(condition);
            var models = new PagedList <SystemMessageInfo>(news, news.Paging);

            return(View(PluginHelper.GetViewPath(this.GetType(), "Index"), models));
        }
コード例 #2
0
        public IPagedList <SystemMessageInfo> SearchAllSystemMessageInfo(SystemMessageInfoCondition condition)
        {
            var query = repository.Table;

            if (!string.IsNullOrEmpty(condition.Title))
            {
                query = query.Where(t => t.Title.Contains(condition.Title));
            }



            query = query.Where(t => t.IsDelete == false);
            query = query.OrderByDescending(t => t.CreateDate);

            return(new PagedList <SystemMessageInfo>(query, condition.PageIndex, condition.PageSize));
        }