Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }