MeasureSettingDialog.cs 112 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286
  1. using SmartCoalApplication.Core;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11. using SmartCoalApplication.Base.AutoMeasure;
  12. using System.Xml;
  13. using System.Xml.Linq;
  14. using System.IO;
  15. using NPOI.XSSF.UserModel;
  16. using NPOI.HSSF.UserModel;
  17. using SmartCoalApplication.Base.MeasureModel;
  18. using SmartCoalApplication.Base.CommTool;
  19. using SmartCoalApplication.Core.DbOpreate.DbModel;
  20. using SmartCoalApplication.Resources;
  21. using Resources;
  22. using SmartCoalApplication.Core.CustomControl;
  23. using SmartCoalApplication.Setup;
  24. using SmartCoalApplication.Base.FunctionModel;
  25. using System.Text.RegularExpressions;
  26. using System.Dynamic;
  27. //using NPOI.SS.UserModel;
  28. //using NPOI.HSSF.Util;
  29. namespace SmartCoalApplication.MeasureProcedure
  30. {
  31. internal partial class MeasureSettingDialog : PdnBaseForm
  32. {
  33. private List<Rules> rules = new List<Rules>();//規程列表
  34. private AppWorkspace appWorkspace;
  35. private int index = new int();
  36. private MeasureMaintenanceTypeList measureMaintenanceTypeList;
  37. private List<MeasureMaintenanceFormula> everyFourmulaList = new List<MeasureMaintenanceFormula>();
  38. private int copyNum = 1;
  39. private string copyName = string.Empty;
  40. #region Windows Form Designer generated code
  41. /// <summary>
  42. /// Required method for Designer support - do not modify
  43. /// the contents of this method with the code editor.
  44. /// </summary>
  45. private System.Windows.Forms.GroupBox groupBox1;
  46. private System.Windows.Forms.Button buttonDetermine;
  47. private System.Windows.Forms.Button buttonClose;
  48. private System.Windows.Forms.GroupBox groupBox2;
  49. private System.Windows.Forms.GroupBox groupBox3;
  50. private NewTextBox textBeizhu;
  51. private NewTextBox textMingcheng;
  52. private System.Windows.Forms.Label label2;
  53. private System.Windows.Forms.Label label1;
  54. private System.Windows.Forms.GroupBox groupBox4;
  55. private NewTextBox textLiaohao;
  56. private System.Windows.Forms.Label label12;
  57. private System.Windows.Forms.Label label11;
  58. private System.Windows.Forms.Label label10;
  59. private System.Windows.Forms.Label label9;
  60. private System.Windows.Forms.Label label8;
  61. private System.Windows.Forms.Label label7;
  62. private System.Windows.Forms.Label label6;
  63. private System.Windows.Forms.Label label5;
  64. private System.Windows.Forms.Label label4;
  65. private System.Windows.Forms.Label label3;
  66. private System.Windows.Forms.GroupBox groupBox5;
  67. private System.Windows.Forms.GroupBox groupBox6;
  68. private System.Windows.Forms.Label label13;
  69. private System.Windows.Forms.Label label14;
  70. private NewTextBox textPihao;
  71. private System.Windows.Forms.ComboBox comboZhichengbie;
  72. private System.Windows.Forms.ComboBox comboShiyongchangqu;
  73. private System.Windows.Forms.ComboBox comboShiyanshi;
  74. private System.Windows.Forms.ComboBox comboBanci;
  75. private NewTextBox textDanhao;
  76. private System.Windows.Forms.TextBox textDanweiPosition;
  77. private System.Windows.Forms.TextBox textDianduxianbiePosition;
  78. private System.Windows.Forms.TextBox textCengbiePosition;
  79. private System.Windows.Forms.TextBox textPihaoPosition;
  80. private System.Windows.Forms.TextBox textDanhaoPosition;
  81. private System.Windows.Forms.TextBox textZhichengbiePosition;
  82. private System.Windows.Forms.TextBox textShiyongchangquPosition;
  83. private System.Windows.Forms.TextBox textShiyanshiPosition;
  84. private System.Windows.Forms.TextBox textBanciPosition;
  85. private System.Windows.Forms.TextBox textLiaohaoPosition;
  86. private System.Windows.Forms.Label label24;
  87. private System.Windows.Forms.Label label23;
  88. private System.Windows.Forms.Label label22;
  89. private System.Windows.Forms.Label label21;
  90. private System.Windows.Forms.Label label20;
  91. private System.Windows.Forms.Label label19;
  92. private System.Windows.Forms.Label label18;
  93. private System.Windows.Forms.Label label17;
  94. private System.Windows.Forms.Label label16;
  95. private System.Windows.Forms.Label label15;
  96. private System.Windows.Forms.TextBox textDanwei;
  97. private System.Windows.Forms.Button buttonChooseModel;
  98. private System.Windows.Forms.TextBox textModel;
  99. private System.Windows.Forms.TextBox textOutNumber;
  100. private System.Windows.Forms.ListBox listRules;
  101. private System.Windows.Forms.GroupBox groupOutInfo;
  102. private System.Windows.Forms.ComboBox comboCengbie;
  103. private System.Windows.Forms.Panel panelOutInfo;
  104. private void InitializeComponent()
  105. {
  106. this.groupBox1 = new System.Windows.Forms.GroupBox();
  107. this.button2 = new System.Windows.Forms.Button();
  108. this.groupBox5 = new System.Windows.Forms.GroupBox();
  109. this.buttonDetermine = new System.Windows.Forms.Button();
  110. this.buttonClose = new System.Windows.Forms.Button();
  111. this.groupBox2 = new System.Windows.Forms.GroupBox();
  112. this.buttonDelete = new System.Windows.Forms.Button();
  113. this.buttonCopy = new System.Windows.Forms.Button();
  114. this.buttonAdd = new System.Windows.Forms.Button();
  115. this.buttonSetUp = new System.Windows.Forms.Button();
  116. this.listRules = new System.Windows.Forms.ListBox();
  117. this.groupBox3 = new System.Windows.Forms.GroupBox();
  118. this.comboBox2 = new System.Windows.Forms.ComboBox();
  119. this.label26 = new System.Windows.Forms.Label();
  120. this.comboBox1 = new System.Windows.Forms.ComboBox();
  121. this.label25 = new System.Windows.Forms.Label();
  122. this.textBeizhu = new SmartCoalApplication.Core.CustomControl.NewTextBox();
  123. this.textMingcheng = new SmartCoalApplication.Core.CustomControl.NewTextBox();
  124. this.label2 = new System.Windows.Forms.Label();
  125. this.label1 = new System.Windows.Forms.Label();
  126. this.groupBox4 = new System.Windows.Forms.GroupBox();
  127. this.labelNowDate = new System.Windows.Forms.Label();
  128. this.textBoxDatePos = new System.Windows.Forms.TextBox();
  129. this.labelDatePos = new System.Windows.Forms.Label();
  130. this.labelDate = new System.Windows.Forms.Label();
  131. this.comboDianduxianbie = new SmartCoalApplication.Core.CustomControl.NewTextBox();
  132. this.comboCengbie = new System.Windows.Forms.ComboBox();
  133. this.textDanweiPosition = new System.Windows.Forms.TextBox();
  134. this.textDianduxianbiePosition = new System.Windows.Forms.TextBox();
  135. this.textCengbiePosition = new System.Windows.Forms.TextBox();
  136. this.textPihaoPosition = new System.Windows.Forms.TextBox();
  137. this.textDanhaoPosition = new System.Windows.Forms.TextBox();
  138. this.textZhichengbiePosition = new System.Windows.Forms.TextBox();
  139. this.textShiyongchangquPosition = new System.Windows.Forms.TextBox();
  140. this.textShiyanshiPosition = new System.Windows.Forms.TextBox();
  141. this.textBanciPosition = new System.Windows.Forms.TextBox();
  142. this.textLiaohaoPosition = new System.Windows.Forms.TextBox();
  143. this.label24 = new System.Windows.Forms.Label();
  144. this.label23 = new System.Windows.Forms.Label();
  145. this.label22 = new System.Windows.Forms.Label();
  146. this.label21 = new System.Windows.Forms.Label();
  147. this.label20 = new System.Windows.Forms.Label();
  148. this.label19 = new System.Windows.Forms.Label();
  149. this.label18 = new System.Windows.Forms.Label();
  150. this.label17 = new System.Windows.Forms.Label();
  151. this.label16 = new System.Windows.Forms.Label();
  152. this.label15 = new System.Windows.Forms.Label();
  153. this.textDanwei = new System.Windows.Forms.TextBox();
  154. this.textPihao = new SmartCoalApplication.Core.CustomControl.NewTextBox();
  155. this.comboZhichengbie = new System.Windows.Forms.ComboBox();
  156. this.comboShiyongchangqu = new System.Windows.Forms.ComboBox();
  157. this.comboShiyanshi = new System.Windows.Forms.ComboBox();
  158. this.comboBanci = new System.Windows.Forms.ComboBox();
  159. this.textDanhao = new SmartCoalApplication.Core.CustomControl.NewTextBox();
  160. this.textLiaohao = new SmartCoalApplication.Core.CustomControl.NewTextBox();
  161. this.label12 = new System.Windows.Forms.Label();
  162. this.label11 = new System.Windows.Forms.Label();
  163. this.label10 = new System.Windows.Forms.Label();
  164. this.label9 = new System.Windows.Forms.Label();
  165. this.label8 = new System.Windows.Forms.Label();
  166. this.label7 = new System.Windows.Forms.Label();
  167. this.label6 = new System.Windows.Forms.Label();
  168. this.label5 = new System.Windows.Forms.Label();
  169. this.label4 = new System.Windows.Forms.Label();
  170. this.label3 = new System.Windows.Forms.Label();
  171. this.groupBox6 = new System.Windows.Forms.GroupBox();
  172. this.button1 = new System.Windows.Forms.Button();
  173. this.buttonChooseModel = new System.Windows.Forms.Button();
  174. this.textModel = new System.Windows.Forms.TextBox();
  175. this.textOutNumber = new System.Windows.Forms.TextBox();
  176. this.label13 = new System.Windows.Forms.Label();
  177. this.label14 = new System.Windows.Forms.Label();
  178. this.groupOutInfo = new System.Windows.Forms.GroupBox();
  179. this.panel1 = new System.Windows.Forms.Panel();
  180. this.panelOutInfo = new System.Windows.Forms.Panel();
  181. this.groupBox1.SuspendLayout();
  182. this.groupBox2.SuspendLayout();
  183. this.groupBox3.SuspendLayout();
  184. this.groupBox4.SuspendLayout();
  185. this.groupBox6.SuspendLayout();
  186. this.groupOutInfo.SuspendLayout();
  187. this.panel1.SuspendLayout();
  188. this.SuspendLayout();
  189. //
  190. // groupBox1
  191. //
  192. this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  193. | System.Windows.Forms.AnchorStyles.Right)));
  194. this.groupBox1.Controls.Add(this.button2);
  195. this.groupBox1.Controls.Add(this.groupBox5);
  196. this.groupBox1.Controls.Add(this.buttonDetermine);
  197. this.groupBox1.Controls.Add(this.buttonClose);
  198. this.groupBox1.Location = new System.Drawing.Point(12, 12);
  199. this.groupBox1.Name = "groupBox1";
  200. this.groupBox1.Size = new System.Drawing.Size(1192, 57);
  201. this.groupBox1.TabIndex = 2;
  202. this.groupBox1.TabStop = false;
  203. this.groupBox1.Text = "操作";
  204. //
  205. // button2
  206. //
  207. this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  208. this.button2.Location = new System.Drawing.Point(937, 20);
  209. this.button2.Name = "button2";
  210. this.button2.Size = new System.Drawing.Size(87, 23);
  211. this.button2.TabIndex = 13;
  212. this.button2.Text = "基礎信息設置";
  213. this.button2.UseVisualStyleBackColor = true;
  214. this.button2.Click += new System.EventHandler(this.button2_Click);
  215. //
  216. // groupBox5
  217. //
  218. this.groupBox5.AutoSize = true;
  219. this.groupBox5.Location = new System.Drawing.Point(632, 63);
  220. this.groupBox5.Name = "groupBox5";
  221. this.groupBox5.Size = new System.Drawing.Size(521, 383);
  222. this.groupBox5.TabIndex = 12;
  223. this.groupBox5.TabStop = false;
  224. this.groupBox5.Text = "輸出信息";
  225. //
  226. // buttonDetermine
  227. //
  228. this.buttonDetermine.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  229. this.buttonDetermine.Location = new System.Drawing.Point(1030, 20);
  230. this.buttonDetermine.Name = "buttonDetermine";
  231. this.buttonDetermine.Size = new System.Drawing.Size(75, 23);
  232. this.buttonDetermine.TabIndex = 2;
  233. this.buttonDetermine.Text = "確定";
  234. this.buttonDetermine.UseVisualStyleBackColor = true;
  235. this.buttonDetermine.Click += new System.EventHandler(this.buttonDetermine_Click);
  236. //
  237. // buttonClose
  238. //
  239. this.buttonClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  240. this.buttonClose.Location = new System.Drawing.Point(1111, 20);
  241. this.buttonClose.Name = "buttonClose";
  242. this.buttonClose.Size = new System.Drawing.Size(75, 23);
  243. this.buttonClose.TabIndex = 0;
  244. this.buttonClose.Text = "關閉";
  245. this.buttonClose.UseVisualStyleBackColor = true;
  246. this.buttonClose.Click += new System.EventHandler(this.buttonClose_Click);
  247. //
  248. // groupBox2
  249. //
  250. this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  251. | System.Windows.Forms.AnchorStyles.Left)));
  252. this.groupBox2.Controls.Add(this.buttonDelete);
  253. this.groupBox2.Controls.Add(this.buttonCopy);
  254. this.groupBox2.Controls.Add(this.buttonAdd);
  255. this.groupBox2.Controls.Add(this.buttonSetUp);
  256. this.groupBox2.Controls.Add(this.listRules);
  257. this.groupBox2.Location = new System.Drawing.Point(12, 75);
  258. this.groupBox2.Name = "groupBox2";
  259. this.groupBox2.Size = new System.Drawing.Size(200, 694);
  260. this.groupBox2.TabIndex = 9;
  261. this.groupBox2.TabStop = false;
  262. this.groupBox2.Text = "測量規程列表";
  263. //
  264. // buttonDelete
  265. //
  266. this.buttonDelete.Location = new System.Drawing.Point(150, 30);
  267. this.buttonDelete.Name = "buttonDelete";
  268. this.buttonDelete.Size = new System.Drawing.Size(44, 23);
  269. this.buttonDelete.TabIndex = 9;
  270. this.buttonDelete.Text = "刪除";
  271. this.buttonDelete.UseVisualStyleBackColor = true;
  272. this.buttonDelete.Click += new System.EventHandler(this.buttonDelete_Click);
  273. //
  274. // buttonCopy
  275. //
  276. this.buttonCopy.Location = new System.Drawing.Point(101, 30);
  277. this.buttonCopy.Name = "buttonCopy";
  278. this.buttonCopy.Size = new System.Drawing.Size(44, 23);
  279. this.buttonCopy.TabIndex = 8;
  280. this.buttonCopy.Text = "複製";
  281. this.buttonCopy.UseVisualStyleBackColor = true;
  282. this.buttonCopy.Click += new System.EventHandler(this.buttonCopy_Click);
  283. //
  284. // buttonAdd
  285. //
  286. this.buttonAdd.Location = new System.Drawing.Point(54, 30);
  287. this.buttonAdd.Name = "buttonAdd";
  288. this.buttonAdd.Size = new System.Drawing.Size(44, 23);
  289. this.buttonAdd.TabIndex = 7;
  290. this.buttonAdd.Text = "新增";
  291. this.buttonAdd.UseVisualStyleBackColor = true;
  292. this.buttonAdd.Click += new System.EventHandler(this.buttonAdd_Click);
  293. //
  294. // buttonSetUp
  295. //
  296. this.buttonSetUp.Location = new System.Drawing.Point(6, 30);
  297. this.buttonSetUp.Name = "buttonSetUp";
  298. this.buttonSetUp.Size = new System.Drawing.Size(44, 23);
  299. this.buttonSetUp.TabIndex = 6;
  300. this.buttonSetUp.Text = "設置";
  301. this.buttonSetUp.UseVisualStyleBackColor = true;
  302. this.buttonSetUp.Click += new System.EventHandler(this.buttonSetUp_Click);
  303. //
  304. // listRules
  305. //
  306. this.listRules.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  307. | System.Windows.Forms.AnchorStyles.Left)));
  308. this.listRules.FormattingEnabled = true;
  309. this.listRules.ItemHeight = 12;
  310. this.listRules.Location = new System.Drawing.Point(6, 60);
  311. this.listRules.Name = "listRules";
  312. this.listRules.Size = new System.Drawing.Size(188, 604);
  313. this.listRules.TabIndex = 0;
  314. this.listRules.SelectedIndexChanged += new System.EventHandler(this.listRules_SelectedChange);
  315. //
  316. // groupBox3
  317. //
  318. this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  319. | System.Windows.Forms.AnchorStyles.Right)));
  320. this.groupBox3.AutoSize = true;
  321. this.groupBox3.Controls.Add(this.comboBox2);
  322. this.groupBox3.Controls.Add(this.label26);
  323. this.groupBox3.Controls.Add(this.comboBox1);
  324. this.groupBox3.Controls.Add(this.label25);
  325. this.groupBox3.Controls.Add(this.textBeizhu);
  326. this.groupBox3.Controls.Add(this.textMingcheng);
  327. this.groupBox3.Controls.Add(this.label2);
  328. this.groupBox3.Controls.Add(this.label1);
  329. this.groupBox3.Location = new System.Drawing.Point(218, 75);
  330. this.groupBox3.Name = "groupBox3";
  331. this.groupBox3.Size = new System.Drawing.Size(437, 204);
  332. this.groupBox3.TabIndex = 10;
  333. this.groupBox3.TabStop = false;
  334. this.groupBox3.Text = "基本信息";
  335. //
  336. // comboBox2
  337. //
  338. this.comboBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  339. | System.Windows.Forms.AnchorStyles.Right)));
  340. this.comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  341. this.comboBox2.FormattingEnabled = true;
  342. this.comboBox2.Location = new System.Drawing.Point(64, 106);
  343. this.comboBox2.Name = "comboBox2";
  344. this.comboBox2.Size = new System.Drawing.Size(355, 20);
  345. this.comboBox2.TabIndex = 7;
  346. //
  347. // label26
  348. //
  349. this.label26.AutoSize = true;
  350. this.label26.Location = new System.Drawing.Point(6, 110);
  351. this.label26.Name = "label26";
  352. this.label26.Size = new System.Drawing.Size(65, 12);
  353. this.label26.TabIndex = 6;
  354. this.label26.Text = "命名規則:";
  355. //
  356. // comboBox1
  357. //
  358. this.comboBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  359. | System.Windows.Forms.AnchorStyles.Right)));
  360. this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  361. this.comboBox1.FormattingEnabled = true;
  362. this.comboBox1.Location = new System.Drawing.Point(64, 67);
  363. this.comboBox1.Name = "comboBox1";
  364. this.comboBox1.Size = new System.Drawing.Size(355, 20);
  365. this.comboBox1.TabIndex = 5;
  366. this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
  367. //
  368. // label25
  369. //
  370. this.label25.AutoSize = true;
  371. this.label25.Location = new System.Drawing.Point(6, 71);
  372. this.label25.Name = "label25";
  373. this.label25.Size = new System.Drawing.Size(41, 12);
  374. this.label25.TabIndex = 4;
  375. this.label25.Text = "标尺:";
  376. //
  377. // textBeizhu
  378. //
  379. this.textBeizhu.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  380. | System.Windows.Forms.AnchorStyles.Right)));
  381. this.textBeizhu.Location = new System.Drawing.Point(64, 145);
  382. this.textBeizhu.Multiline = true;
  383. this.textBeizhu.Name = "textBeizhu";
  384. this.textBeizhu.Size = new System.Drawing.Size(355, 35);
  385. this.textBeizhu.TabIndex = 3;
  386. //
  387. // textMingcheng
  388. //
  389. this.textMingcheng.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  390. | System.Windows.Forms.AnchorStyles.Right)));
  391. this.textMingcheng.Location = new System.Drawing.Point(64, 27);
  392. this.textMingcheng.Name = "textMingcheng";
  393. this.textMingcheng.Size = new System.Drawing.Size(355, 21);
  394. this.textMingcheng.TabIndex = 2;
  395. //
  396. // label2
  397. //
  398. this.label2.AutoSize = true;
  399. this.label2.Location = new System.Drawing.Point(6, 156);
  400. this.label2.Name = "label2";
  401. this.label2.Size = new System.Drawing.Size(41, 12);
  402. this.label2.TabIndex = 1;
  403. this.label2.Text = "備注:";
  404. //
  405. // label1
  406. //
  407. this.label1.AutoSize = true;
  408. this.label1.Location = new System.Drawing.Point(6, 31);
  409. this.label1.Name = "label1";
  410. this.label1.Size = new System.Drawing.Size(41, 12);
  411. this.label1.TabIndex = 0;
  412. this.label1.Text = "名稱:";
  413. //
  414. // groupBox4
  415. //
  416. this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  417. | System.Windows.Forms.AnchorStyles.Left)
  418. | System.Windows.Forms.AnchorStyles.Right)));
  419. this.groupBox4.AutoSize = true;
  420. this.groupBox4.Controls.Add(this.labelNowDate);
  421. this.groupBox4.Controls.Add(this.textBoxDatePos);
  422. this.groupBox4.Controls.Add(this.labelDatePos);
  423. this.groupBox4.Controls.Add(this.labelDate);
  424. this.groupBox4.Controls.Add(this.comboDianduxianbie);
  425. this.groupBox4.Controls.Add(this.comboCengbie);
  426. this.groupBox4.Controls.Add(this.textDanweiPosition);
  427. this.groupBox4.Controls.Add(this.textDianduxianbiePosition);
  428. this.groupBox4.Controls.Add(this.textCengbiePosition);
  429. this.groupBox4.Controls.Add(this.textPihaoPosition);
  430. this.groupBox4.Controls.Add(this.textDanhaoPosition);
  431. this.groupBox4.Controls.Add(this.textZhichengbiePosition);
  432. this.groupBox4.Controls.Add(this.textShiyongchangquPosition);
  433. this.groupBox4.Controls.Add(this.textShiyanshiPosition);
  434. this.groupBox4.Controls.Add(this.textBanciPosition);
  435. this.groupBox4.Controls.Add(this.textLiaohaoPosition);
  436. this.groupBox4.Controls.Add(this.label24);
  437. this.groupBox4.Controls.Add(this.label23);
  438. this.groupBox4.Controls.Add(this.label22);
  439. this.groupBox4.Controls.Add(this.label21);
  440. this.groupBox4.Controls.Add(this.label20);
  441. this.groupBox4.Controls.Add(this.label19);
  442. this.groupBox4.Controls.Add(this.label18);
  443. this.groupBox4.Controls.Add(this.label17);
  444. this.groupBox4.Controls.Add(this.label16);
  445. this.groupBox4.Controls.Add(this.label15);
  446. this.groupBox4.Controls.Add(this.textDanwei);
  447. this.groupBox4.Controls.Add(this.textPihao);
  448. this.groupBox4.Controls.Add(this.comboZhichengbie);
  449. this.groupBox4.Controls.Add(this.comboShiyongchangqu);
  450. this.groupBox4.Controls.Add(this.comboShiyanshi);
  451. this.groupBox4.Controls.Add(this.comboBanci);
  452. this.groupBox4.Controls.Add(this.textDanhao);
  453. this.groupBox4.Controls.Add(this.textLiaohao);
  454. this.groupBox4.Controls.Add(this.label12);
  455. this.groupBox4.Controls.Add(this.label11);
  456. this.groupBox4.Controls.Add(this.label10);
  457. this.groupBox4.Controls.Add(this.label9);
  458. this.groupBox4.Controls.Add(this.label8);
  459. this.groupBox4.Controls.Add(this.label7);
  460. this.groupBox4.Controls.Add(this.label6);
  461. this.groupBox4.Controls.Add(this.label5);
  462. this.groupBox4.Controls.Add(this.label4);
  463. this.groupBox4.Controls.Add(this.label3);
  464. this.groupBox4.Location = new System.Drawing.Point(218, 282);
  465. this.groupBox4.Name = "groupBox4";
  466. this.groupBox4.Size = new System.Drawing.Size(437, 487);
  467. this.groupBox4.TabIndex = 11;
  468. this.groupBox4.TabStop = false;
  469. this.groupBox4.Text = "基本信息";
  470. //
  471. // labelNowDate
  472. //
  473. this.labelNowDate.AutoSize = true;
  474. this.labelNowDate.Location = new System.Drawing.Point(83, 347);
  475. this.labelNowDate.Name = "labelNowDate";
  476. this.labelNowDate.Size = new System.Drawing.Size(53, 12);
  477. this.labelNowDate.TabIndex = 49;
  478. this.labelNowDate.Text = "当前日期";
  479. //
  480. // textBoxDatePos
  481. //
  482. this.textBoxDatePos.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  483. | System.Windows.Forms.AnchorStyles.Right)));
  484. this.textBoxDatePos.Location = new System.Drawing.Point(298, 342);
  485. this.textBoxDatePos.Name = "textBoxDatePos";
  486. this.textBoxDatePos.Size = new System.Drawing.Size(121, 21);
  487. this.textBoxDatePos.TabIndex = 47;
  488. this.textBoxDatePos.Text = "NowDateTime";
  489. //
  490. // labelDatePos
  491. //
  492. this.labelDatePos.AutoSize = true;
  493. this.labelDatePos.Location = new System.Drawing.Point(255, 345);
  494. this.labelDatePos.Name = "labelDatePos";
  495. this.labelDatePos.Size = new System.Drawing.Size(41, 12);
  496. this.labelDatePos.TabIndex = 48;
  497. this.labelDatePos.Text = "位置:";
  498. //
  499. // labelDate
  500. //
  501. this.labelDate.AutoSize = true;
  502. this.labelDate.Location = new System.Drawing.Point(3, 347);
  503. this.labelDate.Name = "labelDate";
  504. this.labelDate.Size = new System.Drawing.Size(65, 12);
  505. this.labelDate.TabIndex = 45;
  506. this.labelDate.Text = "报告日期:";
  507. //
  508. // comboDianduxianbie
  509. //
  510. this.comboDianduxianbie.Location = new System.Drawing.Point(85, 275);
  511. this.comboDianduxianbie.Name = "comboDianduxianbie";
  512. this.comboDianduxianbie.Size = new System.Drawing.Size(164, 21);
  513. this.comboDianduxianbie.TabIndex = 44;
  514. //
  515. // comboCengbie
  516. //
  517. this.comboCengbie.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  518. this.comboCengbie.FormattingEnabled = true;
  519. this.comboCengbie.Location = new System.Drawing.Point(85, 244);
  520. this.comboCengbie.Name = "comboCengbie";
  521. this.comboCengbie.Size = new System.Drawing.Size(164, 20);
  522. this.comboCengbie.TabIndex = 43;
  523. //
  524. // textDanweiPosition
  525. //
  526. this.textDanweiPosition.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  527. | System.Windows.Forms.AnchorStyles.Right)));
  528. this.textDanweiPosition.Location = new System.Drawing.Point(298, 306);
  529. this.textDanweiPosition.Name = "textDanweiPosition";
  530. this.textDanweiPosition.Size = new System.Drawing.Size(121, 21);
  531. this.textDanweiPosition.TabIndex = 42;
  532. //
  533. // textDianduxianbiePosition
  534. //
  535. this.textDianduxianbiePosition.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  536. | System.Windows.Forms.AnchorStyles.Right)));
  537. this.textDianduxianbiePosition.Location = new System.Drawing.Point(298, 275);
  538. this.textDianduxianbiePosition.Name = "textDianduxianbiePosition";
  539. this.textDianduxianbiePosition.Size = new System.Drawing.Size(121, 21);
  540. this.textDianduxianbiePosition.TabIndex = 41;
  541. //
  542. // textCengbiePosition
  543. //
  544. this.textCengbiePosition.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  545. | System.Windows.Forms.AnchorStyles.Right)));
  546. this.textCengbiePosition.Location = new System.Drawing.Point(298, 244);
  547. this.textCengbiePosition.Name = "textCengbiePosition";
  548. this.textCengbiePosition.Size = new System.Drawing.Size(121, 21);
  549. this.textCengbiePosition.TabIndex = 40;
  550. //
  551. // textPihaoPosition
  552. //
  553. this.textPihaoPosition.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  554. | System.Windows.Forms.AnchorStyles.Right)));
  555. this.textPihaoPosition.Location = new System.Drawing.Point(298, 213);
  556. this.textPihaoPosition.Name = "textPihaoPosition";
  557. this.textPihaoPosition.Size = new System.Drawing.Size(121, 21);
  558. this.textPihaoPosition.TabIndex = 39;
  559. //
  560. // textDanhaoPosition
  561. //
  562. this.textDanhaoPosition.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  563. | System.Windows.Forms.AnchorStyles.Right)));
  564. this.textDanhaoPosition.Location = new System.Drawing.Point(298, 182);
  565. this.textDanhaoPosition.Name = "textDanhaoPosition";
  566. this.textDanhaoPosition.Size = new System.Drawing.Size(121, 21);
  567. this.textDanhaoPosition.TabIndex = 38;
  568. //
  569. // textZhichengbiePosition
  570. //
  571. this.textZhichengbiePosition.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  572. | System.Windows.Forms.AnchorStyles.Right)));
  573. this.textZhichengbiePosition.Location = new System.Drawing.Point(298, 153);
  574. this.textZhichengbiePosition.Name = "textZhichengbiePosition";
  575. this.textZhichengbiePosition.Size = new System.Drawing.Size(121, 21);
  576. this.textZhichengbiePosition.TabIndex = 37;
  577. //
  578. // textShiyongchangquPosition
  579. //
  580. this.textShiyongchangquPosition.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  581. | System.Windows.Forms.AnchorStyles.Right)));
  582. this.textShiyongchangquPosition.Location = new System.Drawing.Point(298, 124);
  583. this.textShiyongchangquPosition.Name = "textShiyongchangquPosition";
  584. this.textShiyongchangquPosition.Size = new System.Drawing.Size(121, 21);
  585. this.textShiyongchangquPosition.TabIndex = 36;
  586. //
  587. // textShiyanshiPosition
  588. //
  589. this.textShiyanshiPosition.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  590. | System.Windows.Forms.AnchorStyles.Right)));
  591. this.textShiyanshiPosition.Location = new System.Drawing.Point(298, 95);
  592. this.textShiyanshiPosition.Name = "textShiyanshiPosition";
  593. this.textShiyanshiPosition.Size = new System.Drawing.Size(121, 21);
  594. this.textShiyanshiPosition.TabIndex = 35;
  595. //
  596. // textBanciPosition
  597. //
  598. this.textBanciPosition.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  599. | System.Windows.Forms.AnchorStyles.Right)));
  600. this.textBanciPosition.Location = new System.Drawing.Point(298, 64);
  601. this.textBanciPosition.Name = "textBanciPosition";
  602. this.textBanciPosition.Size = new System.Drawing.Size(121, 21);
  603. this.textBanciPosition.TabIndex = 34;
  604. //
  605. // textLiaohaoPosition
  606. //
  607. this.textLiaohaoPosition.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  608. | System.Windows.Forms.AnchorStyles.Right)));
  609. this.textLiaohaoPosition.Location = new System.Drawing.Point(298, 33);
  610. this.textLiaohaoPosition.Name = "textLiaohaoPosition";
  611. this.textLiaohaoPosition.Size = new System.Drawing.Size(121, 21);
  612. this.textLiaohaoPosition.TabIndex = 33;
  613. //
  614. // label24
  615. //
  616. this.label24.AutoSize = true;
  617. this.label24.Location = new System.Drawing.Point(255, 314);
  618. this.label24.Name = "label24";
  619. this.label24.Size = new System.Drawing.Size(41, 12);
  620. this.label24.TabIndex = 32;
  621. this.label24.Text = "位置:";
  622. //
  623. // label23
  624. //
  625. this.label23.AutoSize = true;
  626. this.label23.Location = new System.Drawing.Point(255, 278);
  627. this.label23.Name = "label23";
  628. this.label23.Size = new System.Drawing.Size(41, 12);
  629. this.label23.TabIndex = 31;
  630. this.label23.Text = "位置:";
  631. //
  632. // label22
  633. //
  634. this.label22.AutoSize = true;
  635. this.label22.Location = new System.Drawing.Point(255, 247);
  636. this.label22.Name = "label22";
  637. this.label22.Size = new System.Drawing.Size(41, 12);
  638. this.label22.TabIndex = 30;
  639. this.label22.Text = "位置:";
  640. //
  641. // label21
  642. //
  643. this.label21.AutoSize = true;
  644. this.label21.Location = new System.Drawing.Point(255, 216);
  645. this.label21.Name = "label21";
  646. this.label21.Size = new System.Drawing.Size(41, 12);
  647. this.label21.TabIndex = 29;
  648. this.label21.Text = "位置:";
  649. //
  650. // label20
  651. //
  652. this.label20.AutoSize = true;
  653. this.label20.Location = new System.Drawing.Point(255, 185);
  654. this.label20.Name = "label20";
  655. this.label20.Size = new System.Drawing.Size(41, 12);
  656. this.label20.TabIndex = 28;
  657. this.label20.Text = "位置:";
  658. //
  659. // label19
  660. //
  661. this.label19.AutoSize = true;
  662. this.label19.Location = new System.Drawing.Point(255, 156);
  663. this.label19.Name = "label19";
  664. this.label19.Size = new System.Drawing.Size(41, 12);
  665. this.label19.TabIndex = 27;
  666. this.label19.Text = "位置:";
  667. //
  668. // label18
  669. //
  670. this.label18.AutoSize = true;
  671. this.label18.Location = new System.Drawing.Point(255, 127);
  672. this.label18.Name = "label18";
  673. this.label18.Size = new System.Drawing.Size(41, 12);
  674. this.label18.TabIndex = 26;
  675. this.label18.Text = "位置:";
  676. //
  677. // label17
  678. //
  679. this.label17.AutoSize = true;
  680. this.label17.Location = new System.Drawing.Point(255, 98);
  681. this.label17.Name = "label17";
  682. this.label17.Size = new System.Drawing.Size(41, 12);
  683. this.label17.TabIndex = 25;
  684. this.label17.Text = "位置:";
  685. //
  686. // label16
  687. //
  688. this.label16.AutoSize = true;
  689. this.label16.Location = new System.Drawing.Point(255, 67);
  690. this.label16.Name = "label16";
  691. this.label16.Size = new System.Drawing.Size(41, 12);
  692. this.label16.TabIndex = 24;
  693. this.label16.Text = "位置:";
  694. //
  695. // label15
  696. //
  697. this.label15.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  698. | System.Windows.Forms.AnchorStyles.Right)));
  699. this.label15.AutoSize = true;
  700. this.label15.Location = new System.Drawing.Point(255, 36);
  701. this.label15.Name = "label15";
  702. this.label15.Size = new System.Drawing.Size(41, 12);
  703. this.label15.TabIndex = 23;
  704. this.label15.Text = "位置:";
  705. //
  706. // textDanwei
  707. //
  708. this.textDanwei.Location = new System.Drawing.Point(85, 309);
  709. this.textDanwei.Multiline = true;
  710. this.textDanwei.Name = "textDanwei";
  711. this.textDanwei.ReadOnly = true;
  712. this.textDanwei.Size = new System.Drawing.Size(164, 20);
  713. this.textDanwei.TabIndex = 22;
  714. //
  715. // textPihao
  716. //
  717. this.textPihao.Location = new System.Drawing.Point(85, 213);
  718. this.textPihao.Name = "textPihao";
  719. this.textPihao.Size = new System.Drawing.Size(164, 21);
  720. this.textPihao.TabIndex = 19;
  721. //
  722. // comboZhichengbie
  723. //
  724. this.comboZhichengbie.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  725. this.comboZhichengbie.FormattingEnabled = true;
  726. this.comboZhichengbie.Location = new System.Drawing.Point(85, 153);
  727. this.comboZhichengbie.Name = "comboZhichengbie";
  728. this.comboZhichengbie.Size = new System.Drawing.Size(164, 20);
  729. this.comboZhichengbie.TabIndex = 18;
  730. //
  731. // comboShiyongchangqu
  732. //
  733. this.comboShiyongchangqu.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  734. this.comboShiyongchangqu.FormattingEnabled = true;
  735. this.comboShiyongchangqu.Location = new System.Drawing.Point(85, 124);
  736. this.comboShiyongchangqu.Name = "comboShiyongchangqu";
  737. this.comboShiyongchangqu.Size = new System.Drawing.Size(164, 20);
  738. this.comboShiyongchangqu.TabIndex = 17;
  739. //
  740. // comboShiyanshi
  741. //
  742. this.comboShiyanshi.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  743. this.comboShiyanshi.FormattingEnabled = true;
  744. this.comboShiyanshi.Location = new System.Drawing.Point(85, 95);
  745. this.comboShiyanshi.Name = "comboShiyanshi";
  746. this.comboShiyanshi.Size = new System.Drawing.Size(164, 20);
  747. this.comboShiyanshi.TabIndex = 16;
  748. //
  749. // comboBanci
  750. //
  751. this.comboBanci.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  752. this.comboBanci.FormattingEnabled = true;
  753. this.comboBanci.Location = new System.Drawing.Point(85, 64);
  754. this.comboBanci.Name = "comboBanci";
  755. this.comboBanci.Size = new System.Drawing.Size(164, 20);
  756. this.comboBanci.TabIndex = 0;
  757. //
  758. // textDanhao
  759. //
  760. this.textDanhao.Location = new System.Drawing.Point(85, 182);
  761. this.textDanhao.Name = "textDanhao";
  762. this.textDanhao.Size = new System.Drawing.Size(164, 21);
  763. this.textDanhao.TabIndex = 15;
  764. //
  765. // textLiaohao
  766. //
  767. this.textLiaohao.Location = new System.Drawing.Point(85, 33);
  768. this.textLiaohao.Name = "textLiaohao";
  769. this.textLiaohao.Size = new System.Drawing.Size(164, 21);
  770. this.textLiaohao.TabIndex = 11;
  771. //
  772. // label12
  773. //
  774. this.label12.AutoSize = true;
  775. this.label12.Location = new System.Drawing.Point(27, 314);
  776. this.label12.Name = "label12";
  777. this.label12.Size = new System.Drawing.Size(41, 12);
  778. this.label12.TabIndex = 10;
  779. this.label12.Text = "單位:";
  780. //
  781. // label11
  782. //
  783. this.label11.AutoSize = true;
  784. this.label11.Location = new System.Drawing.Point(3, 278);
  785. this.label11.Name = "label11";
  786. this.label11.Size = new System.Drawing.Size(65, 12);
  787. this.label11.TabIndex = 9;
  788. this.label11.Text = "電鍍綫別:";
  789. //
  790. // label10
  791. //
  792. this.label10.AutoSize = true;
  793. this.label10.Location = new System.Drawing.Point(27, 247);
  794. this.label10.Name = "label10";
  795. this.label10.Size = new System.Drawing.Size(41, 12);
  796. this.label10.TabIndex = 8;
  797. this.label10.Text = "層別:";
  798. //
  799. // label9
  800. //
  801. this.label9.AutoSize = true;
  802. this.label9.Location = new System.Drawing.Point(27, 216);
  803. this.label9.Name = "label9";
  804. this.label9.Size = new System.Drawing.Size(41, 12);
  805. this.label9.TabIndex = 7;
  806. this.label9.Text = "批號:";
  807. //
  808. // label8
  809. //
  810. this.label8.AutoSize = true;
  811. this.label8.Location = new System.Drawing.Point(27, 185);
  812. this.label8.Name = "label8";
  813. this.label8.Size = new System.Drawing.Size(41, 12);
  814. this.label8.TabIndex = 6;
  815. this.label8.Text = "單號:";
  816. //
  817. // label7
  818. //
  819. this.label7.AutoSize = true;
  820. this.label7.Location = new System.Drawing.Point(12, 156);
  821. this.label7.Name = "label7";
  822. this.label7.Size = new System.Drawing.Size(53, 12);
  823. this.label7.TabIndex = 5;
  824. this.label7.Text = "製成別:";
  825. //
  826. // label6
  827. //
  828. this.label6.AutoSize = true;
  829. this.label6.Location = new System.Drawing.Point(0, 127);
  830. this.label6.Name = "label6";
  831. this.label6.Size = new System.Drawing.Size(65, 12);
  832. this.label6.TabIndex = 4;
  833. this.label6.Text = "使用廠區:";
  834. //
  835. // label5
  836. //
  837. this.label5.AutoSize = true;
  838. this.label5.Location = new System.Drawing.Point(12, 98);
  839. this.label5.Name = "label5";
  840. this.label5.Size = new System.Drawing.Size(53, 12);
  841. this.label5.TabIndex = 3;
  842. this.label5.Text = "實驗室:";
  843. //
  844. // label4
  845. //
  846. this.label4.AutoSize = true;
  847. this.label4.Location = new System.Drawing.Point(27, 67);
  848. this.label4.Name = "label4";
  849. this.label4.Size = new System.Drawing.Size(41, 12);
  850. this.label4.TabIndex = 2;
  851. this.label4.Text = "班次:";
  852. //
  853. // label3
  854. //
  855. this.label3.AutoSize = true;
  856. this.label3.Location = new System.Drawing.Point(27, 36);
  857. this.label3.Name = "label3";
  858. this.label3.Size = new System.Drawing.Size(41, 12);
  859. this.label3.TabIndex = 1;
  860. this.label3.Text = "料號:";
  861. //
  862. // groupBox6
  863. //
  864. this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
  865. this.groupBox6.AutoSize = true;
  866. this.groupBox6.Controls.Add(this.button1);
  867. this.groupBox6.Controls.Add(this.buttonChooseModel);
  868. this.groupBox6.Controls.Add(this.textModel);
  869. this.groupBox6.Controls.Add(this.textOutNumber);
  870. this.groupBox6.Controls.Add(this.label13);
  871. this.groupBox6.Controls.Add(this.label14);
  872. this.groupBox6.Location = new System.Drawing.Point(662, 652);
  873. this.groupBox6.Name = "groupBox6";
  874. this.groupBox6.Size = new System.Drawing.Size(542, 117);
  875. this.groupBox6.TabIndex = 13;
  876. this.groupBox6.TabStop = false;
  877. this.groupBox6.Text = "其他信息";
  878. //
  879. // button1
  880. //
  881. this.button1.Location = new System.Drawing.Point(485, 59);
  882. this.button1.Name = "button1";
  883. this.button1.Size = new System.Drawing.Size(44, 23);
  884. this.button1.TabIndex = 15;
  885. this.button1.Text = "打开";
  886. this.button1.UseVisualStyleBackColor = true;
  887. this.button1.Click += new System.EventHandler(this.button1_Click);
  888. //
  889. // buttonChooseModel
  890. //
  891. this.buttonChooseModel.Location = new System.Drawing.Point(435, 59);
  892. this.buttonChooseModel.Name = "buttonChooseModel";
  893. this.buttonChooseModel.Size = new System.Drawing.Size(44, 23);
  894. this.buttonChooseModel.TabIndex = 14;
  895. this.buttonChooseModel.Text = "選擇";
  896. this.buttonChooseModel.UseVisualStyleBackColor = true;
  897. this.buttonChooseModel.Click += new System.EventHandler(this.buttonChooseModel_Click);
  898. //
  899. // textModel
  900. //
  901. this.textModel.Location = new System.Drawing.Point(114, 61);
  902. this.textModel.Multiline = true;
  903. this.textModel.Name = "textModel";
  904. this.textModel.ReadOnly = true;
  905. this.textModel.Size = new System.Drawing.Size(305, 32);
  906. this.textModel.TabIndex = 13;
  907. //
  908. // textOutNumber
  909. //
  910. this.textOutNumber.Location = new System.Drawing.Point(114, 24);
  911. this.textOutNumber.Name = "textOutNumber";
  912. this.textOutNumber.Size = new System.Drawing.Size(149, 21);
  913. this.textOutNumber.TabIndex = 12;
  914. this.textOutNumber.Text = "5";
  915. //
  916. // label13
  917. //
  918. this.label13.AutoSize = true;
  919. this.label13.Location = new System.Drawing.Point(6, 71);
  920. this.label13.Name = "label13";
  921. this.label13.Size = new System.Drawing.Size(65, 12);
  922. this.label13.TabIndex = 1;
  923. this.label13.Text = "選擇模板:";
  924. //
  925. // label14
  926. //
  927. this.label14.AutoSize = true;
  928. this.label14.Location = new System.Drawing.Point(6, 30);
  929. this.label14.Name = "label14";
  930. this.label14.Size = new System.Drawing.Size(89, 12);
  931. this.label14.TabIndex = 0;
  932. this.label14.Text = "輸出圖片個數:";
  933. //
  934. // groupOutInfo
  935. //
  936. this.groupOutInfo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  937. | System.Windows.Forms.AnchorStyles.Right)));
  938. this.groupOutInfo.Controls.Add(this.panel1);
  939. this.groupOutInfo.Location = new System.Drawing.Point(662, 75);
  940. this.groupOutInfo.Name = "groupOutInfo";
  941. this.groupOutInfo.Size = new System.Drawing.Size(542, 579);
  942. this.groupOutInfo.TabIndex = 14;
  943. this.groupOutInfo.TabStop = false;
  944. this.groupOutInfo.Text = "輸出信息";
  945. //
  946. // panel1
  947. //
  948. this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  949. | System.Windows.Forms.AnchorStyles.Left)
  950. | System.Windows.Forms.AnchorStyles.Right)));
  951. this.panel1.AutoScroll = true;
  952. this.panel1.Controls.Add(this.panelOutInfo);
  953. this.panel1.Location = new System.Drawing.Point(6, 13);
  954. this.panel1.Name = "panel1";
  955. this.panel1.Size = new System.Drawing.Size(530, 560);
  956. this.panel1.TabIndex = 1;
  957. //
  958. // panelOutInfo
  959. //
  960. this.panelOutInfo.AutoSize = true;
  961. this.panelOutInfo.Location = new System.Drawing.Point(1, 0);
  962. this.panelOutInfo.Name = "panelOutInfo";
  963. this.panelOutInfo.Size = new System.Drawing.Size(527, 392);
  964. this.panelOutInfo.TabIndex = 0;
  965. //
  966. // MeasureSettingDialog
  967. //
  968. this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
  969. this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  970. this.ClientSize = new System.Drawing.Size(1211, 774);
  971. this.Controls.Add(this.groupBox6);
  972. this.Controls.Add(this.groupBox4);
  973. this.Controls.Add(this.groupOutInfo);
  974. this.Controls.Add(this.groupBox3);
  975. this.Controls.Add(this.groupBox2);
  976. this.Controls.Add(this.groupBox1);
  977. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
  978. this.MaximizeBox = false;
  979. this.MinimizeBox = false;
  980. this.Name = "MeasureSettingDialog";
  981. this.Text = "设置测试规程";
  982. this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
  983. this.Load += new System.EventHandler(this.MeasureSettingDialog_Load);
  984. this.Resize += new System.EventHandler(this.MeasureSettingDialog_Resize);
  985. this.Controls.SetChildIndex(this.groupBox1, 0);
  986. this.Controls.SetChildIndex(this.groupBox2, 0);
  987. this.Controls.SetChildIndex(this.groupBox3, 0);
  988. this.Controls.SetChildIndex(this.groupOutInfo, 0);
  989. this.Controls.SetChildIndex(this.groupBox4, 0);
  990. this.Controls.SetChildIndex(this.groupBox6, 0);
  991. this.groupBox1.ResumeLayout(false);
  992. this.groupBox1.PerformLayout();
  993. this.groupBox2.ResumeLayout(false);
  994. this.groupBox3.ResumeLayout(false);
  995. this.groupBox3.PerformLayout();
  996. this.groupBox4.ResumeLayout(false);
  997. this.groupBox4.PerformLayout();
  998. this.groupBox6.ResumeLayout(false);
  999. this.groupBox6.PerformLayout();
  1000. this.groupOutInfo.ResumeLayout(false);
  1001. this.panel1.ResumeLayout(false);
  1002. this.panel1.PerformLayout();
  1003. this.ResumeLayout(false);
  1004. this.PerformLayout();
  1005. }
  1006. #endregion
  1007. public const int WM_NCLBUTTONDBLCLK = 0xA3;
  1008. const int WM_NCLBUTTONDOWN = 0x00A1;
  1009. const int HTCAPTION = 2;
  1010. protected override void WndProc(ref Message m)
  1011. {
  1012. if (m.Msg == WM_NCLBUTTONDOWN && m.WParam.ToInt32() == HTCAPTION)
  1013. return;
  1014. if (m.Msg == WM_NCLBUTTONDBLCLK)
  1015. return;
  1016. base.WndProc(ref m);
  1017. }
  1018. /// <summary>
  1019. /// 生成随机纯字母随机数
  1020. /// </summary>
  1021. /// <param name="Length">生成长度</param>
  1022. /// <param name="Sleep">是否要在生成前将当前线程阻止以避免重复</param>
  1023. /// <returns></returns>
  1024. public static string Str_char(int Length, bool Sleep)
  1025. {
  1026. if (Sleep) System.Threading.Thread.Sleep(3);
  1027. char[] Pattern = new char[] { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };
  1028. string result = "";
  1029. int n = Pattern.Length;
  1030. System.Random random = new Random(~unchecked((int)DateTime.Now.Ticks));
  1031. for (int i = 0; i < Length; i++)
  1032. {
  1033. int rnd = random.Next(0, n);
  1034. result += Pattern[rnd];
  1035. }
  1036. return result;
  1037. }
  1038. public MeasureSettingDialog(AppWorkspace appWorkspace)
  1039. {
  1040. //var sssfilePath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\basicTreeData.xml";
  1041. //var measureMaintenanceTreeData = XmlSerializeHelper.DESerializer<MeasureMaintenanceTreeData>(FileOperationHelper.ReadStringFromFile(sssfilePath, FileMode.Open));
  1042. //foreach (var abc in measureMaintenanceTreeData.MeasureMaintenanceTreeDataList)
  1043. //{
  1044. // foreach (var bcd in abc.MeasureMaintenanceTreeSpecificSonDataList)
  1045. // {
  1046. // for (int i = 0; i < bcd.MeasureMaintenanceTreeSpecificFormulaDataList.Count; i++)
  1047. // {
  1048. // bcd.MeasureMaintenanceTreeSpecificFormulaDataList[i].FormulaParameterShowName = $"{bcd.MeasureMaintenanceTreeSpecificFormulaDataList[i].FormulaParameterName}({bcd.MeasureMaintenanceTreeSpecificFormulaDataList[i].FormulaParameterAliasName})";
  1049. // }
  1050. // }
  1051. //}
  1052. //string stageModelXml = XmlSerializeHelper.XmlSerialize<MeasureMaintenanceTreeData>(measureMaintenanceTreeData);
  1053. //FileOperationHelper.WriteStringToFile(stageModelXml, sssfilePath, FileMode.Create);
  1054. this.appWorkspace = appWorkspace;
  1055. InitializeComponent();
  1056. InitializeComponent2();
  1057. this.Icon = PdnInfo.AppIcon;
  1058. #region [命名规则]
  1059. comboBox2.DataSource = Program.instance.fileNameRule.NameRuleList;
  1060. comboBox2.DisplayMember = "Name";
  1061. comboBox2.SelectedIndex = -1;
  1062. #endregion
  1063. #region [标尺相关信息]
  1064. List<mic_rulers> list = Program.instance.mic_rulersAll;
  1065. comboBox1.DataSource = list;
  1066. comboBox1.DisplayMember = "ruler_name";
  1067. comboBox1.SelectedIndex = -1;
  1068. #endregion
  1069. #region [读取xml中的数据]
  1070. string filePath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceTypeList.xml";
  1071. if (!System.IO.File.Exists(filePath))
  1072. {
  1073. measureMaintenanceTypeList = new MeasureMaintenanceTypeList();
  1074. measureMaintenanceTypeList.measureMaintenanceTypeList = new List<MeasureMaintenanceType>();
  1075. }
  1076. else {
  1077. measureMaintenanceTypeList = XmlSerializeHelper.DESerializer<MeasureMaintenanceTypeList>(FileOperationHelper.ReadStringFromFile(filePath, FileMode.Open));
  1078. }
  1079. #endregion
  1080. ReadXml2();
  1081. comboShiyongchangqu.SelectedIndex = -1;
  1082. comboShiyanshi.SelectedIndex = -1;
  1083. comboCengbie.SelectedIndex = -1;
  1084. comboZhichengbie.SelectedIndex = -1;
  1085. comboBanci.SelectedIndex = -1;
  1086. this.FormClosed += new FormClosedEventHandler(formClosing);
  1087. this.MaximizedBounds = Screen.PrimaryScreen.WorkingArea;//在窗体初始化后添加一句代码
  1088. }
  1089. private void InitializeComponent2()
  1090. {
  1091. this.Text = PdnResources.GetString("NewSetTestProcedure");
  1092. this.groupBox1.Text = PdnResources.GetString("NewOperation");
  1093. this.groupBox5.Text = PdnResources.GetString("NewOutputInformation");
  1094. this.buttonDetermine.Text = PdnResources.GetString("NewConfirm");
  1095. this.buttonClose.Text = PdnResources.GetString("NewClosing");
  1096. this.groupBox2.Text = PdnResources.GetString("NewListSurveyProcedures");
  1097. this.buttonDelete.Text = PdnResources.GetString("NewDelete");
  1098. this.buttonCopy.Text = PdnResources.GetString("NewCopy");
  1099. this.buttonAdd.Text = PdnResources.GetString("NewAdd");
  1100. this.buttonSetUp.Text = PdnResources.GetString("NewSetting");
  1101. this.groupBox3.Text = PdnResources.GetString("NewEssentialInformation");
  1102. this.label25.Text = PdnResources.GetString("NewRuler");
  1103. this.label2.Text = PdnResources.GetString("NewRemark") + ":";
  1104. this.label1.Text = PdnResources.GetString("NewName") + ":";
  1105. this.groupBox4.Text = PdnResources.GetString("NewEssentialInformation");
  1106. this.label24.Text = PdnResources.GetString("NewPosition") + ":";
  1107. this.label23.Text = PdnResources.GetString("NewPosition") + ":";
  1108. this.label22.Text = PdnResources.GetString("NewPosition") + ":";
  1109. this.label21.Text = PdnResources.GetString("NewPosition") + ":";
  1110. this.label20.Text = PdnResources.GetString("NewPosition") + ":";
  1111. this.label19.Text = PdnResources.GetString("NewPosition") + ":";
  1112. this.label18.Text = PdnResources.GetString("NewPosition") + ":";
  1113. this.label17.Text = PdnResources.GetString("NewPosition") + ":";
  1114. this.label16.Text = PdnResources.GetString("NewPosition") + ":";
  1115. this.label15.Text = PdnResources.GetString("NewPosition") + ":";
  1116. this.label12.Text = PdnResources.GetString("NewUnit") + ":";
  1117. this.label11.Text = PdnResources.GetString("NewElectroplatingLine") + ":";
  1118. this.label10.Text = PdnResources.GetString("NewLayers") + ":";
  1119. this.label9.Text = PdnResources.GetString("NewBatchNumber") + ":";
  1120. this.label8.Text = PdnResources.GetString("NewOrderNo") + ":";
  1121. this.label7.Text = PdnResources.GetString("NewMadeOf") + ":";
  1122. this.label6.Text = PdnResources.GetString("NewUseFactory") + ":";
  1123. this.label5.Text = PdnResources.GetString("NewLaboratory") + ":";
  1124. this.label4.Text = PdnResources.GetString("NewFrequency") + ":";
  1125. this.label3.Text = PdnResources.GetString("NewItemNo") + ":";
  1126. this.groupBox6.Text = PdnResources.GetString("NewOtherInformation");
  1127. this.button1.Text = PdnResources.GetString("NewOpen");
  1128. this.buttonChooseModel.Text = PdnResources.GetString("NewChoice");
  1129. this.label13.Text = PdnResources.GetString("NewSelectTemplate") + ":";
  1130. this.label14.Text = PdnResources.GetString("NewNumberOutputPictures") + ":";
  1131. this.groupOutInfo.Text = PdnResources.GetString("NewOutputInformation");
  1132. this.button2.Text = PdnResources.GetString("NewBasicInfoSetting");
  1133. this.label26.Text = PdnResources.GetString("MeasureSettingDialog.label26");
  1134. this.labelDate.Text = PdnResources.GetString("MeasureSettingDialog.labelDate") + ":";
  1135. this.labelDatePos.Text = PdnResources.GetString("MeasureSettingDialog.labelDatePos");
  1136. this.labelNowDate.Text = PdnResources.GetString("MeasureSettingDialog.textBoxDate");
  1137. }
  1138. private void formClosing(object sender, FormClosedEventArgs e)
  1139. {
  1140. //清空未命名XMl
  1141. string path = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceType\\.xml";
  1142. if (System.IO.File.Exists(path))
  1143. {
  1144. try
  1145. {
  1146. System.IO.File.Delete(path);
  1147. }
  1148. catch (Exception)
  1149. {
  1150. }
  1151. }
  1152. }
  1153. /// <summary>
  1154. /// 關閉
  1155. /// </summary>
  1156. private void buttonClose_Click(object sender, EventArgs e)
  1157. {
  1158. this.Close();
  1159. }
  1160. /// <summary>
  1161. /// 設置
  1162. /// </summary>
  1163. private void buttonSetUp_Click(object sender, EventArgs e)
  1164. {
  1165. string name;
  1166. List<MeasureMaintenanceFormula> list;
  1167. if (listRules.SelectedItem == null)
  1168. {
  1169. if (!string.IsNullOrEmpty(this.copyName))
  1170. {
  1171. name = this.copyName;
  1172. }
  1173. else {
  1174. name = string.Empty;
  1175. }
  1176. list = new List<MeasureMaintenanceFormula>();
  1177. list.AddRange(everyFourmulaList);
  1178. }
  1179. else {
  1180. name = ((MeasureMaintenanceType)listRules.SelectedItem).measureMaintenanceName;
  1181. list = ((MeasureMaintenanceType)listRules.SelectedItem).MeasureMaintenanceTreeFourthDataList;
  1182. }
  1183. MeasureSetUp form = new MeasureSetUp(name, list,this.appWorkspace);
  1184. form.TransferEvent += frm_TransEvent;
  1185. form.ShowDialog();
  1186. }
  1187. private void frm_TransEvent(List<MeasureMaintenanceFormula> list)
  1188. {
  1189. everyFourmulaList.Clear();
  1190. everyFourmulaList.AddRange(list);
  1191. if (this.listRules.SelectedItem != null)
  1192. {
  1193. var selectItem = (MeasureMaintenanceType)this.listRules.SelectedItem;
  1194. var data = measureMaintenanceTypeList.measureMaintenanceTypeList.Where(m => m.measureMaintenanceTypeId.Equals(selectItem.measureMaintenanceTypeId)).FirstOrDefault();
  1195. if (data != null)
  1196. {
  1197. data.MeasureMaintenanceTreeFourthDataList.Clear();
  1198. data.MeasureMaintenanceTreeFourthDataList.AddRange(list);
  1199. selectItem.MeasureMaintenanceTreeFourthDataList.Clear();
  1200. selectItem.MeasureMaintenanceTreeFourthDataList.AddRange(list);
  1201. }
  1202. }
  1203. OutInfoShow();
  1204. }
  1205. /// <summary>
  1206. /// 新增規程
  1207. /// </summary>
  1208. private void buttonAdd_Click(object sender, EventArgs e)
  1209. {
  1210. listRules.SelectedIndex = - 1;
  1211. this.copyName = string.Empty;
  1212. textMingcheng.Text = string.Empty;//名稱
  1213. textBeizhu.Text = string.Empty;//備注
  1214. textLiaohao.Text = string.Empty;//料號
  1215. textLiaohaoPosition.Text = "ItemNumber";
  1216. comboBanci.SelectedItem = string.Empty;//班次
  1217. textBanciPosition.Text = "DNShift";
  1218. comboShiyanshi.Text = string.Empty;//實驗室
  1219. textShiyanshiPosition.Text = "Lab";
  1220. comboShiyongchangqu.SelectedItem = string.Empty;//使用廠區
  1221. textShiyongchangquPosition.Text = "factory";
  1222. comboZhichengbie.SelectedItem = string.Empty;//製成別
  1223. textZhichengbiePosition.Text = "ProcType";
  1224. textDanhao.Text = string.Empty;//單號
  1225. textDanhaoPosition.Text = "WorkOrder";
  1226. textPihao.Text = string.Empty;//批號
  1227. textPihaoPosition.Text = "LotNumber";
  1228. comboCengbie.SelectedItem = string.Empty;//層別
  1229. textCengbiePosition.Text = "LayerType";
  1230. comboDianduxianbie.Text = string.Empty;//電鍍綫別
  1231. textDianduxianbiePosition.Text = "EplatType";
  1232. textDanwei.Text = this.appWorkspace.GetPxPerUnit()[1];//單位
  1233. textDanweiPosition.Text = "Unit";
  1234. textOutNumber.Text = "5";
  1235. textModel.Text = string.Empty;
  1236. textBoxDatePos.Text = "NowDateTime";
  1237. comboBox1.SelectedIndex = -1;
  1238. comboBox2.SelectedIndex = -1;
  1239. panelOutInfo.Controls.Clear();
  1240. everyFourmulaList.Clear();
  1241. //清空未命名XMl
  1242. string path = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceType\\.xml";
  1243. if (System.IO.File.Exists(path))
  1244. {
  1245. try
  1246. {
  1247. System.IO.File.Delete(path);
  1248. }
  1249. catch (Exception)
  1250. {
  1251. }
  1252. }
  1253. if (!buttonSetUp.Enabled || !buttonCopy.Enabled || !buttonDetermine.Enabled || !buttonDelete.Enabled)
  1254. {
  1255. buttonSetUp.Enabled = true;
  1256. buttonCopy.Enabled = true;
  1257. buttonDetermine.Enabled = true;
  1258. buttonDelete.Enabled = true;
  1259. }
  1260. }
  1261. /// <summary>
  1262. /// 確認規程
  1263. /// </summary>
  1264. private void buttonDetermine_Click(object sender, EventArgs e)
  1265. {
  1266. if (string.IsNullOrEmpty(textMingcheng.Text))
  1267. {
  1268. MessageBox.Show(PdnResources.GetString("NullName"));
  1269. return;
  1270. }
  1271. var repeatData = measureMaintenanceTypeList.measureMaintenanceTypeList.Where(m => m.measureMaintenanceName.Equals(textMingcheng.Text)).FirstOrDefault();
  1272. if (repeatData != null)
  1273. {
  1274. if (listRules.SelectedItem == null)
  1275. {
  1276. MessageBox.Show(PdnResources.GetString("RepeatName"));
  1277. return;
  1278. }
  1279. else {
  1280. var data = (MeasureMaintenanceType)listRules.SelectedItem;
  1281. if (!data.measureMaintenanceTypeId.Equals(repeatData.measureMaintenanceTypeId)) {
  1282. MessageBox.Show(PdnResources.GetString("RepeatName"));
  1283. return;
  1284. }
  1285. }
  1286. }
  1287. MeasureMaintenanceType copyData;
  1288. int index = listRules.SelectedIndex;
  1289. if (listRules.SelectedItem == null)
  1290. {
  1291. if (string.IsNullOrEmpty(textModel.Text))
  1292. {
  1293. MessageBox.Show(PdnResources.GetString("SelectModel"));
  1294. }
  1295. copyData = new MeasureMaintenanceType();
  1296. copyData.measureMaintenanceTypeId = Guid.NewGuid().ToString();
  1297. copyData.measureMaintenanceBasicDataList = new List<MeasureMaintenanceBasicData>();
  1298. MeasureMaintenanceBasicData data = new MeasureMaintenanceBasicData();
  1299. MeasureMaintenanceBasicData data1 = new MeasureMaintenanceBasicData();
  1300. MeasureMaintenanceBasicData data2 = new MeasureMaintenanceBasicData();
  1301. MeasureMaintenanceBasicData data3 = new MeasureMaintenanceBasicData();
  1302. MeasureMaintenanceBasicData data4 = new MeasureMaintenanceBasicData();
  1303. MeasureMaintenanceBasicData data5 = new MeasureMaintenanceBasicData();
  1304. MeasureMaintenanceBasicData data6 = new MeasureMaintenanceBasicData();
  1305. MeasureMaintenanceBasicData data7 = new MeasureMaintenanceBasicData();
  1306. MeasureMaintenanceBasicData data8 = new MeasureMaintenanceBasicData();
  1307. MeasureMaintenanceBasicData data9 = new MeasureMaintenanceBasicData();
  1308. MeasureMaintenanceBasicData data10 = new MeasureMaintenanceBasicData();
  1309. MeasureMaintenanceBasicData data11 = new MeasureMaintenanceBasicData();
  1310. data.measureMaintenanceBasicDataIndex = 0;
  1311. copyData.measureMaintenanceBasicDataList.Add(data);
  1312. data1.measureMaintenanceBasicDataIndex = 1;
  1313. copyData.measureMaintenanceBasicDataList.Add(data1);
  1314. data2.measureMaintenanceBasicDataIndex = 2;
  1315. copyData.measureMaintenanceBasicDataList.Add(data2);
  1316. data3.measureMaintenanceBasicDataIndex = 3;
  1317. copyData.measureMaintenanceBasicDataList.Add(data3);
  1318. data4.measureMaintenanceBasicDataIndex = 4;
  1319. copyData.measureMaintenanceBasicDataList.Add(data4);
  1320. data5.measureMaintenanceBasicDataIndex = 5;
  1321. copyData.measureMaintenanceBasicDataList.Add(data5);
  1322. data6.measureMaintenanceBasicDataIndex = 6;
  1323. copyData.measureMaintenanceBasicDataList.Add(data6);
  1324. data7.measureMaintenanceBasicDataIndex = 7;
  1325. copyData.measureMaintenanceBasicDataList.Add(data7);
  1326. data8.measureMaintenanceBasicDataIndex = 8;
  1327. copyData.measureMaintenanceBasicDataList.Add(data8);
  1328. data9.measureMaintenanceBasicDataIndex = 9;
  1329. copyData.measureMaintenanceBasicDataList.Add(data9);
  1330. data10.measureMaintenanceBasicDataIndex = 10;
  1331. copyData.measureMaintenanceBasicDataList.Add(data10);
  1332. copyData.measureMaintenanceContent = string.Empty;//備注
  1333. copyData.measureMaintenanceBasicDataList[0].measureMaintenanceBasicDataValue = string.Empty;//料號
  1334. copyData.measureMaintenanceBasicDataList[0].measureMaintenanceBasicDataPosition = "ItemNumber";
  1335. copyData.measureMaintenanceBasicDataList[1].measureMaintenanceBasicDataValue = string.Empty;//班次
  1336. copyData.measureMaintenanceBasicDataList[1].measureMaintenanceBasicDataPosition = "DNShift";
  1337. copyData.measureMaintenanceBasicDataList[2].measureMaintenanceBasicDataValue = string.Empty;//實驗室
  1338. copyData.measureMaintenanceBasicDataList[2].measureMaintenanceBasicDataPosition = "Lab";
  1339. copyData.measureMaintenanceBasicDataList[3].measureMaintenanceBasicDataValue = string.Empty;//使用廠區
  1340. copyData.measureMaintenanceBasicDataList[3].measureMaintenanceBasicDataPosition = "factory";
  1341. copyData.measureMaintenanceBasicDataList[4].measureMaintenanceBasicDataValue = string.Empty;//製成別
  1342. copyData.measureMaintenanceBasicDataList[4].measureMaintenanceBasicDataPosition = "ProcType";
  1343. copyData.measureMaintenanceBasicDataList[5].measureMaintenanceBasicDataValue = string.Empty;//單號
  1344. copyData.measureMaintenanceBasicDataList[5].measureMaintenanceBasicDataPosition = "WorkOrder";
  1345. copyData.measureMaintenanceBasicDataList[6].measureMaintenanceBasicDataValue = string.Empty;//批號
  1346. copyData.measureMaintenanceBasicDataList[6].measureMaintenanceBasicDataPosition = "LotNumber";
  1347. copyData.measureMaintenanceBasicDataList[7].measureMaintenanceBasicDataValue = string.Empty;//層別
  1348. copyData.measureMaintenanceBasicDataList[7].measureMaintenanceBasicDataPosition = "LayerType";
  1349. copyData.measureMaintenanceBasicDataList[8].measureMaintenanceBasicDataValue = string.Empty;//電鍍綫別
  1350. copyData.measureMaintenanceBasicDataList[8].measureMaintenanceBasicDataPosition = "EplatType";
  1351. copyData.measureMaintenanceBasicDataList[9].measureMaintenanceBasicDataValue = string.Empty;//單位
  1352. copyData.measureMaintenanceBasicDataList[9].measureMaintenanceBasicDataPosition = "Unit";
  1353. copyData.measureMaintenanceBasicDataList[10].measureMaintenanceBasicDataValue = string.Empty;//报告时间
  1354. copyData.measureMaintenanceBasicDataList[10].measureMaintenanceBasicDataPosition = "NowDateTime";
  1355. copyData.MeasureMaintenanceTreeFourthDataList = new List<MeasureMaintenanceFormula>();
  1356. copyData.MeasureMaintenanceTreeFourthDataList.AddRange(everyFourmulaList);
  1357. }
  1358. else
  1359. {
  1360. copyData = (MeasureMaintenanceType)listRules.SelectedItem;
  1361. if (string.IsNullOrEmpty(copyData.templateFilePath))
  1362. {
  1363. MessageBox.Show(PdnResources.GetString("SelectModel"));
  1364. }
  1365. }
  1366. copyData.measureMaintenanceName = textMingcheng.Text;//名稱
  1367. copyData.measureMaintenanceContent = textBeizhu.Text;//備注
  1368. copyData.measureMaintenanceBasicDataList[0].measureMaintenanceBasicDataValue = textLiaohao.Text;//料號
  1369. copyData.measureMaintenanceBasicDataList[0].measureMaintenanceBasicDataPosition = textLiaohaoPosition.Text;
  1370. copyData.measureMaintenanceBasicDataList[1].measureMaintenanceBasicDataValue = comboBanci.SelectedItem == null ? "": comboBanci.SelectedItem.ToString();//班次
  1371. copyData.measureMaintenanceBasicDataList[1].measureMaintenanceBasicDataPosition = textBanciPosition.Text;
  1372. copyData.measureMaintenanceBasicDataList[2].measureMaintenanceBasicDataValue = comboShiyanshi.SelectedItem == null ? "" : comboShiyanshi.SelectedItem.ToString();//實驗室
  1373. copyData.measureMaintenanceBasicDataList[2].measureMaintenanceBasicDataPosition = textShiyanshiPosition.Text;
  1374. copyData.measureMaintenanceBasicDataList[3].measureMaintenanceBasicDataValue = comboShiyongchangqu.SelectedItem == null ? "" : comboShiyongchangqu.SelectedItem.ToString();//使用廠區
  1375. copyData.measureMaintenanceBasicDataList[3].measureMaintenanceBasicDataPosition = textShiyongchangquPosition.Text;
  1376. copyData.measureMaintenanceBasicDataList[4].measureMaintenanceBasicDataValue = comboZhichengbie.SelectedItem == null ? "" : comboZhichengbie.SelectedItem.ToString();//製成別
  1377. copyData.measureMaintenanceBasicDataList[4].measureMaintenanceBasicDataPosition = textZhichengbiePosition.Text;
  1378. copyData.measureMaintenanceBasicDataList[5].measureMaintenanceBasicDataValue = textDanhao.Text;//單號
  1379. copyData.measureMaintenanceBasicDataList[5].measureMaintenanceBasicDataPosition = textDanhaoPosition.Text;
  1380. copyData.measureMaintenanceBasicDataList[6].measureMaintenanceBasicDataValue = textPihao.Text;//批號
  1381. copyData.measureMaintenanceBasicDataList[6].measureMaintenanceBasicDataPosition = textPihaoPosition.Text;
  1382. copyData.measureMaintenanceBasicDataList[7].measureMaintenanceBasicDataValue = comboCengbie.SelectedItem == null ? "" : comboCengbie.SelectedItem.ToString();//層別
  1383. copyData.measureMaintenanceBasicDataList[7].measureMaintenanceBasicDataPosition = textCengbiePosition.Text;
  1384. copyData.measureMaintenanceBasicDataList[8].measureMaintenanceBasicDataValue = comboDianduxianbie.Text;//電鍍綫別
  1385. copyData.measureMaintenanceBasicDataList[8].measureMaintenanceBasicDataPosition = textDianduxianbiePosition.Text;
  1386. copyData.measureMaintenanceBasicDataList[9].measureMaintenanceBasicDataValue = textDanwei.Text;//單位
  1387. copyData.measureMaintenanceBasicDataList[9].measureMaintenanceBasicDataPosition = textDanweiPosition.Text;
  1388. copyData.measureMaintenanceBasicDataList[10].measureMaintenanceBasicDataPosition = textBoxDatePos.Text; //报告日期
  1389. //UNDONE:由于数据问题,暂时为try-catch
  1390. //try
  1391. //{
  1392. //}
  1393. //catch
  1394. //{
  1395. // var mData = new MeasureMaintenanceBasicData();
  1396. // mData.measureMaintenanceBasicDataIndex = 10;
  1397. // mData.measureMaintenanceBasicDataPosition = "NowDateTime";
  1398. // copyData.measureMaintenanceBasicDataList.Add(mData);
  1399. //}
  1400. #region [根据语言包改写名称]
  1401. string basicFilePath;
  1402. if (Program.instance.configModel.Language == 1)
  1403. {
  1404. basicFilePath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\basicTreeDataSimple.xml";
  1405. }
  1406. else
  1407. {
  1408. basicFilePath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\basicTreeDataTraditional.xml";
  1409. }
  1410. MeasureMaintenanceTreeData basicMeasureMaintenanceTreeData = XmlSerializeHelper.DESerializer<MeasureMaintenanceTreeData>(FileOperationHelper.ReadStringFromFile(basicFilePath, FileMode.Open));
  1411. foreach (var item in copyData.MeasureMaintenanceTreeFourthDataList)
  1412. {
  1413. MeasureMaintenanceTreeSpecificData basicData;
  1414. this.appWorkspace.RecursionGetData(item.HoleTypeId, basicMeasureMaintenanceTreeData.MeasureMaintenanceTreeDataList, out basicData);
  1415. if (basicData != null)
  1416. {
  1417. item.HoleType = basicData.MeasureMaintenanceTreeSpecificName;
  1418. }
  1419. }
  1420. foreach (var item in this.everyFourmulaList)
  1421. {
  1422. MeasureMaintenanceTreeSpecificData basicData;
  1423. this.appWorkspace.RecursionGetData(item.HoleTypeId, basicMeasureMaintenanceTreeData.MeasureMaintenanceTreeDataList, out basicData);
  1424. if (basicData != null)
  1425. {
  1426. item.HoleType = basicData.MeasureMaintenanceTreeSpecificName;
  1427. }
  1428. }
  1429. #endregion
  1430. try
  1431. {
  1432. int num = Convert.ToInt32(textOutNumber.Text);
  1433. copyData.outputPicturesNum = num;
  1434. }
  1435. catch (Exception)
  1436. {
  1437. copyData.outputPicturesNum = 0;
  1438. }
  1439. //赋值文件到临时文件夹 并且一直用
  1440. string tempPath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\Temp\\";
  1441. if (!System.IO.Directory.Exists(tempPath)) {
  1442. Directory.CreateDirectory(tempPath);
  1443. }
  1444. //有变化了才复写文件
  1445. if (!textModel.Text.Equals(copyData.templateFilePath))
  1446. {
  1447. if (System.IO.File.Exists(copyData.templateFilePath))
  1448. {
  1449. //删除之前的旧文件
  1450. try
  1451. {
  1452. System.IO.File.Delete(copyData.templateFilePath);
  1453. }
  1454. catch (Exception)
  1455. {
  1456. }
  1457. }
  1458. var dateTimeStr = DateTime.Now.ToString("yyyyMMddHHmmss");
  1459. if (FileOperationHelper.CopyFile(textModel.Text, tempPath, dateTimeStr, true))
  1460. {
  1461. string[] fileName = textModel.Text.Split('\\');
  1462. tempPath += dateTimeStr + "_" + fileName[fileName.Length - 1];
  1463. copyData.templateFilePath = tempPath;
  1464. }
  1465. }
  1466. if (comboBox1.SelectedIndex != -1)
  1467. {
  1468. if (copyData.ruleMessage == null)
  1469. {
  1470. copyData.ruleMessage = new RuleMessage();
  1471. }
  1472. copyData.ruleMessage.ruleId = Program.instance.mic_rulersAll[comboBox1.SelectedIndex].id.ToString();
  1473. copyData.ruleMessage.ruleName = Program.instance.mic_rulersAll[comboBox1.SelectedIndex].ruler_name;
  1474. copyData.ruleMessage.pixelLength = Program.instance.mic_rulersAll[comboBox1.SelectedIndex].pixel_length;
  1475. copyData.ruleMessage.physicalLength = Program.instance.mic_rulersAll[comboBox1.SelectedIndex].physical_length;
  1476. copyData.ruleMessage.rulerUnits = Program.instance.mic_rulersAll[comboBox1.SelectedIndex].ruler_units;
  1477. copyData.ruleMessage.ruleGain = Program.instance.mic_rulersAll[comboBox1.SelectedIndex].gain_multiple;
  1478. }
  1479. if (comboBox2.SelectedIndex != -1)
  1480. {
  1481. var nameRuleListDetailsA = (NameRuleListDetails)this.comboBox2.SelectedItem;
  1482. copyData.NameRuleID = nameRuleListDetailsA.ID;
  1483. }
  1484. if (index == -1)
  1485. {
  1486. measureMaintenanceTypeList.measureMaintenanceTypeList.Add(copyData);
  1487. index = measureMaintenanceTypeList.measureMaintenanceTypeList.Count - 1;
  1488. }
  1489. else
  1490. {
  1491. measureMaintenanceTypeList.measureMaintenanceTypeList[index] = copyData;
  1492. }
  1493. if (!string.IsNullOrEmpty(this.copyName))
  1494. {
  1495. string oldFilePath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceType\\" + this.copyName + ".xml";
  1496. string newFilePath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceType\\" + this.textMingcheng.Text + ".xml";
  1497. if (System.IO.File.Exists(oldFilePath))
  1498. {
  1499. System.IO.FileInfo file = new System.IO.FileInfo(oldFilePath);
  1500. file.MoveTo(newFilePath);
  1501. }
  1502. }
  1503. this.copyName = string.Empty;
  1504. this.listRules.SelectedIndexChanged -= new System.EventHandler(this.listRules_SelectedChange);
  1505. listRules.DataSource = null;
  1506. listRules.DataSource = measureMaintenanceTypeList.measureMaintenanceTypeList;
  1507. listRules.DisplayMember = "measureMaintenanceName";
  1508. this.listRules.SelectedIndexChanged += new System.EventHandler(this.listRules_SelectedChange);
  1509. listRules.SelectedIndex = index;
  1510. OutInfoShow();
  1511. WriteXml();
  1512. }
  1513. /// <summary>
  1514. /// 刪除規程
  1515. /// </summary>
  1516. private void buttonDelete_Click(object sender, EventArgs e)
  1517. {
  1518. if (this.listRules.SelectedIndex == -1)
  1519. {
  1520. MessageBox.Show(PdnResources.GetString("DeleteError"));
  1521. if (this.listRules.Items.Count == 0)
  1522. {
  1523. buttonAdd_Click(null, null);
  1524. }
  1525. return;
  1526. }
  1527. DialogResult result = MessageBox.Show(PdnResources.GetString("Delete") + "?", PdnResources.GetString("DelStndard"), MessageBoxButtons.OKCancel);
  1528. if (result == DialogResult.OK)
  1529. {
  1530. var deleteItem = (MeasureMaintenanceType)this.listRules.SelectedItem;
  1531. measureMaintenanceTypeList.measureMaintenanceTypeList.Remove(deleteItem);
  1532. listRules.DataSource = null;
  1533. listRules.DataSource = measureMaintenanceTypeList.measureMaintenanceTypeList;
  1534. listRules.DisplayMember = "measureMaintenanceName";
  1535. if (measureMaintenanceTypeList.measureMaintenanceTypeList.Count > 0)
  1536. {
  1537. listRules.SelectedIndex = 0;
  1538. }
  1539. else {
  1540. buttonAdd_Click(null, null);
  1541. buttonSetUp.Enabled = false;
  1542. buttonCopy.Enabled = false;
  1543. buttonDetermine.Enabled = false;
  1544. buttonDelete.Enabled = false;
  1545. }
  1546. string filePath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceTypeList.xml";
  1547. string stageModelXml = XmlSerializeHelper.XmlSerialize<MeasureMaintenanceTypeList>(measureMaintenanceTypeList);
  1548. FileOperationHelper.WriteStringToFile(stageModelXml, filePath, FileMode.Create);
  1549. //清空未命名XMl
  1550. string path = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceType\\" + deleteItem.measureMaintenanceName + ".xml";
  1551. try
  1552. {
  1553. if (System.IO.File.Exists(path))
  1554. {
  1555. System.IO.File.Delete(path);
  1556. }
  1557. if (System.IO.File.Exists(deleteItem.templateFilePath))
  1558. {
  1559. System.IO.File.Delete(deleteItem.templateFilePath);
  1560. }
  1561. }
  1562. catch (Exception)
  1563. {
  1564. }
  1565. }
  1566. }
  1567. /// <summary>
  1568. /// 複製
  1569. /// </summary>
  1570. private void buttonCopy_Click(object sender, EventArgs e)
  1571. {
  1572. if (this.listRules.SelectedItem == null) {
  1573. return;
  1574. }
  1575. var selectedItem = (MeasureMaintenanceType)this.listRules.SelectedItem;
  1576. var copyData = new MeasureMaintenanceType();
  1577. List<MeasureMaintenanceBasicData> measureMaintenanceBasicDatas = new List<MeasureMaintenanceBasicData>();
  1578. for (int i = 0; i < selectedItem.measureMaintenanceBasicDataList.Count; i++)
  1579. {
  1580. MeasureMaintenanceBasicData measureMaintenanceFormula = new MeasureMaintenanceBasicData();
  1581. measureMaintenanceFormula.measureMaintenanceBasicDataIndex = selectedItem.measureMaintenanceBasicDataList[i].measureMaintenanceBasicDataIndex;
  1582. measureMaintenanceFormula.measureMaintenanceBasicDataPosition = selectedItem.measureMaintenanceBasicDataList[i].measureMaintenanceBasicDataPosition;
  1583. measureMaintenanceFormula.measureMaintenanceBasicDataValue = selectedItem.measureMaintenanceBasicDataList[i].measureMaintenanceBasicDataValue;
  1584. measureMaintenanceBasicDatas.Add(measureMaintenanceFormula);
  1585. }
  1586. List<MeasureMaintenanceFormula> measureMaintenanceFormulas = new List<MeasureMaintenanceFormula>();
  1587. for (int i = 0; i < selectedItem.MeasureMaintenanceTreeFourthDataList.Count; i++)
  1588. {
  1589. MeasureMaintenanceFormula measureMaintenanceFormula = new MeasureMaintenanceFormula();
  1590. measureMaintenanceFormula.FatherHoleTypeId = selectedItem.MeasureMaintenanceTreeFourthDataList[i].FatherHoleTypeId;
  1591. measureMaintenanceFormula.FormulaExpression = selectedItem.MeasureMaintenanceTreeFourthDataList[i].FormulaExpression;
  1592. measureMaintenanceFormula.FormulaExpressionLineID = selectedItem.MeasureMaintenanceTreeFourthDataList[i].FormulaExpressionLineID;
  1593. measureMaintenanceFormula.FormulaId = selectedItem.MeasureMaintenanceTreeFourthDataList[i].FormulaId;
  1594. measureMaintenanceFormula.FormulaName = selectedItem.MeasureMaintenanceTreeFourthDataList[i].FormulaName;
  1595. measureMaintenanceFormula.FormulaParentId = selectedItem.MeasureMaintenanceTreeFourthDataList[i].FormulaParentId;
  1596. measureMaintenanceFormula.HoleType = selectedItem.MeasureMaintenanceTreeFourthDataList[i].HoleType;
  1597. measureMaintenanceFormula.HoleTypeId = selectedItem.MeasureMaintenanceTreeFourthDataList[i].HoleTypeId;
  1598. measureMaintenanceFormula.isConductiveCloth = selectedItem.MeasureMaintenanceTreeFourthDataList[i].isConductiveCloth;
  1599. measureMaintenanceFormula.isFanweibuchang = selectedItem.MeasureMaintenanceTreeFourthDataList[i].isFanweibuchang;
  1600. measureMaintenanceFormula.isErzhichuli = selectedItem.MeasureMaintenanceTreeFourthDataList[i].isErzhichuli;
  1601. measureMaintenanceFormula.Specification = selectedItem.MeasureMaintenanceTreeFourthDataList[i].Specification;
  1602. measureMaintenanceFormula.TestItems = selectedItem.MeasureMaintenanceTreeFourthDataList[i].TestItems;
  1603. measureMaintenanceFormulas.Add(measureMaintenanceFormula);
  1604. }
  1605. copyData.measureMaintenanceBasicDataList.AddRange(measureMaintenanceBasicDatas);
  1606. copyData.MeasureMaintenanceTreeFourthDataList.AddRange(measureMaintenanceFormulas);
  1607. copyData.measureMaintenanceContent = selectedItem.measureMaintenanceContent;
  1608. copyData.measureMaintenanceName = selectedItem.measureMaintenanceName;
  1609. copyData.measureMaintenanceTypeId = selectedItem.measureMaintenanceTypeId;
  1610. copyData.outputPicturesNum = selectedItem.outputPicturesNum;
  1611. copyData.ruleMessage = selectedItem.ruleMessage;
  1612. copyData.templateFilePath = selectedItem.templateFilePath;
  1613. //更改顯示
  1614. textMingcheng.Text = copyData.measureMaintenanceName + "-" + copyNum;//名稱
  1615. this.copyName = textMingcheng.Text;
  1616. #region [复制检验项目]
  1617. string SourcePath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceType\\" + copyData.measureMaintenanceName + ".xml";
  1618. string DestinationPath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceType\\" + textMingcheng.Text + ".xml";
  1619. if (System.IO.File.Exists(SourcePath))
  1620. {
  1621. FileInfo flinfo = new FileInfo(SourcePath);
  1622. flinfo.CopyTo(DestinationPath);
  1623. }
  1624. #endregion
  1625. textBeizhu.Text = copyData.measureMaintenanceContent;//備注
  1626. List<int> list = Program.instance.mic_rulersAll.Select(m => m.id).ToList();
  1627. if (copyData.ruleMessage != null)
  1628. {
  1629. comboBox1.SelectedIndex = list.IndexOf(Convert.ToInt32(copyData.ruleMessage.ruleId));
  1630. }
  1631. if (!string.IsNullOrEmpty(copyData.NameRuleID))
  1632. {
  1633. List<string> dlist = Program.instance.fileNameRule.NameRuleList.Select(m => m.ID).ToList();
  1634. if (dlist.Count > 0)
  1635. {
  1636. comboBox2.SelectedIndex = dlist.IndexOf(copyData.NameRuleID);
  1637. }
  1638. else
  1639. {
  1640. comboBox2.SelectedIndex = -1;
  1641. }
  1642. }
  1643. textLiaohao.Text = copyData.measureMaintenanceBasicDataList[0].measureMaintenanceBasicDataValue;//料號
  1644. textLiaohaoPosition.Text = copyData.measureMaintenanceBasicDataList[0].measureMaintenanceBasicDataPosition;
  1645. comboBanci.SelectedItem = copyData.measureMaintenanceBasicDataList[1]. measureMaintenanceBasicDataValue;//班次
  1646. textBanciPosition.Text = copyData.measureMaintenanceBasicDataList[1].measureMaintenanceBasicDataPosition;
  1647. comboShiyanshi.SelectedItem = copyData.measureMaintenanceBasicDataList[2].measureMaintenanceBasicDataValue;//實驗室
  1648. textShiyanshiPosition.Text = copyData.measureMaintenanceBasicDataList[2].measureMaintenanceBasicDataPosition;
  1649. comboShiyongchangqu.SelectedItem = copyData.measureMaintenanceBasicDataList[3].measureMaintenanceBasicDataValue;//使用廠區
  1650. textShiyongchangquPosition.Text = copyData.measureMaintenanceBasicDataList[3].measureMaintenanceBasicDataPosition;
  1651. comboZhichengbie.SelectedItem = copyData.measureMaintenanceBasicDataList[4].measureMaintenanceBasicDataValue;//製成別
  1652. textZhichengbiePosition.Text = copyData.measureMaintenanceBasicDataList[4].measureMaintenanceBasicDataPosition;
  1653. textDanhao.Text = copyData.measureMaintenanceBasicDataList[5].measureMaintenanceBasicDataValue;//單號
  1654. textDanhaoPosition.Text = copyData.measureMaintenanceBasicDataList[5].measureMaintenanceBasicDataPosition;
  1655. textPihao.Text = copyData.measureMaintenanceBasicDataList[6].measureMaintenanceBasicDataValue;//批號
  1656. textPihaoPosition.Text = copyData.measureMaintenanceBasicDataList[6].measureMaintenanceBasicDataPosition;
  1657. comboCengbie.SelectedItem = copyData.measureMaintenanceBasicDataList[7].measureMaintenanceBasicDataValue;//層別
  1658. textCengbiePosition.Text = copyData.measureMaintenanceBasicDataList[7].measureMaintenanceBasicDataPosition;
  1659. comboDianduxianbie.Text = copyData.measureMaintenanceBasicDataList[8].measureMaintenanceBasicDataValue;//電鍍綫別
  1660. textDianduxianbiePosition.Text = copyData.measureMaintenanceBasicDataList[8].measureMaintenanceBasicDataPosition;
  1661. textDanwei.Text = copyData.measureMaintenanceBasicDataList[9].measureMaintenanceBasicDataValue;//單位
  1662. textDanweiPosition.Text = copyData.measureMaintenanceBasicDataList[9].measureMaintenanceBasicDataPosition;
  1663. textBoxDatePos.Text = copyData.measureMaintenanceBasicDataList[10].measureMaintenanceBasicDataPosition;//报告日期
  1664. textOutNumber.Text = copyData.outputPicturesNum.ToString();//輸出圖片數量
  1665. textModel.Text = copyData.templateFilePath;
  1666. listRules.SelectedIndex = -1;
  1667. this.formClosing(null, null);
  1668. }
  1669. /// <summary>
  1670. /// 加载初始化
  1671. /// </summary>2
  1672. private void MeasureSettingDialog_Load(object sender, EventArgs e)
  1673. {
  1674. listRules.DataSource = null;
  1675. listRules.DataSource = measureMaintenanceTypeList.measureMaintenanceTypeList;
  1676. listRules.DisplayMember = "measureMaintenanceName";
  1677. if (measureMaintenanceTypeList.measureMaintenanceTypeList == null || measureMaintenanceTypeList.measureMaintenanceTypeList.Count == 0)
  1678. {
  1679. buttonSetUp.Enabled = false;
  1680. buttonCopy.Enabled = false;
  1681. buttonDetermine.Enabled = false;
  1682. buttonDelete.Enabled = false;
  1683. }
  1684. }
  1685. /// <summary>
  1686. /// 点击时显示选中的内容
  1687. /// </summary>
  1688. private void listRules_SelectedChange(object sender, EventArgs e)
  1689. {
  1690. if (this.listRules.SelectedItem == null)
  1691. {
  1692. return;
  1693. }
  1694. var copyData = (MeasureMaintenanceType)this.listRules.SelectedItem;
  1695. this.copyName = string.Empty;
  1696. if (copyData.ruleMessage == null)
  1697. {
  1698. comboBox1.SelectedIndex = -1;
  1699. }
  1700. else {
  1701. List<mic_rulers> list = Program.instance.mic_rulersAll;
  1702. var ruler = list.Where(m => m.ruler_name == copyData.ruleMessage.ruleName).FirstOrDefault();
  1703. if (ruler != null)
  1704. {
  1705. comboBox1.SelectedIndex = list.IndexOf(ruler);
  1706. }
  1707. else {
  1708. comboBox1.SelectedIndex = -1;
  1709. }
  1710. }
  1711. if (!string.IsNullOrEmpty(copyData.NameRuleID))
  1712. {
  1713. List<string> dlist = Program.instance.fileNameRule.NameRuleList.Select(m => m.ID).ToList();
  1714. if (dlist.Count > 0)
  1715. {
  1716. comboBox2.SelectedIndex = dlist.IndexOf(copyData.NameRuleID);
  1717. }
  1718. else {
  1719. comboBox2.SelectedIndex = -1;
  1720. }
  1721. }
  1722. else {
  1723. comboBox2.SelectedIndex = -1;
  1724. }
  1725. //更改顯示
  1726. textMingcheng.Text = copyData.measureMaintenanceName;//名稱
  1727. textBeizhu.Text = copyData.measureMaintenanceContent;//備注
  1728. List<MeasureMaintenanceBasicData> measureMaintenanceBasicDatas = new List<MeasureMaintenanceBasicData>();
  1729. for (int i = 0; i < copyData.measureMaintenanceBasicDataList.Count; i++)
  1730. {
  1731. MeasureMaintenanceBasicData measureMaintenanceFormula = new MeasureMaintenanceBasicData();
  1732. measureMaintenanceFormula.measureMaintenanceBasicDataIndex = copyData.measureMaintenanceBasicDataList[i].measureMaintenanceBasicDataIndex;
  1733. measureMaintenanceFormula.measureMaintenanceBasicDataPosition = copyData.measureMaintenanceBasicDataList[i].measureMaintenanceBasicDataPosition;
  1734. measureMaintenanceFormula.measureMaintenanceBasicDataValue = copyData.measureMaintenanceBasicDataList[i].measureMaintenanceBasicDataValue;
  1735. measureMaintenanceBasicDatas.Add(measureMaintenanceFormula);
  1736. }
  1737. textLiaohao.Text = measureMaintenanceBasicDatas[0].measureMaintenanceBasicDataValue;//料號
  1738. textLiaohaoPosition.Text = measureMaintenanceBasicDatas[0].measureMaintenanceBasicDataPosition;
  1739. if (string.IsNullOrEmpty(measureMaintenanceBasicDatas[1].measureMaintenanceBasicDataValue))
  1740. {
  1741. comboBanci.SelectedIndex = -1;//班次
  1742. }
  1743. else {
  1744. comboBanci.SelectedItem = measureMaintenanceBasicDatas[1].measureMaintenanceBasicDataValue;//班次
  1745. }
  1746. textBanciPosition.Text = measureMaintenanceBasicDatas[1].measureMaintenanceBasicDataPosition;
  1747. if (string.IsNullOrEmpty(measureMaintenanceBasicDatas[2].measureMaintenanceBasicDataValue))
  1748. {
  1749. comboShiyanshi.SelectedIndex = -1;//班次
  1750. }
  1751. else
  1752. {
  1753. comboShiyanshi.SelectedItem = measureMaintenanceBasicDatas[2].measureMaintenanceBasicDataValue;//班次
  1754. }
  1755. textShiyanshiPosition.Text = measureMaintenanceBasicDatas[2].measureMaintenanceBasicDataPosition;
  1756. if (string.IsNullOrEmpty(measureMaintenanceBasicDatas[3].measureMaintenanceBasicDataValue))
  1757. {
  1758. comboShiyongchangqu.SelectedIndex = -1;//班次
  1759. }
  1760. else
  1761. {
  1762. comboShiyongchangqu.SelectedItem = measureMaintenanceBasicDatas[3].measureMaintenanceBasicDataValue;//班次
  1763. }
  1764. textShiyongchangquPosition.Text = measureMaintenanceBasicDatas[3].measureMaintenanceBasicDataPosition;
  1765. comboZhichengbie.SelectedItem = measureMaintenanceBasicDatas[4].measureMaintenanceBasicDataValue;//製成別
  1766. if (string.IsNullOrEmpty(measureMaintenanceBasicDatas[4].measureMaintenanceBasicDataValue))
  1767. {
  1768. comboZhichengbie.SelectedIndex = -1;//班次
  1769. }
  1770. else
  1771. {
  1772. comboZhichengbie.SelectedItem = measureMaintenanceBasicDatas[4].measureMaintenanceBasicDataValue;//班次
  1773. }
  1774. textZhichengbiePosition.Text = measureMaintenanceBasicDatas[4].measureMaintenanceBasicDataPosition;
  1775. textDanhao.Text = measureMaintenanceBasicDatas[5].measureMaintenanceBasicDataValue;//單號
  1776. textDanhaoPosition.Text = measureMaintenanceBasicDatas[5].measureMaintenanceBasicDataPosition;
  1777. textPihao.Text = measureMaintenanceBasicDatas[6].measureMaintenanceBasicDataValue;//批號
  1778. textPihaoPosition.Text = measureMaintenanceBasicDatas[6].measureMaintenanceBasicDataPosition;
  1779. if (string.IsNullOrEmpty(measureMaintenanceBasicDatas[7].measureMaintenanceBasicDataValue))
  1780. {
  1781. comboCengbie.SelectedIndex = -1;//班次
  1782. }
  1783. else
  1784. {
  1785. comboCengbie.SelectedItem = measureMaintenanceBasicDatas[7].measureMaintenanceBasicDataValue;//班次
  1786. }
  1787. textCengbiePosition.Text = measureMaintenanceBasicDatas[7].measureMaintenanceBasicDataPosition;
  1788. comboDianduxianbie.Text = measureMaintenanceBasicDatas[8].measureMaintenanceBasicDataValue;//電鍍綫別
  1789. textDianduxianbiePosition.Text = measureMaintenanceBasicDatas[8].measureMaintenanceBasicDataPosition;
  1790. textDanwei.Text = measureMaintenanceBasicDatas[9].measureMaintenanceBasicDataValue;//單位
  1791. textDanweiPosition.Text = measureMaintenanceBasicDatas[9].measureMaintenanceBasicDataPosition;
  1792. //UNDONE:由于数据问题,暂时为try-catch
  1793. try
  1794. {
  1795. textBoxDatePos.Text = copyData.measureMaintenanceBasicDataList[10].measureMaintenanceBasicDataPosition;//报告日期
  1796. }
  1797. catch
  1798. {
  1799. var mData = new MeasureMaintenanceBasicData();
  1800. mData.measureMaintenanceBasicDataIndex = 10;
  1801. mData.measureMaintenanceBasicDataPosition = "NowDateTime";
  1802. copyData.measureMaintenanceBasicDataList.Add(mData);
  1803. }
  1804. textOutNumber.Text = copyData.outputPicturesNum.ToString();//輸出圖片數量
  1805. textModel.Text = copyData.templateFilePath;
  1806. this.everyFourmulaList.Clear();
  1807. List<MeasureMaintenanceFormula> measureMaintenanceFormulas = new List<MeasureMaintenanceFormula>();
  1808. for (int i = 0; i < copyData.MeasureMaintenanceTreeFourthDataList.Count; i++)
  1809. {
  1810. MeasureMaintenanceFormula measureMaintenanceFormula = new MeasureMaintenanceFormula();
  1811. measureMaintenanceFormula.FatherHoleTypeId = copyData.MeasureMaintenanceTreeFourthDataList[i].FatherHoleTypeId;
  1812. measureMaintenanceFormula.FormulaExpression = copyData.MeasureMaintenanceTreeFourthDataList[i].FormulaExpression;
  1813. measureMaintenanceFormula.FormulaExpressionLineID = copyData.MeasureMaintenanceTreeFourthDataList[i].FormulaExpressionLineID;
  1814. measureMaintenanceFormula.FormulaId = copyData.MeasureMaintenanceTreeFourthDataList[i].FormulaId;
  1815. measureMaintenanceFormula.FormulaName = copyData.MeasureMaintenanceTreeFourthDataList[i].FormulaName;
  1816. measureMaintenanceFormula.FormulaParentId = copyData.MeasureMaintenanceTreeFourthDataList[i].FormulaParentId;
  1817. measureMaintenanceFormula.HoleType = copyData.MeasureMaintenanceTreeFourthDataList[i].HoleType;
  1818. measureMaintenanceFormula.HoleTypeId = copyData.MeasureMaintenanceTreeFourthDataList[i].HoleTypeId;
  1819. measureMaintenanceFormula.isConductiveCloth = copyData.MeasureMaintenanceTreeFourthDataList[i].isConductiveCloth;
  1820. measureMaintenanceFormula.isFanweibuchang = copyData.MeasureMaintenanceTreeFourthDataList[i].isFanweibuchang;
  1821. measureMaintenanceFormula.isErzhichuli = copyData.MeasureMaintenanceTreeFourthDataList[i].isErzhichuli;
  1822. measureMaintenanceFormula.Specification = copyData.MeasureMaintenanceTreeFourthDataList[i].Specification;
  1823. measureMaintenanceFormula.TestItems = copyData.MeasureMaintenanceTreeFourthDataList[i].TestItems;
  1824. measureMaintenanceFormulas.Add(measureMaintenanceFormula);
  1825. }
  1826. this.everyFourmulaList.AddRange(measureMaintenanceFormulas);
  1827. OutInfoShow();
  1828. }
  1829. /// <summary>
  1830. /// 写入XML
  1831. /// </summary>
  1832. public void WriteXml()
  1833. {
  1834. string filePath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceTypeList.xml";
  1835. string stageModelXml = XmlSerializeHelper.XmlSerialize<MeasureMaintenanceTypeList>(measureMaintenanceTypeList);
  1836. FileOperationHelper.WriteStringToFile(stageModelXml, filePath, FileMode.Create);
  1837. //清空未命名XMl
  1838. string path = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceType\\.xml";
  1839. if (System.IO.File.Exists(path))
  1840. {
  1841. try
  1842. {
  1843. string newpath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceType\\"+ this.textMingcheng.Text +".xml";
  1844. System.IO.File.Move(path, newpath);
  1845. }
  1846. catch (Exception)
  1847. {
  1848. }
  1849. }
  1850. }
  1851. /// <summary>
  1852. /// 讀取基本信息
  1853. /// </summary>
  1854. private void ReadXml2()
  1855. {
  1856. XmlDocument xDoc = new XmlDocument();
  1857. string filePath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\basicInformation.xml";
  1858. if (System.IO.File.Exists(filePath))
  1859. {
  1860. xDoc.Load(filePath);
  1861. }
  1862. else
  1863. {
  1864. XmlDeclaration declaration = xDoc.CreateXmlDeclaration("1.0", "UTF-8", "yes");
  1865. xDoc.AppendChild(declaration);
  1866. //根结点
  1867. XmlElement genjiedian = xDoc.CreateElement("leixings");
  1868. xDoc.AppendChild(genjiedian);
  1869. //规程结点
  1870. for (int i = 0; i < 6; i++)
  1871. {
  1872. XmlElement leixing = xDoc.CreateElement("類型");
  1873. genjiedian.AppendChild(leixing);
  1874. }
  1875. xDoc.Save(filePath);
  1876. }
  1877. XmlNode rootNode = xDoc.SelectSingleNode("leixings");
  1878. XmlNodeList leixingList = rootNode.ChildNodes;
  1879. for (int i = 0; i < leixingList.Count; i++)
  1880. {
  1881. XmlNodeList leixingChild = leixingList[i].ChildNodes;
  1882. List<string> strList = new List<string>();
  1883. for (int j = 0; j < leixingChild.Count; j++)
  1884. {
  1885. string mingcheng = leixingChild[j].InnerText;
  1886. strList.Add(mingcheng);
  1887. }
  1888. switch (i) {
  1889. case 0:
  1890. comboShiyongchangqu.DataSource = strList;
  1891. break;
  1892. case 1:
  1893. comboShiyanshi.DataSource = strList;
  1894. break;
  1895. case 2:
  1896. comboCengbie.DataSource = strList;
  1897. break;
  1898. case 3:
  1899. comboZhichengbie.DataSource = strList;
  1900. break;
  1901. case 4:
  1902. comboBanci.DataSource = strList;
  1903. break;
  1904. //case 5:
  1905. // comboDianduxianbie.DataSource = strList;
  1906. // break;
  1907. }
  1908. }
  1909. }
  1910. /// <summary>
  1911. /// 輸出信息顯示
  1912. /// </summary>
  1913. private void OutInfoShow()
  1914. {
  1915. panelOutInfo.Controls.Clear();
  1916. int height = 38;
  1917. int width = (groupOutInfo.Size.Width - 14) / 4;
  1918. string[] titles = { PdnResources.GetString("Pass"), PdnResources.GetString("InspectionItem"), PdnResources.GetString("Size"), PdnResources.GetString("MeasuringPos") }; // 孔型 檢驗項目 規格 測量位置
  1919. string[] titleNames = { "kongxing", "jianyanxiangmu", "guige", "celiangweizhi" };
  1920. List<Label> positions = new List<Label>();
  1921. List<Label> specifications = new List<Label>();
  1922. List<Label> testItems = new List<Label>();
  1923. List<Label> holeTypes = new List<Label>();
  1924. int i,k;
  1925. for (i = 0; i < 4; i++)
  1926. {
  1927. Label title = new Label();
  1928. title.AutoSize = false;
  1929. title.TextAlign = ContentAlignment.MiddleCenter;
  1930. title.BorderStyle = BorderStyle.FixedSingle;
  1931. title.Location = new System.Drawing.Point(3 + (width - 1) * i, 1);
  1932. title.Name = titleNames[i];
  1933. title.Size = new System.Drawing.Size(width, height);
  1934. title.TabIndex = 2;
  1935. title.Text = titles[i];
  1936. panelOutInfo.Controls.Add(title);
  1937. }
  1938. var list1 = everyFourmulaList.GroupBy(m => m.HoleType);
  1939. foreach (var item in list1)
  1940. {
  1941. int rowInt = 0;
  1942. var list2 = item.GroupBy(m => m.TestItems);
  1943. foreach (var item2 in list2)
  1944. {
  1945. k = 0;
  1946. foreach (var item3 in item2)
  1947. {
  1948. #region [測量位置]
  1949. Label position = new Label();
  1950. position.AutoSize = false;
  1951. position.TextAlign = ContentAlignment.MiddleCenter;
  1952. position.BorderStyle = BorderStyle.FixedSingle;
  1953. if (positions.Count == 0)
  1954. position.Location = new System.Drawing.Point(3 + (width - 1) * 3, height);
  1955. else
  1956. position.Location = new System.Drawing.Point(3 + (width - 1) * 3, positions[positions.Count - 1].Location.Y + height - 1);
  1957. position.Name = item3.FormulaParentId + "3";
  1958. position.Size = new System.Drawing.Size(width, height);
  1959. position.TabIndex = 2;
  1960. position.Text = item3.FormulaName;
  1961. panelOutInfo.Controls.Add(position);
  1962. positions.Add(position);
  1963. #endregion
  1964. k++;
  1965. rowInt++;
  1966. }
  1967. // TODO:规格
  1968. #region [規格]
  1969. Label specification = new Label();
  1970. specification.AutoSize = false;
  1971. specification.TextAlign = ContentAlignment.MiddleCenter;
  1972. specification.BorderStyle = BorderStyle.FixedSingle;
  1973. if (specifications.Count == 0)
  1974. specification.Location = new System.Drawing.Point(3 + (width - 1) * 2, height);
  1975. else
  1976. specification.Location = new System.Drawing.Point(3 + (width - 1) * 2, specifications[specifications.Count - 1].Location.Y + specifications[specifications.Count - 1].Size.Height - 1);
  1977. specification.Name = item2.First().Specification + "2";
  1978. specification.Size = new System.Drawing.Size(width, height * k - (k - 1));
  1979. specification.TabIndex = 2;
  1980. #region[替换字符]
  1981. item2.First().Specification = item2.First().Specification.Replace("LQ", "<=");
  1982. item2.First().Specification = item2.First().Specification.Replace("L", "<");
  1983. #endregion
  1984. specification.Text = item2.First().Specification;
  1985. //specification.Text = "1";
  1986. panelOutInfo.Controls.Add(specification);
  1987. specifications.Add(specification);
  1988. #endregion
  1989. #region [檢驗項目]
  1990. Label testItem = new Label();
  1991. testItem.AutoSize = false;
  1992. testItem.TextAlign = ContentAlignment.MiddleCenter;
  1993. testItem.BorderStyle = BorderStyle.FixedSingle;
  1994. if (testItems.Count == 0)
  1995. testItem.Location = new System.Drawing.Point(3 + (width - 1) * 1, height);
  1996. else
  1997. testItem.Location = new System.Drawing.Point(3 + (width - 1) * 1, testItems[testItems.Count - 1].Location.Y + testItems[testItems.Count - 1].Size.Height - 1);
  1998. testItem.Name = item2.Key + "1";
  1999. testItem.Size = new System.Drawing.Size(width, height * k - (k - 1));
  2000. testItem.TabIndex = 2;
  2001. testItem.Text = item2.Key;
  2002. panelOutInfo.Controls.Add(testItem);
  2003. testItems.Add(testItem);
  2004. #endregion
  2005. }
  2006. #region [孔型]
  2007. Label holeType = new Label();
  2008. holeType.AutoSize = false;
  2009. holeType.TextAlign = ContentAlignment.MiddleCenter;
  2010. holeType.BorderStyle = BorderStyle.FixedSingle;
  2011. if (holeTypes.Count == 0)
  2012. holeType.Location = new System.Drawing.Point(3, height);
  2013. else
  2014. holeType.Location = new System.Drawing.Point(3, holeTypes[holeTypes.Count - 1].Location.Y + holeTypes[holeTypes.Count - 1].Size.Height - 1);
  2015. holeType.Name = item.Key + "0";
  2016. holeType.Size = new System.Drawing.Size(width, height * rowInt - (rowInt - 1));
  2017. holeType.TabIndex = 2;
  2018. holeType.Text = item.Key;
  2019. panelOutInfo.Controls.Add(holeType);
  2020. holeTypes.Add(holeType);
  2021. #endregion
  2022. }
  2023. }
  2024. private void MeasureSettingDialog_Resize(object sender, EventArgs e)
  2025. {
  2026. panelOutInfo.Controls.Clear();
  2027. OutInfoShow();
  2028. }
  2029. /// <summary>
  2030. /// 选择模板
  2031. /// </summary>
  2032. /// <param name="sender"></param>
  2033. /// <param name="e"></param>
  2034. private void buttonChooseModel_Click(object sender, EventArgs e)
  2035. {
  2036. OpenFileDialog dialog = new OpenFileDialog();
  2037. dialog.Filter = "Excel文件|*.xls;*.xlsx";
  2038. dialog.Multiselect = false; //该值确定是否可以选择多个文件
  2039. if (dialog.ShowDialog() != DialogResult.OK)
  2040. {
  2041. return;
  2042. }
  2043. string file = dialog.FileName;
  2044. textModel.Text = file;
  2045. }
  2046. /// <summary>
  2047. /// 标尺选中
  2048. /// </summary>
  2049. /// <param name="sender"></param>
  2050. /// <param name="e"></param>
  2051. private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
  2052. {
  2053. int index = this.comboBox1.SelectedIndex;
  2054. if (index == -1) {
  2055. textDanwei.Text = this.appWorkspace.GetPxPerUnit()[1];//單位
  2056. return;
  2057. }
  2058. var ruler = Program.instance.mic_rulersAll[index];
  2059. textDanwei.Text = InvariantData.unitsDictionary[ruler.ruler_units];
  2060. }
  2061. /// <summary>
  2062. /// 打开
  2063. /// </summary>
  2064. /// <param name="sender"></param>
  2065. /// <param name="e"></param>
  2066. private void button1_Click(object sender, EventArgs e)
  2067. {
  2068. string path = textModel.Text;
  2069. try
  2070. {
  2071. if (!OfficeFileHandleHelper.OpenOfficeFile(path))
  2072. {
  2073. MessageBox.Show(PdnResources.GetString("Menu.Fileopenfailed.Text"));
  2074. }
  2075. }
  2076. catch (Exception)
  2077. {
  2078. MessageBox.Show(PdnResources.GetString("Menu.Fileopenfailed.Text"));
  2079. }
  2080. }
  2081. /// <summary>
  2082. /// 基础信息设置
  2083. /// </summary>
  2084. /// <param name="sender"></param>
  2085. /// <param name="e"></param>
  2086. private void button2_Click(object sender, EventArgs e)
  2087. {
  2088. using (BasicInformationSettings af = new BasicInformationSettings(this))
  2089. {
  2090. af.StartPosition = FormStartPosition.CenterScreen;
  2091. af.ShowDialog();
  2092. }
  2093. }
  2094. /// <summary>
  2095. ///
  2096. /// </summary>
  2097. public void resetInformation() {
  2098. ReadXml2();
  2099. comboShiyongchangqu.SelectedIndex = -1;
  2100. comboShiyanshi.SelectedIndex = -1;
  2101. comboCengbie.SelectedIndex = -1;
  2102. comboZhichengbie.SelectedIndex = -1;
  2103. comboBanci.SelectedIndex = -1;
  2104. }
  2105. }
  2106. }