Ejemplo n.º 1
0
        /// <summary>
        /// 公告列表
        /// </summary>
        /// <returns></returns>
        public async Task <ActionResult> NoticeList(SearchHelperModel search, [FromServices] IBLLNotice noticeService)
        {
            Expression <Func <Notice, bool> > whereExpression = (n => !n.IsDeleted && n.CheckStatus);

            if (!string.IsNullOrEmpty(search.SearchItem1))
            {
                whereExpression = whereExpression.And(n => n.NoticeTitle.Contains(search.SearchItem1.Trim()));
            }
            try
            {
                var noticeList = await noticeService.PagedAsync(search.PageIndex, search.PageSize, whereExpression,
                                                                n => n.NoticePublishTime, false);

                var data = noticeList.ToPagedList();
                return(View(data));
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                return(View(PagedListResult <Notice> .Empty.ToPagedList()));
            }
        }
Ejemplo n.º 2
0
 public NoticeController(ILogger <NoticeController> logger, OperLogHelper operLogHelper, IBLLNotice bLLNotice) : base(logger, operLogHelper)
 {
     _bLLNotice = bLLNotice;
 }