Example #1
0
        public ActionResult Index(MessageOpenMechanismCondition condition)
        {
            var MessageOpen = service.SearchNews(condition);
            var models      = new PagedList <MessageOpenMechanismInfo>(MessageOpen, MessageOpen.Paging);

            return(View(PluginHelper.GetViewPath(this.GetType(), "Index"), models));
        }
        public IPagedList <MessageOpenMechanismInfo> SearchNews(MessageOpenMechanismCondition condition)
        {
            var query = repository.Table;

            if (condition.Id != null)
            {
                query = query.Where(t => t.Id == condition.Id);
            }

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

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