private void GetList() { string searchfilter = Request["searchfilter"] == null ? "" : KillSqlIn.Url_ReplaceByString(Server.UrlDecode(Request.QueryString["searchfilter"]), Int32.MaxValue); string rows = Request["rows"] == null ? "10" : KillSqlIn.Url_ReplaceByString(Request.QueryString["rows"], Int32.MaxValue); //显示数量 string page = Request["page"] == null ? "1" : KillSqlIn.Url_ReplaceByString(Request.QueryString["page"], Int32.MaxValue); //当前页 string sidx = Request["sidx"] == null ? "" : KillSqlIn.Url_ReplaceByString(Request.QueryString["sidx"], Int32.MaxValue); //排序字段 string sord = Request["sord"] == null ? "desc" : KillSqlIn.Url_ReplaceByString(Request.QueryString["sord"], Int32.MaxValue); //排序规则 string table = " t_task_node_config "; string fields = "node_id,node_code,node_sn,node_name,remarks,if_use, '' as cmd_col";//字段顺序和必须前台jggrid设置的一样 string filter = GetFilter(searchfilter); string sort = "order by " + sidx + " " + sord + ""; int totalRecords = 0; // bll.GetRecordCount(filter); int start = (Convert.ToInt32(page) - 1) * Convert.ToInt32(rows) + 1; int end = Convert.ToInt32(page) * Convert.ToInt32(rows); if (sidx.Equals("cmd_col")) { sort = " order by node_id asc "; } DataTable dtSource = new PaginationUtility().GetPaginationList(fields, table, filter, sort, Int32.Parse(page), Int32.Parse(rows), out totalRecords); EditDataSource(ref dtSource); int totalPages = JSONHelper.GetTotalPages(totalRecords, Int32.Parse(rows)); string json = JSONHelper.ToJGGridJson(page, totalPages.ToString(), totalRecords.ToString(), dtSource, fields.Replace("'' as ", "").Split(','), "node_id"); Response.Write(json); Response.End(); }
/// <summary> /// Finds the medicine types that match the filter condition sorted as specified. /// </summary> /// <typeparam name="TSortProperty">The type of the property on the object that is the sort key.</typeparam> /// <param name="filter">The condition that filters the medicine types that need to be included.</param> /// <param name="sort">The condition that defines the sorting property.</param> /// <param name="sortDirection">Should the list be sorted ascending or descending.</param> /// <param name="pagingOptions">The options for pagination.</param> /// <param name="cancellationToken">A token that can be used to signal operation cancellation.</param> /// <returns>The sorted list of medicine types that match the filter.</returns> public virtual async Task <IPagedData <IMedicineType> > FindAsync <TSortProperty>(Expression <Func <IMedicineType, bool> > filter, Expression <Func <IMedicineType, TSortProperty> > sort, ListSortDirection sortDirection, IPagingOptions pagingOptions, CancellationToken cancellationToken) where TSortProperty : IComparable { Logger.LogInformation($"Finding {pagingOptions.PageSize} medicine types for page {pagingOptions.PageNumber}..."); var paginatedResults = await PaginationUtility.FindAsync(LivestockContext.MedicineTypes, Mapper, filter, sort, sortDirection, pagingOptions, cancellationToken) .ConfigureAwait(false); Logger.LogDebug($"Found paged medicine types: {paginatedResults}"); return(paginatedResults); }
/* * /// <summary> * /// 分页获取数据列表 * /// </summary> */ public DataSet GetTopicsList(string filed, string filter, string sort, int currentPage, int pageSize, out int count) { return(PaginationUtility.GetPaginationList(filed, "V_Topics_TopicsCty", filter, sort, currentPage, pageSize, out count)); }
public DataSet GetLogList(string fields, string filter, string sort, int currentPageIndex, int pageSize, out int recordCount) { return(PaginationUtility.GetPaginationList(fields, "V_Log", filter, sort, currentPageIndex, pageSize, out recordCount)); }
public DataSet GetCodeLost_hzzlw(string fields, string filter, string sort, int currentPageIndex, int pageSize, out int recordCount) { return(PaginationUtility.GetPaginationList_hzzlw(fields, "HZ_DMYSGG", filter, sort, currentPageIndex, pageSize, out recordCount)); }