Esempio n. 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);
 }
Esempio n. 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);
 }