Browse Source

修改BUG

章政 8 years ago
parent
commit
bb4af939ab
2 changed files with 7 additions and 31 deletions
  1. 2 25
      UAS_XmlAnalysor/DataHelper.cs
  2. 5 6
      UAS_XmlAnalysor/Form1.cs

+ 2 - 25
UAS_XmlAnalysor/DataHelper.cs

@@ -287,40 +287,17 @@ namespace UAS_XmlAnalysor
             try
             {
                 command.ExecuteNonQuery();
+                command.ArrayBindCount = 0;
             }
             catch (Exception)
             {
                 command.Connection = new OracleConnection(DBConnectionString);
                 command.Connection.Open();
                 command.ExecuteNonQuery();
+                command.ArrayBindCount = 0;
             }
         }
 
-        public void BatchInsertDataTable(string sql, string[] param, params object[][] param1)
-        {
-            command.Parameters.Clear();
-            command.CommandText = sql;
-            Reconnect(command);
-            command.ArrayBindCount = param1[0].Length;
-            //因为第一个数组保存的是参数的名称,所以循环从1而不是0开始
-            //将第一个数组的下标固定为0作为循环添加的参数的名称
-            for (int i = 0; i < param.Length; i++)
-            {
-                command.Parameters.Add(new OracleParameter(param[i].ToString(), OracleDbType.Varchar2, param1[i], ParameterDirection.Input));
-            }
-            try
-            {
-                command.ExecuteNonQuery();
-            }
-            catch (Exception)
-            {
-                command.Connection = new OracleConnection(DBConnectionString);
-                command.Connection.Open();
-                command.ExecuteNonQuery();
-            }
-        }
-
-
         /// <summary>
         /// 调用存储过程
         /// </summary>

+ 5 - 6
UAS_XmlAnalysor/Form1.cs

@@ -207,16 +207,18 @@ namespace UAS_XmlAnalysor
             {
                 try
                 {
-                    for (int i = 1; i <= 10; i++)
+                    for (int i = 1; i <= 20; i++)
                     {
                         if (!File.Exists(BackUpFolderPath.Text + @"\" + e.Name))
                         {
                             file.MoveTo(BackUpFolderPath.Text + @"\" + e.Name);
+                            OperateResult.AppendText("成功解析文件" + e.Name + "\n");
                             break;
                         }
                         else if (!File.Exists(BackUpFolderPath.Text + @"\" + e.Name.Split('.')[0] + "(" + i + ")" + "." + e.Name.Split('.')[1]))
                         {
                             file.MoveTo(BackUpFolderPath.Text + @"\" + e.Name.Split('.')[0] + "(" + i + ")" + "." + e.Name.Split('.')[1]);
+                            OperateResult.AppendText("成功解析文件" + e.Name + "\n");
                             break;
                         }
                     }
@@ -274,12 +276,9 @@ namespace UAS_XmlAnalysor
         private void Form1_FormClosing(object sender, FormClosingEventArgs e)
         {
             string ExitConfirm = MessageBox.Show(this, "确认退出?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
-            if (ExitConfirm == "Yes")
-            {
-
-            }
-            else
+            if (ExitConfirm != "Yes")
             {
+                WindowState = FormWindowState.Minimized;
                 e.Cancel = true;
             }
         }