public ActionResult Index(FormDownloadCondition condition) { var news = service.SearchFormDownload(condition); var models = new PagedList <FormDownload>(news, news.Paging); return(View(PluginHelper.GetViewPath(this.GetType(), "Index"), models)); }
public IPagedList <FormDownload> SearchFormDownload(FormDownloadCondition condition) { var query = repository.Table; if (!string.IsNullOrEmpty(condition.Title)) { query = query.Where(t => t.Title.Contains(condition.Title)); } if (condition.WorkType != null) { query = query.Where(t => t.WorkType == condition.WorkType); } query = query.Where(t => t.IsDelete == false); query = query.OrderByDescending(t => t.CreateDate); return(new PagedList <FormDownload>(query, condition.PageIndex, condition.PageSize)); }