Ejemplo 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);
 }
Ejemplo 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);
 }