/// <summary>
/// 增加SortPage输出参数
/// </summary>
/// <param name="arParams">引用参数</param>
/// <param name="sortPage">分页对象</param>
/// <param name="rowCountParamName">输出行数</param>
/// <param name="outCursorParamName">输出游标</param>
public static void AddSortPageParam(ref SqlParameter[] arParams, SortPage sortPage, string rowCountParamName)
{
SqlParameter[] pagerParams = SqlHelper.GetSqlParams("@pagesize,@pageindex,@sortby", false, sortPage.pageSize, sortPage.curPage, sortPage.orderBy);
int newParamLen = 0;
if (arParams == null)
newParamLen = 0;
else
newParamLen = arParams.Length;
SqlParameter[] newParams = new SqlParameter[newParamLen + 4];
for (int i = 0; i < newParamLen; i++)
{
newParams[i] = arParams[i];
}
newParams[newParamLen] = pagerParams[0];
newParams[newParamLen + 1] = pagerParams[1];
newParams[newParamLen + 2] = pagerParams[2];
//输出rowcount
SqlParameter rowCountParam = new SqlParameter(rowCountParamName, SqlDbType.Int);
rowCountParam.Direction = ParameterDirection.Output;
newParams[newParamLen + 3] = rowCountParam;
arParams = newParams;
}