62,054
社区成员
发帖
与我相关
我的任务
分享
//写
public int submit_style(Int32 memberid, Int32 company_style, string companymenu)
{
OracleConnection myOConn = new OracleConnection(common.ConnStr());
OracleCommand myOComm = new OracleCommand();
myOComm.Connection = myOConn;
myOComm.CommandText = "CompanyWeb_Ch.ReturnValue";
myOComm.CommandType = CommandType.StoredProcedure;
myOComm.Parameters.Add("Member_i", OracleType.Int32).Value = memberid;
myOComm.Parameters[0].Direction = ParameterDirection.Input;
myOComm.Parameters.Add("Company_s", OracleType.Int32).Value = company_style;
myOComm.Parameters[1].Direction = ParameterDirection.Input;
myOComm.Parameters.Add("Company_m", OracleType.Clob).Value = companymenu;
myOComm.Parameters[2].Direction = ParameterDirection.Input;
myOComm.Parameters.Add("index_id", OracleType.Int32);
myOComm.Parameters[3].Direction = ParameterDirection.Output;
try
{
myOConn.Open();
OracleString rowid;
myOComm.ExecuteOracleNonQuery(out rowid);
Int32 indexid = (Int32)myOComm.Parameters[3].Value;
return indexid;
}
catch (Exception err)
{
err.Message.ToString();
return -1;
}
finally
{
myOComm.Dispose();
myOConn.Close();
}
//读
public bool getcompanyvalue(decimal memberid, out decimal companystyle, out string companymenu)
{
OracleConnection myconn = new OracleConnection(common.ConnStr());
OracleCommand mycmd = new OracleCommand("CompanyWeb_Ch.SelectValue", myconn);
mycmd.CommandType = CommandType.StoredProcedure;
mycmd.Parameters.Add("memberid", OracleType.Int32).Value = memberid;
mycmd.Parameters[0].Direction = ParameterDirection.Input;
mycmd.Parameters.Add("companystyle", OracleType.Number, 10);
mycmd.Parameters[1].Direction = ParameterDirection.Output;
mycmd.Parameters.Add("companymenu", OracleType.Clob, 1000);
mycmd.Parameters[2].Direction = ParameterDirection.Output;
mycmd.Parameters.Add("RetCode", OracleType.Int32);
mycmd.Parameters[3].Direction = ParameterDirection.Output;
try
{
myconn.Open();
//执行存储过程
OracleString rowid;
mycmd.ExecuteOracleNonQuery(out rowid);
Int32 retcode = (Int32)mycmd.Parameters[3].Value;
companystyle = (decimal)mycmd.Parameters[1].Value;
companymenu = common.ChangeLobToString(mycmd.Parameters[2].Value);
switch (retcode)
{
case 1:
return true;
case 0:
return false;
default:
return false;
}
}
catch (Exception err)
{
companystyle = 0;
companymenu = "err";
return false;
}
finally
{
mycmd.Dispose();
myconn.Close();
}
}