Pārlūkot izejas kodu

清理导出国标中没有用到的函数和代码注释

zhangjiaxin 3 gadi atpakaļ
vecāks
revīzija
4df76f314a

+ 1 - 0
OTSIncAReportApp/OTSTemplateDesigner/OTSReport_Export.Designer.cs

@@ -265,6 +265,7 @@
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
             this.Text = "报告程序输出界面";
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.OTSReport_Export_FormClosing);
+            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.OTSReport_Export_FormClosed);
             this.Load += new System.EventHandler(this.OTSReport_Export_Load);
             this.ResumeLayout(false);
             this.PerformLayout();

+ 10 - 43
OTSIncAReportApp/OTSTemplateDesigner/OTSReport_Export.cs

@@ -844,8 +844,6 @@ namespace OTSIncAReportApp
         private void OTSReport_Export_Load(object sender, EventArgs e)
         {
            
-
-
             //先获取D盘,如果没有,则再获取C盘
             string str_drivename = GetSecondDriveName();
             if (str_drivename == "")
@@ -1207,10 +1205,7 @@ namespace OTSIncAReportApp
             }
         }
 
-        private void button4_Click(object sender, EventArgs e)
-        {
-          
-        }
+      
 
         private void btn_preview_Click(object sender, EventArgs e)
         {
@@ -1293,15 +1288,6 @@ namespace OTSIncAReportApp
 
         }
 
-        private void button1_Click(object sender, EventArgs e)
-        {
-
-        }
-
-        private void button6_Click(object sender, EventArgs e)
-        {
-           
-        }
 
 
         private void btn_selectPath_Click(object sender, EventArgs e)
@@ -1921,7 +1907,6 @@ namespace OTSIncAReportApp
                     if (ls_str.IndexOf("颗粒列表") > -1)
                     {
                         m_export_reporttemplate.InsertReportTemplateTable_ParticlesGridDevidePage();
-
                         lock (m_thread_flag)
                             m_thread_flag = "无";
                     }
@@ -2143,27 +2128,6 @@ namespace OTSIncAReportApp
                 }
             }
 
-            if (File.Exists(m_strDBpathGB))
-            {
-                DialogResult dr = MessageBox.Show("[Yes]直接打开报表,[No]重新生成报表,[Cancal]取消操作", "报表已有生成数据,请选择操作", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
-
-                if (dr == DialogResult.Yes)
-                {
-                    
-                    OpenOTSINcAreportGBTemplateAPP();
-                    return;
-                }
-                if (dr == DialogResult.No)
-                {
-                    //GoTo Here;
-                    //不干预,跳转到下面执行导出操作
-                }
-                if (dr == DialogResult.Cancel)
-                {
-                    //取消,返回
-                    return;
-                }
-            }
             //通过底层CLR运算,获取国标参数信息
             string resultfile = m_ReportApp.resultFilesList[m_ReportApp.WorkingResult].FilePath + "\\"
                                 + m_ReportApp.resultFilesList[m_ReportApp.WorkingResult].FileName;
@@ -2175,6 +2139,9 @@ namespace OTSIncAReportApp
             SaveReportGBTemplateDBFile(GB1, GB2, ResultGrid);//将国标信息存储到数据库中
             OpenOTSINcAreportGBTemplateAPP();//打开报告模板程序
 
+            m_ReportApp.m_DataMgrFun.ShowsTheDefaultPic();
+            this.Close();
+
         }
         /// <summary>
         /// 将国标数据保存至DB数据中
@@ -2250,7 +2217,6 @@ namespace OTSIncAReportApp
                 string[] strcoltypes_GB2_DS = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
                 sh.CreateTable("GB2_DS", strcolumns_GB2_DS, strcoltypes_GB2_DS);
 
-
                 for (int i = 0; i < ResultGrid.Rows.Count; i++)
                 {
                     string ls_sqlstr = "insert into ResultGrid (CLJGMC, YXSJ, SCZS, FLFA, YJCTZ, SCMJ, CKBZ) values('"
@@ -2264,7 +2230,6 @@ namespace OTSIncAReportApp
                     int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
                 }
 
-
                 //插入 GB1_A
                 for (int i = 0; i < GB1[0].Rows.Count; i++)
                 {
@@ -2354,9 +2319,6 @@ namespace OTSIncAReportApp
                     int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
                 }
 
-
-
-
                 //插入 GB2_A
                 for (int i = 0; i < GB2[0].Rows.Count; i++)
                 {
@@ -2497,9 +2459,14 @@ namespace OTSIncAReportApp
             process.Arguments = string.Format("{0} {1} {2} {3} {4}", arg1, arg2, arg3, arg4, arg5);  //多个参数用空格隔开
             process.WindowStyle = ProcessWindowStyle.Normal;
             Process.Start(process);
+
+            
         }
 
-      
+        private void OTSReport_Export_FormClosed(object sender, FormClosedEventArgs e)
+        {
+           
+        }
     }
     
 }

+ 3 - 0
OTSIncAReportApp/frmReportApp.cs

@@ -13,6 +13,7 @@ using System.Collections.Generic;
 using System.Data;
 using System.Diagnostics;
 using System.Drawing;
+using System.IO;
 using System.Windows.Forms;
 
 namespace OTSIncAReportApp
@@ -1215,6 +1216,8 @@ namespace OTSIncAReportApp
 
         private void frmReportApp_FormClosed(object sender, FormClosedEventArgs e)
         {
+            string strDBpathGB = resultFilesList[0].FilePath + "\\" + "ReportGBDB.db"; 
+            File.Delete(strDBpathGB);
             Process.GetCurrentProcess().Kill();
             this.Hide();//打开EChar图后,回收浏览器资源暂卡,为达到操作流畅性,先隐藏窗体再回收资源
            

+ 6 - 2
OTSIncAReportTemplate/OTSIncAReportTemplate.cs

@@ -144,9 +144,10 @@ namespace OTSIncAReportTemplate
                     LoadReportGBDBFile();
                     ReportTemplatePrint_GBReport();
                 }
+                //File.Delete(m_arg1);
             }
-            
 
+            
             //关闭查看报告,则退出进程
             this.Close();
             Application.Exit();
@@ -940,7 +941,7 @@ namespace OTSIncAReportTemplate
             DataTable ls_PicSYXT3T = sh.ExecuteQuery("select * from PicSYXT3T");
             ls_PicSYXT3T.TableName = "PicSYXT3T";
             list_dt.Add(ls_PicSYXT3T);
-
+       
         }
 
         /// <summary>
@@ -959,6 +960,7 @@ namespace OTSIncAReportTemplate
             DataTable ls_Largest3 = sh.ExecuteQuery("select * from  largest3 where cast(pid as int) > " + strmix + " and cast(pid as int) < " + strmax + " ");
             ls_Largest3.TableName = "Largest3";
             list_dt.Add(ls_Largest3);
+           
         }
         /// <summary>
         /// 读取DB数据库文件,国标部分
@@ -1008,6 +1010,8 @@ namespace OTSIncAReportTemplate
             DataTable ls_GB2_DS = sh.ExecuteQuery("select * from GB2_DS");
             ls_GB2_DS.TableName = "GB2_DS";
             list_dt.Add(ls_GB2_DS);
+
+           
         }
         #endregion