/// <summary>
/// 调用存储过程返回参数
/// </summary>
/// <param name="orderId"></param>
/// <param name="cancelOrderReson"></param>
/// <returns></returns>
private string[] CancelOrderProcedure(int orderId, string cancelOrderReson)
{
string constr = DbHelperSQL.connectionString;
SqlConnection conn = new SqlConnection(constr);
conn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandText = "Remy_Customer_CancelRedeemOrder";
cmd.CommandType = CommandType.StoredProcedure;
//参数一
SqlParameter parameter_OrderId = new SqlParameter("@RedeemOrderId", SqlDbType.Int);
parameter_OrderId.Direction = ParameterDirection.Input;
parameter_OrderId.Value = orderId;
//参数二
SqlParameter parameter_OrderRemind = new SqlParameter("@RedeemOrderRemind", SqlDbType.NVarChar, );
parameter_OrderRemind.Direction = ParameterDirection.Input;
parameter_OrderRemind.Value = cancelOrderReson;
SqlParameter parameter_ReturnCode = new SqlParameter("@ReturnCode", SqlDbType.NVarChar, );
parameter_ReturnCode.Direction = ParameterDirection.Output;
parameter_ReturnCode.Value = "";
SqlParameter parameter_ReturnReason = new SqlParameter("@ReturnReason", SqlDbType.NVarChar, );
parameter_ReturnReason.Direction = ParameterDirection.Output;
parameter_ReturnReason.Value = "";
cmd.Parameters.Add(parameter_OrderId);
cmd.Parameters.Add(parameter_OrderRemind);
cmd.Parameters.Add(parameter_ReturnCode);
cmd.Parameters.Add(parameter_ReturnReason);
try
{
cmd.ExecuteNonQuery();
}
finally
{
conn.Close();
}
string[] cancelResult = new String[] { parameter_ReturnCode.Value.ToString(), parameter_ReturnReason.Value.ToString() };
return cancelResult;
}