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)); }
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)); }