.net 메모리 프로세스 (여러 입력 출력 매개 변수 포함) 의 처리 방식 호출
4056 단어 .net 개발
#region OutSave
///
///
///
///
///
public void OutSave(OutStockParmDto dto,ref String louid, ref String msg) {
//
DBConfigration myDBConfigration = new DBConfigration();
OleDbConnection conn = new OleDbConnection("Provider=MSDAORA;" + myDBConfigration.GetConnString()); //
try
{
conn.Open();
OleDbCommand cmd = new OleDbCommand("// //", conn);
cmd.CommandType = CommandType.StoredProcedure;
//
// ( )
string[] paramstr ={ "AL_STACKID", "AL_LINID", "AS_OPERATOR", "AS_CONTNOFLAG", "AL_CONID", "AL_VANID", "AS_CONTNO", "AS_TRUCKNO", "AS_DRIVER", "AS_HAULIER", "AL_TID" ,"AL_PKGS" ,"AL_KGS"};
// ( )
Object[] paramVal = { dto.Stackid, dto.Linid, dto.Operators, dto.Contnoflag, dto.Conid, dto.Vanid, dto.Contno, dto.Truckno, dto.Driver, dto.Haulier, dto.Tid,dto.Pkgs,dto.Kgs };
//0 ,1
int[] type = {0,0,1,1,0,0,1,1,1,1,0,0,0 };
//
if (paramstr.Length == paramVal.Length && paramstr.Length == type.Length)
{
for (int f = 0; f < paramstr.Length; f++)
{
OleDbParameter parameter_in;
//
if (type[f] == 0)
{
parameter_in = new OleDbParameter(paramstr[f], OleDbType.Numeric);
}
else
{
parameter_in = new OleDbParameter(paramstr[f], OleDbType.VarChar);
}
parameter_in.Direction = ParameterDirection.Input;
if (type[f] == 0)
{
// ,
if (paramVal[f] == null)
{
parameter_in.Value = 0;
}
else if (paramVal[f].ToString().Trim().Equals(""))
{
parameter_in.Value = 0;
}
else
{
parameter_in.Value = Convert.ToDecimal(paramVal[f]);
}
}
else
{
parameter_in.Value = paramVal[f];
}
cmd.Parameters.Add(parameter_in);
}
}
////
cmd.Parameters.Add("AL_LOUID", OleDbType.Numeric);
cmd.Parameters.Add("AS_MSG", OleDbType.VarChar, 100);
cmd.Parameters["AL_LOUID"].Direction = ParameterDirection.Output;
cmd.Parameters["AS_MSG"].Direction = ParameterDirection.Output;
// ,
cmd.ExecuteNonQuery();
this.ExecuteSqlNoneReturn(" COMMIT ");
//
louid = cmd.Parameters["AL_LOUID"].Value.ToString().Trim();
msg = cmd.Parameters["AS_MSG"].Value.ToString().Trim();
}
catch (Exception e)
{
throw e;
}
finally
{
//
conn.Close();
}
}
#endregion