Exemplo n.º 1
0
        public ActionResult GetData()
        {
            int pageIndex = Request["start"] != null?int.Parse(Request["start"]) : 1;

            int pageSize = Request["length"] != null?int.Parse(Request["length"]) : 5;

            int draw = Request["draw"] != null?int.Parse(Request["draw"]) : 1;

            int totalCount;
            var userInfoList = TopicServive.QueryByBeginPage <int>(pageIndex, pageSize, out totalCount, r => !r.tIsDelete, r => r.Id, true);
            var temp         = from u in userInfoList
                               select new { ID = u.Id, bsubmitter = u.tAuthor, btitle = u.tName, bcategory = u.tDetail, subtime = u.tCreatetime, Remark = u.tLogo };
            var jsonDataTemp = new
            {
                data            = temp.ToList(),
                draw            = draw,
                recordsTotal    = totalCount,
                recordsFiltered = totalCount
            };

            return(Json(jsonDataTemp, JsonRequestBehavior.AllowGet));
        }