#region 公共方法
/// <summary>
/// 根据不同条件取得积分设置
/// </summary>
/// <param name="functionID">功能ID</param>
/// <param name="operationID">操作ID</param>
/// <param name="roleTypeID">角色ID</param>
/// <param name="bBSTypeID">版块类型DI</param>
/// <param name="score">积分</param>
/// <param name="bB">币币</param>
/// <param name="buyType">购买类型</param>
/// <param name="functionState">功能状态</param>
/// <returns></returns>
public bool GetSpecialInfo(int functionID,int operationID,int roleTypeID,int bBSTypeID,int score,int bB,int buyType,int functionState)
{
SqlDataAdapter dataAdapter = null;
Database data = new Database("Town");
#region 创建参数
ArrayList sqlParameterList=new ArrayList();
if(functionID!=-1)
sqlParameterList.Add(data.MakeInParam("@FunctionID", SqlDbType.Int, 4, functionID));
if(operationID!=-1)
sqlParameterList.Add(data.MakeInParam("@OperationID", SqlDbType.Int, 4, operationID));
if(roleTypeID!=-1)
sqlParameterList.Add(data.MakeInParam("@RoleTypeID", SqlDbType.Int, 4, roleTypeID));
if(bBSTypeID!=-1)
sqlParameterList.Add(data.MakeInParam("@BBSTypeID", SqlDbType.Int, 4, bBSTypeID));
if(score!=-1)
sqlParameterList.Add(data.MakeInParam("@Score", SqlDbType.Int, 4, score));
if(bB!=-1)
sqlParameterList.Add(data.MakeInParam("@BB", SqlDbType.Int, 4, bB));
if(buyType!=-1)
sqlParameterList.Add(data.MakeInParam("@BuyType", SqlDbType.Int, 4, buyType));
if(functionState!=-1)
sqlParameterList.Add(data.MakeInParam("@FunctionState", SqlDbType.Int, 4, functionState));
SqlParameter[] prams= new SqlParameter[sqlParameterList.Count];
for( int i=0;i<sqlParameterList.Count;i++)
{
prams[i]=(SqlParameter)sqlParameterList[i];
}
#endregion
try
{
data.RunProc("GetScoreSetting", prams, out dataAdapter);
DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet,"table");
dataAdapter.Dispose();
if(dataSet.Tables["table"].Rows.Count == 0)
{
dataSet.Clear();
dataSet.Dispose();
return false;
}
else
{
foreach(DataRow dr in dataSet.Tables["table"].Rows)
{
ScoreSetting SS = new ScoreSetting();
SS.ID= Int32.Parse(dr["ScoreSettingID"].ToString().Trim());
SS.FunctionID= Int32.Parse(dr["FunctionID"].ToString().Trim());