/// <summary> /// 公告列表 /// </summary> /// <param name="search">查询信息</param> /// <returns></returns> public ActionResult List([FromQuery] SearchHelperModel search) { Expression <Func <Notice, bool> > whereExpression = (n => true); if (!string.IsNullOrEmpty(search.SearchItem1)) { whereExpression = n => n.NoticeTitle.Contains(search.SearchItem1); } try { var list = _bLLNotice.Paged(search.PageIndex, search.PageSize, whereExpression, n => n.NoticePublishTime, false); return(View(list.ToPagedList())); } catch (Exception ex) { Logger.Error(ex); throw; } }
/// <summary> /// 公告列表 /// </summary> /// <param name="search">查询信息</param> /// <returns></returns> public ActionResult List(SearchHelperModel search) { Expression <Func <Notice, bool> > whereLamdba = (n => n.IsDeleted == false); if (!string.IsNullOrEmpty(search.SearchItem1)) { whereLamdba = n => n.IsDeleted == false && n.NoticeTitle.Contains(search.SearchItem1); } try { var list = _bLLNotice.Paged(search.PageIndex, search.PageSize, whereLamdba, n => n.NoticePublishTime, false); return(View(list.Data.ToPagedList(search.PageIndex, search.PageSize, list.TotalCount))); } catch (Exception ex) { Logger.Error(ex); throw; } }