AutoAnalysisReportDialog.cs 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047
  1. using PaintDotNet;
  2. using PaintDotNet.Base.CommTool;
  3. using PaintDotNet.Base.Functionodel;
  4. using PaintDotNet.Base.SettingModel;
  5. using PaintDotNet.CustomControl;
  6. using PaintDotNet.DbOpreate.DbBll;
  7. using PaintDotNet.DbOpreate.DbModel;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.ComponentModel;
  11. using System.Data;
  12. using System.Drawing;
  13. using System.IO;
  14. using System.Linq;
  15. using System.Text;
  16. using System.Threading.Tasks;
  17. using System.Windows.Forms;
  18. using Newtonsoft.Json;
  19. using static PaintDotNet.Base.Functionodel.AnalyzeSettingModel;
  20. namespace Metis.AutoAnalysis
  21. {
  22. public partial class AutoAnalysisReportDialog : PdnBaseForm
  23. {
  24. #region 控件
  25. private GroupBox groupBox1;
  26. private Button button2;
  27. private Button button1;
  28. private GroupBox groupBox2;
  29. private ComboBox comboBox1;
  30. private Label label3;
  31. private Label label2;
  32. private Label label1;
  33. private GroupBox groupBox3;
  34. private GroupBox groupBox4;
  35. private Button button3;
  36. private TextBox textBox1;
  37. private Label label6;
  38. private Label label5;
  39. private Label label4;
  40. private TextBox txtCustomerName;
  41. private Label label8;
  42. private Label label7;
  43. private DateTimePicker dtpReceiveDate;
  44. private Button button5;
  45. #endregion
  46. /// <summary>
  47. /// 数据库对应字段
  48. /// </summary>
  49. private string _languageName;
  50. /// <summary>
  51. /// 数据库对应list
  52. /// </summary>
  53. private List<mic_template_infos> _infosList;
  54. /// <summary>
  55. /// 功能路径名称,因需递归作为全局对象
  56. /// </summary>
  57. private string functionPathMsg;
  58. /// <summary>
  59. /// 分类名称,主要供书签使用
  60. /// </summary>
  61. private string analyzeClassify;
  62. /// <summary>
  63. /// 调用当前窗口的对象
  64. /// </summary>
  65. private PdnBaseForm pdnBaseForm;
  66. /// <summary>
  67. /// 在打开窗体时辅助判断是否存在报告模板文件
  68. /// </summary>
  69. public bool hasModule = false;
  70. /// <summary>
  71. /// xml对应文件路径
  72. /// </summary>
  73. private string m_filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\" + "AutoAnalyzeSavedModel.xml";
  74. /// <summary>
  75. /// xml对象
  76. /// </summary>
  77. private AutoAnalyzeSavedModel analyzeSavedModel;
  78. public bool AutoExportFlag { get; set; }
  79. /// <summary>
  80. /// 当前分析分类的数据
  81. /// </summary>
  82. private AutoAnalyzeSavedModel.ModelItem analyzeModel;
  83. private TextBox txtSampleName;
  84. private Label label10;
  85. private TextBox txtTelephone;
  86. private Label label9;
  87. private TextBox txtSampleDescription;
  88. private Label label11;
  89. private TextBox txtCheckEnvironment;
  90. private Label label18;
  91. private TextBox txtCheckRegion;
  92. private Label label17;
  93. private TextBox txtReportNumber;
  94. private Label label16;
  95. private DateTimePicker dtpReportDate;
  96. private Label label15;
  97. private DateTimePicker dtpCheckDate;
  98. private Label label14;
  99. private TextBox txtMethodStandard;
  100. private Label label13;
  101. private TextBox txtCheckItem;
  102. private Label label12;
  103. private Timer tmrAutoExport;
  104. private IContainer components;
  105. private List<string> _resultList;
  106. public AutoAnalysisReportDialog()
  107. {
  108. InitializeComponent();
  109. }
  110. public AutoAnalysisReportDialog(PdnBaseForm form, string languageName, List<string> jsonResultList)
  111. {
  112. _resultList = jsonResultList;
  113. this._languageName = languageName;
  114. this.pdnBaseForm = form;
  115. _infosList = mic_template_infos_BLL.FindAll();//查询出所有模板分类对象
  116. InitializeComponent();
  117. InitializeLanguageText();
  118. InitOtherInfo();
  119. InitLastTimeInfo();
  120. }
  121. #region 初始化
  122. private void InitializeLanguageText()
  123. {
  124. this.button5.Text = PdnResources.GetString("Menu.Configurehebookmark.Text");
  125. this.label3.Text = PdnResources.GetString("Menu.Pleaseselectthetemplateyoucanuse.Text") + ":";
  126. this.label2.Text = PdnResources.GetString("Menu.nothing.Text");
  127. this.label1.Text = PdnResources.GetString("Menu.Thefunctionpath.Text") + ":";
  128. this.groupBox3.Text = PdnResources.GetString("Menu.Itemstoragepathselection.Text");
  129. this.label6.Text = PdnResources.GetString("Menu.nothing.Text");
  130. this.label5.Text = PdnResources.GetString("Menu.Thespecificpath.Text") + ":";
  131. this.label4.Text = PdnResources.GetString("Menu.Storagepath.Text") + ":";
  132. this.groupBox4.Text = PdnResources.GetString("Menu.thebasicinformationofproject.text");
  133. //this.label8.Text = PdnResources.GetString("Menu.projectnumber.text") + ":";
  134. //this.label7.Text = PdnResources.GetString("Menu.Ratingdate.text") + ":";
  135. //this.groupBox5.Text = PdnResources.GetString("Menu.Ratingdate.text");
  136. //this.label12.Text = PdnResources.GetString("Menu.Inspectiondate.text") + ":";
  137. //this.label11.Text = PdnResources.GetString("Menu.Contactperson.text") + ":";
  138. //this.label10.Text = PdnResources.GetString("Menu.inspectiondepartment.text") + ":";
  139. //this.label9.Text = PdnResources.GetString("Menu.Sender.text") + ":";
  140. //this.groupBox6.Text = PdnResources.GetString("Menu.other.text");
  141. //this.label14.Text = PdnResources.GetString("Menu.name.text") + ":";
  142. //this.label13.Text = PdnResources.GetString("Menu.content.text") + ":";
  143. //this.button4.Text = PdnResources.GetString("Menu.Addto.text");
  144. this.Text = PdnResources.GetString("Menu.Analysisofsetting.Text");
  145. this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
  146. this.button2.Text = PdnResources.GetString("Menu.File.Save.Text");
  147. this.button1.Text = PdnResources.GetString("Menu.File.Close.Text");
  148. this.groupBox2.Text = PdnResources.GetString("Menu.Reporttemplateselection.Text");
  149. }
  150. private void InitializeComponent()
  151. {
  152. this.components = new System.ComponentModel.Container();
  153. this.groupBox1 = new System.Windows.Forms.GroupBox();
  154. this.button2 = new System.Windows.Forms.Button();
  155. this.button1 = new System.Windows.Forms.Button();
  156. this.groupBox2 = new System.Windows.Forms.GroupBox();
  157. this.button5 = new System.Windows.Forms.Button();
  158. this.comboBox1 = new System.Windows.Forms.ComboBox();
  159. this.label3 = new System.Windows.Forms.Label();
  160. this.label2 = new System.Windows.Forms.Label();
  161. this.label1 = new System.Windows.Forms.Label();
  162. this.groupBox3 = new System.Windows.Forms.GroupBox();
  163. this.button3 = new System.Windows.Forms.Button();
  164. this.textBox1 = new System.Windows.Forms.TextBox();
  165. this.label6 = new System.Windows.Forms.Label();
  166. this.label5 = new System.Windows.Forms.Label();
  167. this.label4 = new System.Windows.Forms.Label();
  168. this.groupBox4 = new System.Windows.Forms.GroupBox();
  169. this.txtCheckEnvironment = new System.Windows.Forms.TextBox();
  170. this.label18 = new System.Windows.Forms.Label();
  171. this.txtCheckRegion = new System.Windows.Forms.TextBox();
  172. this.label17 = new System.Windows.Forms.Label();
  173. this.txtReportNumber = new System.Windows.Forms.TextBox();
  174. this.label16 = new System.Windows.Forms.Label();
  175. this.dtpReportDate = new System.Windows.Forms.DateTimePicker();
  176. this.label15 = new System.Windows.Forms.Label();
  177. this.dtpCheckDate = new System.Windows.Forms.DateTimePicker();
  178. this.label14 = new System.Windows.Forms.Label();
  179. this.txtMethodStandard = new System.Windows.Forms.TextBox();
  180. this.label13 = new System.Windows.Forms.Label();
  181. this.txtCheckItem = new System.Windows.Forms.TextBox();
  182. this.label12 = new System.Windows.Forms.Label();
  183. this.txtSampleDescription = new System.Windows.Forms.TextBox();
  184. this.label11 = new System.Windows.Forms.Label();
  185. this.txtSampleName = new System.Windows.Forms.TextBox();
  186. this.label10 = new System.Windows.Forms.Label();
  187. this.txtTelephone = new System.Windows.Forms.TextBox();
  188. this.label9 = new System.Windows.Forms.Label();
  189. this.dtpReceiveDate = new System.Windows.Forms.DateTimePicker();
  190. this.txtCustomerName = new System.Windows.Forms.TextBox();
  191. this.label8 = new System.Windows.Forms.Label();
  192. this.label7 = new System.Windows.Forms.Label();
  193. this.tmrAutoExport = new System.Windows.Forms.Timer(this.components);
  194. this.groupBox1.SuspendLayout();
  195. this.groupBox2.SuspendLayout();
  196. this.groupBox3.SuspendLayout();
  197. this.groupBox4.SuspendLayout();
  198. this.SuspendLayout();
  199. //
  200. // groupBox1
  201. //
  202. this.groupBox1.Controls.Add(this.button2);
  203. this.groupBox1.Controls.Add(this.button1);
  204. this.groupBox1.Location = new System.Drawing.Point(15, 5);
  205. this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  206. this.groupBox1.Name = "groupBox1";
  207. this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
  208. this.groupBox1.Size = new System.Drawing.Size(678, 61);
  209. this.groupBox1.TabIndex = 0;
  210. this.groupBox1.TabStop = false;
  211. this.groupBox1.Text = "操作";
  212. //
  213. // button2
  214. //
  215. this.button2.BackColor = System.Drawing.SystemColors.Control;
  216. this.button2.Location = new System.Drawing.Point(564, 15);
  217. this.button2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  218. this.button2.Name = "button2";
  219. this.button2.Size = new System.Drawing.Size(95, 38);
  220. this.button2.TabIndex = 0;
  221. this.button2.Text = "生成报告";
  222. this.button2.UseVisualStyleBackColor = false;
  223. this.button2.Click += new System.EventHandler(this.button2_Click);
  224. //
  225. // button1
  226. //
  227. this.button1.BackColor = System.Drawing.SystemColors.Control;
  228. this.button1.Location = new System.Drawing.Point(444, 15);
  229. this.button1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  230. this.button1.Name = "button1";
  231. this.button1.Size = new System.Drawing.Size(95, 38);
  232. this.button1.TabIndex = 0;
  233. this.button1.Text = "关闭";
  234. this.button1.UseVisualStyleBackColor = false;
  235. this.button1.Click += new System.EventHandler(this.button1_Click);
  236. //
  237. // groupBox2
  238. //
  239. this.groupBox2.Controls.Add(this.button5);
  240. this.groupBox2.Controls.Add(this.comboBox1);
  241. this.groupBox2.Controls.Add(this.label3);
  242. this.groupBox2.Controls.Add(this.label2);
  243. this.groupBox2.Controls.Add(this.label1);
  244. this.groupBox2.Location = new System.Drawing.Point(15, 70);
  245. this.groupBox2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  246. this.groupBox2.Name = "groupBox2";
  247. this.groupBox2.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
  248. this.groupBox2.Size = new System.Drawing.Size(678, 112);
  249. this.groupBox2.TabIndex = 1;
  250. this.groupBox2.TabStop = false;
  251. this.groupBox2.Text = "报告模板选择";
  252. //
  253. // button5
  254. //
  255. this.button5.Location = new System.Drawing.Point(579, 79);
  256. this.button5.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  257. this.button5.Name = "button5";
  258. this.button5.Size = new System.Drawing.Size(91, 25);
  259. this.button5.TabIndex = 0;
  260. this.button5.Text = "配置书签";
  261. this.button5.UseVisualStyleBackColor = true;
  262. this.button5.Click += new System.EventHandler(this.button5_Click);
  263. //
  264. // comboBox1
  265. //
  266. this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  267. this.comboBox1.FormattingEnabled = true;
  268. this.comboBox1.Location = new System.Drawing.Point(182, 79);
  269. this.comboBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  270. this.comboBox1.Name = "comboBox1";
  271. this.comboBox1.Size = new System.Drawing.Size(393, 23);
  272. this.comboBox1.TabIndex = 3;
  273. //
  274. // label3
  275. //
  276. this.label3.AutoSize = true;
  277. this.label3.ForeColor = System.Drawing.SystemColors.ControlText;
  278. this.label3.Location = new System.Drawing.Point(19, 85);
  279. this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
  280. this.label3.Name = "label3";
  281. this.label3.Size = new System.Drawing.Size(157, 15);
  282. this.label3.TabIndex = 2;
  283. this.label3.Text = "请选择可使用的模板:";
  284. //
  285. // label2
  286. //
  287. this.label2.ForeColor = System.Drawing.SystemColors.ControlText;
  288. this.label2.Location = new System.Drawing.Point(204, 32);
  289. this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
  290. this.label2.Name = "label2";
  291. this.label2.Size = new System.Drawing.Size(466, 42);
  292. this.label2.TabIndex = 1;
  293. //
  294. // label1
  295. //
  296. this.label1.AutoSize = true;
  297. this.label1.ForeColor = System.Drawing.SystemColors.ControlText;
  298. this.label1.Location = new System.Drawing.Point(19, 32);
  299. this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
  300. this.label1.Name = "label1";
  301. this.label1.Size = new System.Drawing.Size(82, 15);
  302. this.label1.TabIndex = 0;
  303. this.label1.Text = "功能路径:";
  304. //
  305. // groupBox3
  306. //
  307. this.groupBox3.Controls.Add(this.button3);
  308. this.groupBox3.Controls.Add(this.textBox1);
  309. this.groupBox3.Controls.Add(this.label6);
  310. this.groupBox3.Controls.Add(this.label5);
  311. this.groupBox3.Controls.Add(this.label4);
  312. this.groupBox3.Location = new System.Drawing.Point(15, 202);
  313. this.groupBox3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  314. this.groupBox3.Name = "groupBox3";
  315. this.groupBox3.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
  316. this.groupBox3.Size = new System.Drawing.Size(678, 112);
  317. this.groupBox3.TabIndex = 1;
  318. this.groupBox3.TabStop = false;
  319. this.groupBox3.Text = "项目储存路径选择";
  320. //
  321. // button3
  322. //
  323. this.button3.BackColor = System.Drawing.SystemColors.Window;
  324. this.button3.Font = new System.Drawing.Font("宋体", 6F);
  325. this.button3.Location = new System.Drawing.Point(626, 42);
  326. this.button3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  327. this.button3.Name = "button3";
  328. this.button3.Size = new System.Drawing.Size(36, 26);
  329. this.button3.TabIndex = 0;
  330. this.button3.Text = "...";
  331. this.button3.UseVisualStyleBackColor = false;
  332. this.button3.Click += new System.EventHandler(this.button3_Click);
  333. //
  334. // textBox1
  335. //
  336. this.textBox1.Location = new System.Drawing.Point(129, 42);
  337. this.textBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  338. this.textBox1.Name = "textBox1";
  339. this.textBox1.ReadOnly = true;
  340. this.textBox1.Size = new System.Drawing.Size(499, 25);
  341. this.textBox1.TabIndex = 4;
  342. //
  343. // label6
  344. //
  345. this.label6.ForeColor = System.Drawing.SystemColors.ControlText;
  346. this.label6.Location = new System.Drawing.Point(116, 25);
  347. this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
  348. this.label6.Name = "label6";
  349. this.label6.Size = new System.Drawing.Size(542, 12);
  350. this.label6.TabIndex = 3;
  351. this.label6.Visible = false;
  352. //
  353. // label5
  354. //
  355. this.label5.AutoSize = true;
  356. this.label5.ForeColor = System.Drawing.SystemColors.ControlText;
  357. this.label5.Location = new System.Drawing.Point(19, 50);
  358. this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
  359. this.label5.Name = "label5";
  360. this.label5.Size = new System.Drawing.Size(82, 15);
  361. this.label5.TabIndex = 2;
  362. this.label5.Text = "具体路径:";
  363. //
  364. // label4
  365. //
  366. this.label4.AutoSize = true;
  367. this.label4.ForeColor = System.Drawing.SystemColors.ControlText;
  368. this.label4.Location = new System.Drawing.Point(19, 25);
  369. this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
  370. this.label4.Name = "label4";
  371. this.label4.Size = new System.Drawing.Size(82, 15);
  372. this.label4.TabIndex = 1;
  373. this.label4.Text = "储存路径:";
  374. this.label4.Visible = false;
  375. //
  376. // groupBox4
  377. //
  378. this.groupBox4.Controls.Add(this.txtCheckEnvironment);
  379. this.groupBox4.Controls.Add(this.label18);
  380. this.groupBox4.Controls.Add(this.txtCheckRegion);
  381. this.groupBox4.Controls.Add(this.label17);
  382. this.groupBox4.Controls.Add(this.txtReportNumber);
  383. this.groupBox4.Controls.Add(this.label16);
  384. this.groupBox4.Controls.Add(this.dtpReportDate);
  385. this.groupBox4.Controls.Add(this.label15);
  386. this.groupBox4.Controls.Add(this.dtpCheckDate);
  387. this.groupBox4.Controls.Add(this.label14);
  388. this.groupBox4.Controls.Add(this.txtMethodStandard);
  389. this.groupBox4.Controls.Add(this.label13);
  390. this.groupBox4.Controls.Add(this.txtCheckItem);
  391. this.groupBox4.Controls.Add(this.label12);
  392. this.groupBox4.Controls.Add(this.txtSampleDescription);
  393. this.groupBox4.Controls.Add(this.label11);
  394. this.groupBox4.Controls.Add(this.txtSampleName);
  395. this.groupBox4.Controls.Add(this.label10);
  396. this.groupBox4.Controls.Add(this.txtTelephone);
  397. this.groupBox4.Controls.Add(this.label9);
  398. this.groupBox4.Controls.Add(this.dtpReceiveDate);
  399. this.groupBox4.Controls.Add(this.txtCustomerName);
  400. this.groupBox4.Controls.Add(this.label8);
  401. this.groupBox4.Controls.Add(this.label7);
  402. this.groupBox4.Location = new System.Drawing.Point(15, 322);
  403. this.groupBox4.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  404. this.groupBox4.Name = "groupBox4";
  405. this.groupBox4.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
  406. this.groupBox4.Size = new System.Drawing.Size(678, 295);
  407. this.groupBox4.TabIndex = 1;
  408. this.groupBox4.TabStop = false;
  409. this.groupBox4.Text = "项目基本信息";
  410. //
  411. // txtCheckEnvironment
  412. //
  413. this.txtCheckEnvironment.Location = new System.Drawing.Point(444, 238);
  414. this.txtCheckEnvironment.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  415. this.txtCheckEnvironment.Name = "txtCheckEnvironment";
  416. this.txtCheckEnvironment.Size = new System.Drawing.Size(205, 25);
  417. this.txtCheckEnvironment.TabIndex = 0;
  418. //
  419. // label18
  420. //
  421. this.label18.AutoSize = true;
  422. this.label18.ForeColor = System.Drawing.SystemColors.ControlText;
  423. this.label18.Location = new System.Drawing.Point(356, 242);
  424. this.label18.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
  425. this.label18.Name = "label18";
  426. this.label18.Size = new System.Drawing.Size(82, 15);
  427. this.label18.TabIndex = 25;
  428. this.label18.Text = "检测环境:";
  429. //
  430. // txtCheckRegion
  431. //
  432. this.txtCheckRegion.Location = new System.Drawing.Point(106, 236);
  433. this.txtCheckRegion.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  434. this.txtCheckRegion.Name = "txtCheckRegion";
  435. this.txtCheckRegion.Size = new System.Drawing.Size(205, 25);
  436. this.txtCheckRegion.TabIndex = 0;
  437. //
  438. // label17
  439. //
  440. this.label17.AutoSize = true;
  441. this.label17.ForeColor = System.Drawing.SystemColors.ControlText;
  442. this.label17.Location = new System.Drawing.Point(19, 241);
  443. this.label17.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
  444. this.label17.Name = "label17";
  445. this.label17.Size = new System.Drawing.Size(82, 15);
  446. this.label17.TabIndex = 23;
  447. this.label17.Text = "检测区域:";
  448. //
  449. // txtReportNumber
  450. //
  451. this.txtReportNumber.Location = new System.Drawing.Point(444, 196);
  452. this.txtReportNumber.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  453. this.txtReportNumber.Name = "txtReportNumber";
  454. this.txtReportNumber.Size = new System.Drawing.Size(205, 25);
  455. this.txtReportNumber.TabIndex = 0;
  456. //
  457. // label16
  458. //
  459. this.label16.AutoSize = true;
  460. this.label16.ForeColor = System.Drawing.SystemColors.ControlText;
  461. this.label16.Location = new System.Drawing.Point(356, 201);
  462. this.label16.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
  463. this.label16.Name = "label16";
  464. this.label16.Size = new System.Drawing.Size(82, 15);
  465. this.label16.TabIndex = 21;
  466. this.label16.Text = "报告编号:";
  467. //
  468. // dtpReportDate
  469. //
  470. this.dtpReportDate.Location = new System.Drawing.Point(106, 195);
  471. this.dtpReportDate.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  472. this.dtpReportDate.Name = "dtpReportDate";
  473. this.dtpReportDate.Size = new System.Drawing.Size(205, 25);
  474. this.dtpReportDate.TabIndex = 0;
  475. //
  476. // label15
  477. //
  478. this.label15.AutoSize = true;
  479. this.label15.ForeColor = System.Drawing.SystemColors.ControlText;
  480. this.label15.Location = new System.Drawing.Point(18, 200);
  481. this.label15.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
  482. this.label15.Name = "label15";
  483. this.label15.Size = new System.Drawing.Size(82, 15);
  484. this.label15.TabIndex = 19;
  485. this.label15.Text = "报告日期:";
  486. //
  487. // dtpCheckDate
  488. //
  489. this.dtpCheckDate.Location = new System.Drawing.Point(444, 155);
  490. this.dtpCheckDate.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  491. this.dtpCheckDate.Name = "dtpCheckDate";
  492. this.dtpCheckDate.Size = new System.Drawing.Size(205, 25);
  493. this.dtpCheckDate.TabIndex = 0;
  494. //
  495. // label14
  496. //
  497. this.label14.AutoSize = true;
  498. this.label14.ForeColor = System.Drawing.SystemColors.ControlText;
  499. this.label14.Location = new System.Drawing.Point(355, 160);
  500. this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
  501. this.label14.Name = "label14";
  502. this.label14.Size = new System.Drawing.Size(82, 15);
  503. this.label14.TabIndex = 17;
  504. this.label14.Text = "检测日期:";
  505. //
  506. // txtMethodStandard
  507. //
  508. this.txtMethodStandard.Location = new System.Drawing.Point(444, 114);
  509. this.txtMethodStandard.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  510. this.txtMethodStandard.Name = "txtMethodStandard";
  511. this.txtMethodStandard.Size = new System.Drawing.Size(205, 25);
  512. this.txtMethodStandard.TabIndex = 0;
  513. //
  514. // label13
  515. //
  516. this.label13.AutoSize = true;
  517. this.label13.ForeColor = System.Drawing.SystemColors.ControlText;
  518. this.label13.Location = new System.Drawing.Point(356, 119);
  519. this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
  520. this.label13.Name = "label13";
  521. this.label13.Size = new System.Drawing.Size(82, 15);
  522. this.label13.TabIndex = 15;
  523. this.label13.Text = "方法标准:";
  524. //
  525. // txtCheckItem
  526. //
  527. this.txtCheckItem.Location = new System.Drawing.Point(106, 112);
  528. this.txtCheckItem.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  529. this.txtCheckItem.Name = "txtCheckItem";
  530. this.txtCheckItem.Size = new System.Drawing.Size(205, 25);
  531. this.txtCheckItem.TabIndex = 0;
  532. //
  533. // label12
  534. //
  535. this.label12.AutoSize = true;
  536. this.label12.ForeColor = System.Drawing.SystemColors.ControlText;
  537. this.label12.Location = new System.Drawing.Point(19, 118);
  538. this.label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
  539. this.label12.Name = "label12";
  540. this.label12.Size = new System.Drawing.Size(82, 15);
  541. this.label12.TabIndex = 13;
  542. this.label12.Text = "检测项目:";
  543. //
  544. // txtSampleDescription
  545. //
  546. this.txtSampleDescription.Location = new System.Drawing.Point(444, 72);
  547. this.txtSampleDescription.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  548. this.txtSampleDescription.Name = "txtSampleDescription";
  549. this.txtSampleDescription.Size = new System.Drawing.Size(205, 25);
  550. this.txtSampleDescription.TabIndex = 0;
  551. //
  552. // label11
  553. //
  554. this.label11.AutoSize = true;
  555. this.label11.ForeColor = System.Drawing.SystemColors.ControlText;
  556. this.label11.Location = new System.Drawing.Point(356, 78);
  557. this.label11.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
  558. this.label11.Name = "label11";
  559. this.label11.Size = new System.Drawing.Size(82, 15);
  560. this.label11.TabIndex = 11;
  561. this.label11.Text = "样品说明:";
  562. //
  563. // txtSampleName
  564. //
  565. this.txtSampleName.Location = new System.Drawing.Point(106, 71);
  566. this.txtSampleName.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  567. this.txtSampleName.Name = "txtSampleName";
  568. this.txtSampleName.Size = new System.Drawing.Size(205, 25);
  569. this.txtSampleName.TabIndex = 0;
  570. //
  571. // label10
  572. //
  573. this.label10.AutoSize = true;
  574. this.label10.ForeColor = System.Drawing.SystemColors.ControlText;
  575. this.label10.Location = new System.Drawing.Point(19, 76);
  576. this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
  577. this.label10.Name = "label10";
  578. this.label10.Size = new System.Drawing.Size(82, 15);
  579. this.label10.TabIndex = 9;
  580. this.label10.Text = "样品名称:";
  581. //
  582. // txtTelephone
  583. //
  584. this.txtTelephone.Location = new System.Drawing.Point(444, 31);
  585. this.txtTelephone.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  586. this.txtTelephone.Name = "txtTelephone";
  587. this.txtTelephone.Size = new System.Drawing.Size(205, 25);
  588. this.txtTelephone.TabIndex = 0;
  589. //
  590. // label9
  591. //
  592. this.label9.AutoSize = true;
  593. this.label9.ForeColor = System.Drawing.SystemColors.ControlText;
  594. this.label9.Location = new System.Drawing.Point(356, 36);
  595. this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
  596. this.label9.Name = "label9";
  597. this.label9.Size = new System.Drawing.Size(82, 15);
  598. this.label9.TabIndex = 7;
  599. this.label9.Text = "联系方式:";
  600. //
  601. // dtpReceiveDate
  602. //
  603. this.dtpReceiveDate.Location = new System.Drawing.Point(106, 154);
  604. this.dtpReceiveDate.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  605. this.dtpReceiveDate.Name = "dtpReceiveDate";
  606. this.dtpReceiveDate.Size = new System.Drawing.Size(205, 25);
  607. this.dtpReceiveDate.TabIndex = 0;
  608. //
  609. // txtCustomerName
  610. //
  611. this.txtCustomerName.Location = new System.Drawing.Point(106, 30);
  612. this.txtCustomerName.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  613. this.txtCustomerName.Name = "txtCustomerName";
  614. this.txtCustomerName.Size = new System.Drawing.Size(205, 25);
  615. this.txtCustomerName.TabIndex = 0;
  616. //
  617. // label8
  618. //
  619. this.label8.AutoSize = true;
  620. this.label8.ForeColor = System.Drawing.SystemColors.ControlText;
  621. this.label8.Location = new System.Drawing.Point(19, 35);
  622. this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
  623. this.label8.Name = "label8";
  624. this.label8.Size = new System.Drawing.Size(82, 15);
  625. this.label8.TabIndex = 4;
  626. this.label8.Text = "客户名称:";
  627. //
  628. // label7
  629. //
  630. this.label7.AutoSize = true;
  631. this.label7.ForeColor = System.Drawing.SystemColors.ControlText;
  632. this.label7.Location = new System.Drawing.Point(18, 159);
  633. this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
  634. this.label7.Name = "label7";
  635. this.label7.Size = new System.Drawing.Size(82, 15);
  636. this.label7.TabIndex = 3;
  637. this.label7.Text = "接收日期:";
  638. //
  639. // tmrAutoExport
  640. //
  641. this.tmrAutoExport.Tick += new System.EventHandler(this.tmrAutoExport_Tick);
  642. //
  643. // AutoAnalysisReportDialog
  644. //
  645. this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F);
  646. this.BackColor = System.Drawing.SystemColors.Control;
  647. this.ClientSize = new System.Drawing.Size(708, 655);
  648. this.Controls.Add(this.groupBox4);
  649. this.Controls.Add(this.groupBox3);
  650. this.Controls.Add(this.groupBox2);
  651. this.Controls.Add(this.groupBox1);
  652. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
  653. this.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
  654. this.MaximizeBox = false;
  655. this.MinimizeBox = false;
  656. this.Name = "AutoAnalysisReportDialog";
  657. this.Load += new System.EventHandler(this.AutoAnalysisReportDialog_Load);
  658. this.Controls.SetChildIndex(this.groupBox1, 0);
  659. this.Controls.SetChildIndex(this.groupBox2, 0);
  660. this.Controls.SetChildIndex(this.groupBox3, 0);
  661. this.Controls.SetChildIndex(this.groupBox4, 0);
  662. this.groupBox1.ResumeLayout(false);
  663. this.groupBox2.ResumeLayout(false);
  664. this.groupBox2.PerformLayout();
  665. this.groupBox3.ResumeLayout(false);
  666. this.groupBox3.PerformLayout();
  667. this.groupBox4.ResumeLayout(false);
  668. this.groupBox4.PerformLayout();
  669. this.ResumeLayout(false);
  670. }
  671. /// <summary>
  672. /// 初始化其他信息
  673. /// </summary>
  674. private void InitOtherInfo()
  675. {
  676. //设置功能路径名称
  677. if (this._languageName.Contains("Template.Manager"))
  678. functionPathMsg = PdnResources.GetString(this._languageName);
  679. else
  680. functionPathMsg = this._languageName;
  681. this.analyzeClassify = functionPathMsg;
  682. this.Text = this.analyzeClassify + PdnResources.GetString("Menu.Thereportisset.Text");
  683. getFullLanguagePath(this._languageName);
  684. this.label2.Text = functionPathMsg;
  685. //设置模板下拉菜单
  686. mic_template_infos infoModel = _infosList.Find(a => a.language_name == this._languageName);
  687. string filePath = Application.StartupPath + "\\ModuleManage" + infoModel.template_path.Replace('/', '\\');//获取文档路径
  688. if (Directory.Exists(filePath))
  689. {
  690. string[] fileNames = Directory.GetFiles(filePath);
  691. Dictionary<string, string> moduleInfo = new Dictionary<string, string>();
  692. for (int i = 0; i < fileNames.Count(); i++)
  693. {
  694. //编辑时产生的临时文件,不统计
  695. if (Path.GetFileName(fileNames[i]).Contains("~$"))
  696. continue;
  697. //判断是word文件
  698. if (FileOperationHelper.IsFileWordOrExcel(fileNames[i]) == 1)
  699. moduleInfo.Add(Path.GetFileNameWithoutExtension(fileNames[i]), fileNames[i]);
  700. }
  701. //绑定下拉菜单
  702. if (moduleInfo.Count > 0)
  703. {
  704. BindingSource bs = new BindingSource();
  705. bs.DataSource = moduleInfo;
  706. this.comboBox1.DataSource = bs;
  707. this.comboBox1.ValueMember = "Value";
  708. this.comboBox1.DisplayMember = "Key";
  709. hasModule = true;
  710. }
  711. else
  712. MessageBox.Show(PdnResources.GetString("Menu.Therearenoatefirst.text"));
  713. }
  714. else
  715. MessageBox.Show(PdnResources.GetString("Menu.Therearenoatefirst.text"));
  716. //设置存储路径
  717. string[] savePathArr = infoModel.template_path.Split('/');//拆分以获取路径根目录的名称
  718. ConfigModel configModel = Startup.instance.configModel;
  719. if (savePathArr[1].Equals("Conventional"))
  720. this.label6.Text = configModel.NormalOperation;
  721. else if (savePathArr[1].Equals("Universal"))
  722. this.label6.Text = configModel.GeneralAnalysis;
  723. else if (savePathArr[1].Equals("Dedicated"))
  724. this.label6.Text = configModel.DedicatedAnalysis;
  725. else
  726. //this.label6.Text = PdnResources.GetString("Menu.Pathacquisitionerror.Text");
  727. this.label6.Text = ""; //mod by songxk
  728. if (string.IsNullOrEmpty(this.label6.Text))
  729. this.label6.Text = PdnResources.GetString("Menu.Thestoragepathisnotset.Text");
  730. }
  731. /// <summary>
  732. /// 加载之前保存的信息
  733. /// </summary>
  734. private void InitLastTimeInfo()
  735. {
  736. if (this.hasModule && System.IO.File.Exists(m_filePath))
  737. {
  738. analyzeSavedModel = XmlSerializeHelper.DESerializer<AutoAnalyzeSavedModel>(FileOperationHelper.ReadStringFromFile(m_filePath, FileMode.Open));
  739. if (analyzeSavedModel.modelItems != null && analyzeSavedModel.modelItems.Count > 0)
  740. {
  741. analyzeModel = analyzeSavedModel.modelItems.Find(a => a.languageName == this._languageName);
  742. if (analyzeModel != null && analyzeModel.analyzeSettingModel != null)
  743. {
  744. if (!string.IsNullOrEmpty(analyzeModel.analyzeSettingModel.modulePath))
  745. this.comboBox1.SelectedValue = analyzeModel.analyzeSettingModel.modulePath;
  746. if (!string.IsNullOrEmpty(analyzeModel.analyzeSettingModel.savePath))
  747. this.textBox1.Text = analyzeModel.analyzeSettingModel.savePath;
  748. if (!string.IsNullOrEmpty(analyzeModel.analyzeSettingModel.customerName))
  749. this.txtCustomerName.Text = analyzeModel.analyzeSettingModel.customerName;
  750. if (!string.IsNullOrEmpty(analyzeModel.analyzeSettingModel.telephone))
  751. this.txtTelephone.Text = analyzeModel.analyzeSettingModel.telephone;
  752. if (!string.IsNullOrEmpty(analyzeModel.analyzeSettingModel.sampleName))
  753. this.txtSampleName.Text = analyzeModel.analyzeSettingModel.sampleName;
  754. if (!string.IsNullOrEmpty(analyzeModel.analyzeSettingModel.sampleDescription))
  755. this.txtSampleDescription.Text = analyzeModel.analyzeSettingModel.sampleDescription;
  756. if (!string.IsNullOrEmpty(analyzeModel.analyzeSettingModel.checkItem))
  757. this.txtCheckItem.Text = analyzeModel.analyzeSettingModel.checkItem;
  758. if (!string.IsNullOrEmpty(analyzeModel.analyzeSettingModel.methodStandard))
  759. this.txtMethodStandard.Text = analyzeModel.analyzeSettingModel.methodStandard;
  760. //if (analyzeModel.analyzeSettingModel.receiveDate != DateTime.MinValue)
  761. this.dtpReceiveDate.Value = DateTime.Now;
  762. //if (analyzeModel.analyzeSettingModel.checkDate != DateTime.MinValue)
  763. this.dtpCheckDate.Value = DateTime.Now;
  764. //if (analyzeModel.analyzeSettingModel.reportDate != DateTime.MinValue)
  765. this.dtpReceiveDate.Value = DateTime.Now;
  766. if (!string.IsNullOrEmpty(analyzeModel.analyzeSettingModel.reportNumber))
  767. this.txtReportNumber.Text = analyzeModel.analyzeSettingModel.reportNumber;
  768. if (!string.IsNullOrEmpty(analyzeModel.analyzeSettingModel.checkRegion))
  769. this.txtCheckRegion.Text = analyzeModel.analyzeSettingModel.checkRegion;
  770. if (!string.IsNullOrEmpty(analyzeModel.analyzeSettingModel.checkEnvironment))
  771. this.txtCheckEnvironment.Text = analyzeModel.analyzeSettingModel.checkEnvironment;
  772. }
  773. }
  774. }
  775. }
  776. #endregion
  777. /// <summary>
  778. /// 递归拼接功能路径的全称
  779. /// </summary>
  780. /// <param name="name"></param>
  781. private void getFullLanguagePath(string name)
  782. {//Template.Manager.item3.GrainSizeCutOff6394Method
  783. mic_template_infos infoModel = _infosList.Find(a => a.language_name == name);
  784. //如果有上级,查询出上级的name对应的实际名称,拼接到前面,然后继续递归
  785. if (infoModel!=null && infoModel.parent_id != 0)
  786. {
  787. string parentLanguageName = _infosList.Find(a => a.id == infoModel.parent_id).language_name;
  788. if (parentLanguageName.Contains("Template.Manager"))
  789. functionPathMsg = PdnResources.GetString(parentLanguageName) + "-" + functionPathMsg;
  790. else
  791. functionPathMsg = parentLanguageName + "-" + functionPathMsg;
  792. getFullLanguagePath(parentLanguageName);
  793. }
  794. }
  795. /// <summary>
  796. /// 路径选择
  797. /// </summary>
  798. /// <param name="sender"></param>
  799. /// <param name="e"></param>
  800. private void button3_Click(object sender, EventArgs e)
  801. {
  802. FolderBrowserDialog dialog = new FolderBrowserDialog();
  803. //if (!this.label6.Text.Equals("路径获取错误") && !this.label6.Text.Equals("存储路径未设置") && !this.label6.Text.Equals("无"))
  804. //{
  805. // dialog.SelectedPath = this.label6.Text + "\\" + this.analyzeClassify + "\\";
  806. //}
  807. //else
  808. //{
  809. //
  810. //}
  811. dialog.SelectedPath = this.label6.Text;
  812. if (dialog.ShowDialog() == DialogResult.OK)
  813. {
  814. this.textBox1.Text = dialog.SelectedPath;
  815. }
  816. /*APIDialogs.CommonOpenFileDialog dialog = new APIDialogs.CommonOpenFileDialog();
  817. dialog.IsFolderPicker = true;
  818. dialog.EnsurePathExists = true;
  819. if(this.label6.Text.Equals("路径获取错误") || this.label6.Text.Equals("存储路径未设置") || this.label6.Text.Equals("无"))
  820. dialog.InitialDirectory = "C:\\";
  821. else
  822. dialog.InitialDirectory = this.label6.Text;
  823. if (dialog.ShowDialog() == APIDialogs.CommonFileDialogResult.Ok)
  824. {
  825. this.textBox1.Text = dialog.FileName;
  826. }*/
  827. }
  828. /// <summary>
  829. /// 关闭按钮
  830. /// </summary>
  831. /// <param name="sender"></param>
  832. /// <param name="e"></param>
  833. private void button1_Click(object sender, EventArgs e)
  834. {
  835. this.Close();
  836. }
  837. /// <summary>
  838. /// 生成按钮
  839. /// </summary>
  840. /// <param name="sender"></param>
  841. /// <param name="e"></param>
  842. private void button2_Click(object sender, EventArgs e)
  843. {
  844. RunExportReport();
  845. }
  846. private void RunExportReport()
  847. {
  848. if (string.IsNullOrEmpty(this.textBox1.Text))
  849. {
  850. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectaspecificstoragepath.text"));
  851. return;
  852. }
  853. if (this.comboBox1.SelectedValue == null)
  854. {
  855. MessageBox.Show(PdnResources.GetString("Menu.Therearenorecannotbesaved.text") + "!");
  856. return;
  857. }
  858. AutoAnalyzeSettingModel model = new AutoAnalyzeSettingModel();
  859. model.modulePath = this.comboBox1.SelectedValue.ToString();
  860. model.savePath = this.textBox1.Text;
  861. model.customerName = this.txtCustomerName.Text;
  862. model.telephone = this.txtTelephone.Text;
  863. model.sampleName = this.txtSampleName.Text;
  864. model.sampleDescription = this.txtSampleDescription.Text;
  865. model.checkItem = this.txtCheckItem.Text;
  866. model.methodStandard = this.txtMethodStandard.Text;
  867. model.receiveDate = this.dtpReceiveDate.Value;
  868. model.checkDate = this.dtpCheckDate.Value;
  869. model.reportDate = this.dtpReportDate.Value;
  870. model.reportNumber = this.txtReportNumber.Text;
  871. model.checkRegion = this.txtCheckRegion.Text;
  872. model.checkEnvironment = this.txtCheckEnvironment.Text;
  873. model.analyzeClassify = this.analyzeClassify;
  874. if (analyzeSavedModel != null)
  875. {
  876. if (analyzeModel != null)
  877. analyzeModel.analyzeSettingModel = model;
  878. else
  879. {
  880. analyzeModel = new AutoAnalyzeSavedModel.ModelItem();
  881. analyzeModel.languageName = this._languageName;
  882. analyzeModel.analyzeSettingModel = model;
  883. analyzeSavedModel.modelItems.Add(analyzeModel);
  884. }
  885. }
  886. else
  887. {
  888. analyzeSavedModel = new AutoAnalyzeSavedModel();
  889. analyzeSavedModel.modelItems = new List<AutoAnalyzeSavedModel.ModelItem>();
  890. analyzeModel = new AutoAnalyzeSavedModel.ModelItem();
  891. analyzeModel.languageName = this._languageName;
  892. analyzeModel.analyzeSettingModel = model;
  893. analyzeSavedModel.modelItems.Add(analyzeModel);
  894. }
  895. //保存xml文件
  896. string savedModelInfo = XmlSerializeHelper.XmlSerialize<AutoAnalyzeSavedModel>(analyzeSavedModel);
  897. if (FileOperationHelper.WriteStringToFile(savedModelInfo, m_filePath, FileMode.Create))
  898. {
  899. //将对象传递回调用页面
  900. AutoAnalysisDialog frm = (AutoAnalysisDialog)this.pdnBaseForm;
  901. frm.AutoAnalyzeSettingModel = model;
  902. ExportReport?.Invoke();
  903. this.Close();
  904. }
  905. else
  906. {
  907. MessageBox.Show(PdnResources.GetString("Menu.Savefailed.text"));
  908. }
  909. }
  910. public Action ExportReport;
  911. /// <summary>
  912. /// 添加按钮-其他
  913. /// </summary>
  914. /// <param name="sender"></param>
  915. /// <param name="e"></param>
  916. private void button4_Click(object sender, EventArgs e)
  917. {
  918. //if (string.IsNullOrEmpty(this.textBox9.Text))
  919. //{
  920. // MessageBox.Show(PdnResources.GetString("Menu.Pleaseenteranameofthephase.text"));
  921. // return;
  922. //}
  923. //if (string.IsNullOrEmpty(this.textBox8.Text))
  924. //{
  925. // MessageBox.Show(PdnResources.GetString("Menu.Pleaseentercontent.text"));
  926. // return;
  927. //}
  928. //DataGridViewRow row = new DataGridViewRow();
  929. //row.Cells.Add(CreateTextBoxCell(this.textBox9.Text, "name"));
  930. //row.Cells.Add(CreateTextBoxCell(this.textBox8.Text, "content"));
  931. //row.Cells.Add(CreateButtonCell(PdnResources.GetString("Menu.Edit.Delete.Text"), "delete"));
  932. //this.dataGridView1.Rows.Add(row);
  933. ////选中最新添加的那一条
  934. //this.dataGridView1.ClearSelection();
  935. //this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Selected = true;
  936. ////清空输入框
  937. //this.textBox9.Text = "";
  938. //this.textBox8.Text = "";
  939. }
  940. /// <summary>
  941. /// 添加内容单元格
  942. /// </summary>
  943. /// <param name="text"></param>
  944. /// <param name="tag"></param>
  945. /// <returns></returns>
  946. private DataGridViewTextBoxCell CreateTextBoxCell(string text, object tag)
  947. {
  948. DataGridViewTextBoxCell textboxcell = new DataGridViewTextBoxCell();
  949. textboxcell.Value = text;
  950. textboxcell.Tag = tag;
  951. return textboxcell;
  952. }
  953. /// <summary>
  954. /// 添加按钮单元格
  955. /// </summary>
  956. /// <param name="text"></param>
  957. /// <param name="tag"></param>
  958. /// <returns></returns>
  959. public DataGridViewButtonCell CreateButtonCell(string text, object tag)
  960. {
  961. DataGridViewButtonCell buttonCell = new DataGridViewButtonCell();
  962. buttonCell.Value = text;
  963. buttonCell.Tag = tag;
  964. return buttonCell;
  965. }
  966. /// <summary>
  967. /// 点击datagridview的删除按钮
  968. /// </summary>
  969. /// <param name="sender"></param>
  970. /// <param name="e"></param>
  971. private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
  972. {
  973. var senderGrid = (DataGridView)sender;
  974. //if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn &&
  975. // e.RowIndex >= 0)
  976. //this.dataGridView1.Rows.Remove(this.dataGridView1.Rows[e.RowIndex]);
  977. }
  978. /// <summary>
  979. /// 配置书签按钮
  980. /// </summary>
  981. /// <param name="sender"></param>
  982. /// <param name="e"></param>
  983. private void button5_Click(object sender, EventArgs e)
  984. {
  985. BookmarkConfigDialog bookmarkConfigDialog = new BookmarkConfigDialog(this.analyzeClassify, this._languageName);
  986. bookmarkConfigDialog.StartPosition = FormStartPosition.CenterParent;
  987. bookmarkConfigDialog.ShowDialog();
  988. }
  989. private void AutoAnalysisReportDialog_Load(object sender, EventArgs e)
  990. {
  991. if(AutoExportFlag)
  992. {
  993. tmrAutoExport.Enabled = true;
  994. tmrAutoExport.Interval = 1000;
  995. }
  996. }
  997. private void tmrAutoExport_Tick(object sender, EventArgs e)
  998. {
  999. tmrAutoExport.Enabled = false;
  1000. this.Invoke(new Action(() =>
  1001. {
  1002. RunExportReport();
  1003. }));
  1004. }
  1005. }
  1006. }