public int UpdateBasicContent() { var model = new BasicContentInfo(); model.Id = Convert.ToInt32(HttpContext.Current.Request.Params["BasicContentId"]); model.Title = HttpContext.Current.Request.Params["Title"]; model.Category = HttpContext.Current.Request.Params["Category"]; model.LinkPath = HttpContext.Current.Request.Params["LinkPath"]; model.Content = HttpContext.Current.Request.Params["Content"]; model.Summary = HttpContext.Current.Request.Params["Summary"]; IBasicContentService basicContentService=new BasicContentService(); return basicContentService.Update(model); }
public object GetBasicContents() { IBasicContentService basicContentService=new BasicContentService(); var data=basicContentService.GetBasicContents(); // 每页显示记录数 int pageSize = 10; // 记录总数 int rowCount = data.Count; // 总页数 int pageCount = rowCount % pageSize == 0 ? rowCount / pageSize : rowCount / pageSize + 1; var resultObj = new JQGridDataResult { // 总页数 PageCount = pageCount, // 当前页 PageIndex = 1, // 总记录数 Total = rowCount, // 数据 Data = data }; return resultObj; }