public ActionResult getVideoPageData() { int pageSize = Request["pageSize"] == null ? 5 : int.Parse(Request["pageSize"]); int pageIndex = Request["pageIndex"] == null ? 1 : int.Parse(Request["pageIndex"]); int totalCount = _videoServer.GetList().Count(); var getPageList = _videoServer.GetPageList(pageIndex, pageSize, u => true, a => true, true); var userList = _userService.GetList(); //接受一个对像,内部把此对象使用javaScript序列化类对象志字符串,发送到前台 var data = from u in getPageList join t in userList on u.UpId equals t.Id orderby u.AddedDate select new Video { Id = u.Id, VideoName = u.VideoName, AddedDate = u.AddedDate, IsTop = u.IsTop, Category = u.Category, ThumbPath = u.ThumbPath, IsLocal = u.IsLocal, Recommend = u.Recommend, UpId = t.UserName }; string strNav = PagerHelper.ShowPageNavigate(pageIndex, pageSize, totalCount); var result = new { Data = data, NavStr = strNav }; countNow = pageIndex; return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult getPageData() { int pageSize = Request["pageSize"] == null ? 3 : int.Parse(Request["pageSize"]); int pageIndex = Request["pageIndex"] == null ? 1 : int.Parse(Request["pageIndex"]); int totalCount = _newsService.GetList().Count(); var getPageList = _newsService.GetPageList(pageIndex, pageSize, u => true, a => true, true); //接受一个对像,内部把此对象使用javaScript序列化类对象志字符串,发送到前台 var data = from u in getPageList select new { u.Id, u.NewsTitle, u.AddedDate, u.CommentNum, u.ViewTimes, u.NewsContent }; string strNav = PagerHelper.ShowPageNavigate(pageIndex, pageSize, totalCount); var result = new { Data = data, NavStr = strNav }; return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult getLogPageData() { int pageSize = Request["pageSize"] == null ? 5 : int.Parse(Request["pageSize"]); int pageIndex = Request["pageIndex"] == null ? 1 : int.Parse(Request["pageIndex"]); int totalCount = _logServer.GetList().Count(); var getPageList = _logServer.GetPageList(pageIndex, pageSize, u => true, a => true, true); //接受一个对像,内部把此对象使用javaScript序列化类对象志字符串,发送到前台 var data = from u in getPageList select new { u.Id, u.Logger, u.Message, u.AddedDate, u.Level, }; string strNav = PagerHelper.ShowPageNavigate(pageIndex, pageSize, totalCount); var result = new { Data = data, NavStr = strNav }; countNow = pageIndex; return(Json(result, JsonRequestBehavior.AllowGet)); }