|
@@ -44,9 +44,6 @@ namespace BenQGuru.eMES.DLLService
|
|
|
//用户选择的数据库的连接字符串
|
|
|
private OracleCommand command = null;
|
|
|
|
|
|
- [DllImport("User32.dll")]
|
|
|
- public static extern int MessageBox(int h, string m, string c, int type);
|
|
|
-
|
|
|
public MESHelper()
|
|
|
{
|
|
|
|
|
@@ -411,8 +408,7 @@ namespace BenQGuru.eMES.DLLService
|
|
|
List<string> InsertSQL = new List<string>();
|
|
|
for (int i = 0; i < BadCode.Length; i++)
|
|
|
{
|
|
|
- sql.ToString().Replace(":bc_code", BadCode[i]);
|
|
|
- InsertSQL.Add(sql.ToString());
|
|
|
+ InsertSQL.Add(sql.ToString().Replace(":bc_code", "'" + BadCode[i] + "'"));
|
|
|
}
|
|
|
ExecuteSQLTran(InsertSQL.ToArray());
|
|
|
//将不良的序列号的状态码设为3
|
|
@@ -863,15 +859,6 @@ namespace BenQGuru.eMES.DLLService
|
|
|
/// <param name="SQL"></param>
|
|
|
private void ExecuteSQLTran(params string[] SQL)
|
|
|
{
|
|
|
- OracleConnection myConnection = new OracleConnection(ConnectionStrings);
|
|
|
- myConnection.Open();
|
|
|
- OracleCommand myCommand = myConnection.CreateCommand();
|
|
|
- OracleTransaction myTrans;
|
|
|
- // Start a local transaction
|
|
|
- myTrans = myConnection.BeginTransaction(IsolationLevel.ReadCommitted);
|
|
|
- // Assign transaction object for a pending local transaction
|
|
|
- myCommand.Transaction = myTrans;
|
|
|
-
|
|
|
command = new OracleCommand();
|
|
|
command.Connection = new OracleConnection(ConnectionStrings);
|
|
|
command.Connection.Open();
|
|
@@ -885,9 +872,8 @@ namespace BenQGuru.eMES.DLLService
|
|
|
if (!String.IsNullOrEmpty(sql))
|
|
|
{
|
|
|
command.CommandText = sql;
|
|
|
-
|
|
|
+ Console.WriteLine(sql);
|
|
|
command.ExecuteNonQuery();
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
tx.Commit();
|