CustomPage读取数据库分页类

一、类名Class

类名:PublicFunctions.DBHelper.RawDBHelper.CustomPage

 

二、属性Properties

 

三、方法Methods

1、自定义获取数据及分页程序

函数:public static bool GetCustomPageData(string ConnectionStringKey, ref DataTable ConsultResultDataTable, string TableName, ref int pageno, int pagesize, ref int TotalResult, ref int TotalPage, string SelectFields, string StrWhere, string OrderBy, ref string ActionResultMsg, bool SelectTopFirstPage = true, bool IsConnectionStringKey = true)

返回: bool

 

2、自定义获取数据及分页程序,调试模式,获得执行的SqlDictionary

函数:public static bool GetCustomPageDataDebug(out Dictionary<string, string> SqlDictionary, string ConnectionStringKey, ref DataTable ConsultResultDataTable, string TableName, ref int pageno, int pagesize, ref int TotalResult, ref int TotalPage, string SelectFields, string StrWhere, string OrderBy, ref string ActionResultMsg, bool SelectTopFirstPage = true, bool IsConnectionStringKey = true, bool NeedKeepRowIndex = false)

返回: bool

 

3、自定义获取数据及分页程序,调试模式,获得执行的SqlDictionary(重载)

函数: public static bool GetCustomPageDataDebug(out Dictionary<string, string> SqlDictionary, out Dictionary<string, string> CurrentPageSummaryDictionary, out Dictionary<string, string> AllPageSummaryDictionary, string ConnectionStringKey, ref DataTable ConsultResultDataTable, string TableName, ref int pageno, int pagesize, ref int TotalResult, ref int TotalPage, string SelectFields, string StrWhere, string OrderBy, ref string ActionResultMsg, bool SelectTopFirstPage = true, bool IsConnectionStringKey = true, bool NeedKeepRowIndex = false, List<string> SummaryColumnList = null)

返回: bool

 

4、自定义获取数据及分页程序(数据源为内存中的DataTable)

函数:public static bool GetCustomPageData(ref DataTable AllDataTable, ref DataTable ConsultResultDataTable, ref int pageno, int pagesize, ref int TotalResult, ref int TotalPage, string StrWhere, string OrderBy, ref string ActionResultMsg)

返回: bool

 

5、计算总的页数

函数:public static int GetTotalPage(int pagesize, int TotalResult)

返回: int

 

6、根据PageSize,PageNumber获得当页List<string>

函数: public static List<string> GetCustomPageDataList(List<string> DataSoureList, ref int pageno, int pagesize, ref int TotalPage)

返回: List<string>

 

7、根据PageSize,PageNumber获得当页List<T>

函数: public static List<T> GetCustomPageDataList<T>(List<T> DataSoureList, ref int pageno, int pagesize, ref int TotalPage)

返回: List<T>

 

8、获得RowIndex的SQL语句

函数: public static string GetRowIndexSQL(string TableName, string SelectFields, string StrWhere, string OrderBy, long StartRowIndex, long EndRowIndex)

返回: string