Example #1
0
        public JsonResult List(PagingRequest pg)
        {
            var res = new PagingReply();

            res.iTotalRecords = NoticeService.GetNoticeCount(pg.sSearch);
            if (res.iTotalRecords > 0)
            {
                var entitys = NoticeService.GetNotices(pg.iDisplayStart, pg.iDisplayLength, pg.sSearch);
                res.aaData = entitys.Select(ct => new object[] { ct.Title, ct.NoticeType == 1?"曝光台":"网站公告", ct.AddTime.ToString(), ct.Id }).ToList();
            }
            res.iTotalDisplayRecords = res.iTotalRecords;
            res.sEcho = pg.sEcho.ToString();

            return(Json(res));
        }