示例#1
0
 /// <summary>
 /// Statistics data that in table
 /// </summary>
 /// <param name="TableName">table name</param>
 /// <param name="Columns">Statistics column</param>
 /// <param name="WhereSql">conditions</param>
 /// <returns>Set of parameters</returns>
 public static MySqlParameter[] GetCountParm(string TableName, string Columns, string WhereSql)
 {
     MySqlParameter[] parm =
     {
         MYSqlHelper.CreateInParam("@TableName",    MySqlDbType.VarChar,  20, TableName),
         MYSqlHelper.CreateInParam("@CountColumn",  MySqlDbType.VarChar,  20, Columns),
         MYSqlHelper.CreateInParam("@WhereSql",     MySqlDbType.VarChar, 250, WhereSql),
         MYSqlHelper.CreateOutParam("@RecordCount", MySqlDbType.Int32, 4)
     };
     return(parm);
 }
示例#2
0
 /// <summary>
 /// Generate paging storedProcedure parameters
 /// </summary>
 /// <param name="CurrentIndex">CurrentPageIndex</param>
 /// <param name="PageSize">pageSize</param>
 /// <param name="WhereSql">query Condition</param>
 /// <param name="TableName">tableName</param>
 /// <param name="Columns">columns to query</param>
 /// <param name="Sort">sort</param>
 /// <returns>MySqlParameter collection</returns>
 public static MySqlParameter[] GetPageParm(int CurrentIndex, int PageSize, string WhereSql, string TableName, string Columns, Hashtable Sort)
 {
     MySqlParameter[] parm =
     {
         MYSqlHelper.CreateInParam("@CurrentIndex", MySqlDbType.Int32,      4, CurrentIndex),
         MYSqlHelper.CreateInParam("@PageSize",     MySqlDbType.Int32,      4, PageSize),
         MYSqlHelper.CreateInParam("@WhereSql",     MySqlDbType.VarChar, 2500, WhereSql),
         MYSqlHelper.CreateInParam("@TableName",    MySqlDbType.VarChar,   20, TableName),
         MYSqlHelper.CreateInParam("@Column",       MySqlDbType.VarChar, 2500, Columns),
         MYSqlHelper.CreateInParam("@Sort",         MySqlDbType.VarChar,   50, GetSort(Sort)),
         MYSqlHelper.CreateOutParam("@RecordCount", MySqlDbType.Int32, 4)
     };
     return(parm);
 }