/// <summary> /// 获取广告信息 /// </summary> /// <returns></returns> 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; int count = 0; var adInfoList = AdvertisementServices.QueryByBeginPage(pageIndex, pageSize, out totalCount, r => true, r => r.Createdate, false); var temp = from u in adInfoList select new { count = count += 1, ID = u.Id, Title = u.Title, ImgUrl = u.ImgUrl, Createdate = u.Createdate, url = u.Url, Remark = u.Remark }; return(Json(new { data = temp.ToList(), draw = draw, recordsTotal = totalCount, recordsFiltered = totalCount }, JsonRequestBehavior.AllowGet)); }