章政 8 жил өмнө
parent
commit
83b1d463d3

+ 2 - 3
MES接口/DataHelper.cs

@@ -17,7 +17,6 @@ namespace MES_Interface
         //用户选择的数据库的连接字符串
         public static OracleConnection connection = null;
         //用户选择的数据库的连接字符串
-        public static string DBConnectionString;
         OracleCommand command = null;
         int ReconnectTime = 0;
         /// <summary>
@@ -38,7 +37,7 @@ namespace MES_Interface
                 connection = new OracleConnection(ConnectionStrings);
                 connection.Open();
             }
-            catch (Exception e)
+            catch (Exception)
             {
             }
         }
@@ -629,7 +628,7 @@ namespace MES_Interface
                         {
                             //重置的数据库链接后只执行一次
                             ReconnectTime = ReconnectTime + 1;
-                            connection = new OracleConnection(DBConnectionString);
+                            connection = new OracleConnection(ConnectionStrings);
                             result = ExecuteSql(SQL, Type, names);
                         }
                     }

+ 3 - 3
MES接口/LogicHandler.cs

@@ -80,8 +80,7 @@ namespace MES_Interface
         {
             oErrorMessage = "";
             string SQL = "select em_code from employee where em_code=:UserName and em_password =:PassWord";
-            DataTable dt;
-            dt = (DataTable)dh.ExecuteSql(SQL, "select", iUserCode, iPassWord);
+            DataTable dt = (DataTable)dh.ExecuteSql(SQL, "select", iUserCode, iPassWord);
             if (dt.Rows.Count > 0)
                 return true;
             else
@@ -516,7 +515,8 @@ namespace MES_Interface
                 InsertMakeProcess(iSN, iMakeCode, iSourceCode, iMPKind, iResult, iUserCode);
                 return true;
             }
-            else {
+            else
+            {
                 return CS_SetFinish(iMakeCode, iSourceCode, iSN, iUserCode, out oErrorMessage);
             }
         }