public JQGridDataResult GetArticles() { // 每页显示记录数 int pageSize = int.Parse(HttpContext.Current.Request.QueryString["rows"]); // 当前页 int pageIndex = int.Parse(HttpContext.Current.Request.QueryString["page"]); IArticleService articleService = new ArticleService(); var data = articleService.GetArticles(pageSize, pageIndex, string.Empty); // 记录总数 int rowCount = data.TotalCount; // 总页数 int pageCount = rowCount % pageSize == 0 ? rowCount / pageSize : rowCount / pageSize + 1; var resultObj = new JQGridDataResult { // 总页数 PageCount = pageCount, // 当前页 PageIndex = pageIndex, // 总记录数 Total = rowCount, // 数据 Data = data }; return(resultObj); }
public object GetApplyForLoan() { DataTable dt; using (DataCommand cmd = DataCommandManager.GetDataCommand("InsertApplyForLoan")) { cmd.CommandText = "select * from ApplyForLoan"; dt = cmd.ExecuteDataTable(); } var resultObj = new JQGridDataResult { // 总页数 PageCount = 1, // 当前页 PageIndex = 1, // 总记录数 Total = dt.Rows.Count, // 数据 Data = dt }; return(resultObj); }
public object GetSiteConfig() { ISiteOptionService siteOptionService = new SiteOptionService(); var data = siteOptionService.GetSiteOption(); // 每页显示记录数 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); }
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); }
public object GetVar2() { IModuleService moduleService = new ModuleService(); List <Module> menus = moduleService.GetTreeModules(); // 每页显示记录数 int pageSize = 10; // 记录总数 int rowCount = menus.Count; // 总页数 int pageCount = rowCount % pageSize == 0 ? rowCount / pageSize : rowCount / pageSize + 1; var resultObj = new JQGridDataResult { // 总页数 PageCount = pageCount, // 当前页 PageIndex = 1, // 总记录数 Total = rowCount, // 数据 Data = menus }; return(resultObj); }
public object GetProducts() { // 每页显示记录数 int pageSize = int.Parse(HttpContext.Current.Request.QueryString["rows"]); // 当前页 int pageIndex = int.Parse(HttpContext.Current.Request.QueryString["page"]); IProductService productService = new ProductService(); List <ProductInfo> data = productService.GetProducts(pageSize, pageIndex, string.Empty); // 记录总数 int rowCount = productService.GetProductCount(string.Empty); // 总页数 int pageCount = rowCount % pageSize == 0 ? rowCount / pageSize : rowCount / pageSize + 1; var resultObj = new JQGridDataResult { // 总页数 PageCount = pageCount, // 当前页 PageIndex = pageIndex, // 总记录数 Total = rowCount, // 数据 Data = data }; return(resultObj); }
public object GetProductCategory() { IProductCategoryService productCategoryService = new ProductCategoryService(); var data = productCategoryService.GetProductCategory(); // 每页显示记录数 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 = from item in data select new { cell = new string[] { item.Id.ToString(), item.Name, item.Desc, item.CategoryId.ToString(), item.MediumPicture, item.Depth.ToString(), item.Parent, (item.Rgt == item.Lft + 1).ToString(), "true", "true" } } }; return(resultObj); }
public object GetVar2() { IModuleService moduleService = new ModuleService(); List<Module> menus = moduleService.GetTreeModules(); // 每页显示记录数 int pageSize = 10; // 记录总数 int rowCount = menus.Count; // 总页数 int pageCount = rowCount % pageSize == 0 ? rowCount / pageSize : rowCount / pageSize + 1; var resultObj = new JQGridDataResult { // 总页数 PageCount = pageCount, // 当前页 PageIndex = 1, // 总记录数 Total = rowCount, // 数据 Data = menus }; return resultObj; }
public object GetSiteConfig() { ISiteOptionService siteOptionService = new SiteOptionService(); var data = siteOptionService.GetSiteOption(); // 每页显示记录数 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; }
public object GetProducts() { // 每页显示记录数 int pageSize = int.Parse(HttpContext.Current.Request.QueryString["rows"]); // 当前页 int pageIndex = int.Parse(HttpContext.Current.Request.QueryString["page"]); IProductService productService = new ProductService(); List<ProductInfo> data = productService.GetProducts(pageSize, pageIndex, string.Empty); // 记录总数 int rowCount = productService.GetProductCount(string.Empty); // 总页数 int pageCount = rowCount % pageSize == 0 ? rowCount / pageSize : rowCount / pageSize + 1; var resultObj = new JQGridDataResult { // 总页数 PageCount = pageCount, // 当前页 PageIndex = pageIndex, // 总记录数 Total = rowCount, // 数据 Data = data }; return resultObj; }
public object GetProductCategory() { IProductCategoryService productCategoryService=new ProductCategoryService(); var data = productCategoryService.GetProductCategory(); // 每页显示记录数 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 =from item in data select new { cell=new string[] { item.Id.ToString(), item.Name, item.Desc, item.CategoryId.ToString(), item.MediumPicture, item.Depth.ToString(), item.Parent, (item.Rgt==item.Lft+1).ToString(), "true", "true" } } }; return resultObj; }
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; }
public JQGridDataResult GetArticles() { // 每页显示记录数 int pageSize = int.Parse(HttpContext.Current.Request.QueryString["rows"]); // 当前页 int pageIndex = int.Parse(HttpContext.Current.Request.QueryString["page"]); IArticleService articleService = new ArticleService(); var data= articleService.GetArticles(pageSize, pageIndex, string.Empty); // 记录总数 int rowCount = data.TotalCount; // 总页数 int pageCount = rowCount % pageSize == 0 ? rowCount / pageSize : rowCount / pageSize + 1; var resultObj = new JQGridDataResult { // 总页数 PageCount = pageCount, // 当前页 PageIndex = pageIndex, // 总记录数 Total = rowCount, // 数据 Data = data }; return resultObj; }
public object GetApplyForLoan() { DataTable dt; using (DataCommand cmd = DataCommandManager.GetDataCommand("InsertApplyForLoan")) { cmd.CommandText = "select * from ApplyForLoan"; dt = cmd.ExecuteDataTable(); } var resultObj = new JQGridDataResult { // 总页数 PageCount = 1, // 当前页 PageIndex = 1, // 总记录数 Total = dt.Rows.Count, // 数据 Data = dt }; return resultObj; }