123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286 |
- using SmartCoalApplication.Core;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using SmartCoalApplication.Base.AutoMeasure;
- using System.Xml;
- using System.Xml.Linq;
- using System.IO;
- using NPOI.XSSF.UserModel;
- using NPOI.HSSF.UserModel;
- using SmartCoalApplication.Base.MeasureModel;
- using SmartCoalApplication.Base.CommTool;
- using SmartCoalApplication.Core.DbOpreate.DbModel;
- using SmartCoalApplication.Resources;
- using Resources;
- using SmartCoalApplication.Core.CustomControl;
- using SmartCoalApplication.Setup;
- using SmartCoalApplication.Base.FunctionModel;
- using System.Text.RegularExpressions;
- using System.Dynamic;
- //using NPOI.SS.UserModel;
- //using NPOI.HSSF.Util;
- namespace SmartCoalApplication.MeasureProcedure
- {
- internal partial class MeasureSettingDialog : PdnBaseForm
- {
- private List<Rules> rules = new List<Rules>();//規程列表
- private AppWorkspace appWorkspace;
- private int index = new int();
- private MeasureMaintenanceTypeList measureMaintenanceTypeList;
- private List<MeasureMaintenanceFormula> everyFourmulaList = new List<MeasureMaintenanceFormula>();
- private int copyNum = 1;
- private string copyName = string.Empty;
- #region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private System.Windows.Forms.GroupBox groupBox1;
- private System.Windows.Forms.Button buttonDetermine;
- private System.Windows.Forms.Button buttonClose;
- private System.Windows.Forms.GroupBox groupBox2;
- private System.Windows.Forms.GroupBox groupBox3;
- private NewTextBox textBeizhu;
- private NewTextBox textMingcheng;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.GroupBox groupBox4;
- private NewTextBox textLiaohao;
- private System.Windows.Forms.Label label12;
- private System.Windows.Forms.Label label11;
- private System.Windows.Forms.Label label10;
- private System.Windows.Forms.Label label9;
- private System.Windows.Forms.Label label8;
- private System.Windows.Forms.Label label7;
- private System.Windows.Forms.Label label6;
- private System.Windows.Forms.Label label5;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.GroupBox groupBox5;
- private System.Windows.Forms.GroupBox groupBox6;
- private System.Windows.Forms.Label label13;
- private System.Windows.Forms.Label label14;
- private NewTextBox textPihao;
- private System.Windows.Forms.ComboBox comboZhichengbie;
- private System.Windows.Forms.ComboBox comboShiyongchangqu;
- private System.Windows.Forms.ComboBox comboShiyanshi;
- private System.Windows.Forms.ComboBox comboBanci;
- private NewTextBox textDanhao;
- private System.Windows.Forms.TextBox textDanweiPosition;
- private System.Windows.Forms.TextBox textDianduxianbiePosition;
- private System.Windows.Forms.TextBox textCengbiePosition;
- private System.Windows.Forms.TextBox textPihaoPosition;
- private System.Windows.Forms.TextBox textDanhaoPosition;
- private System.Windows.Forms.TextBox textZhichengbiePosition;
- private System.Windows.Forms.TextBox textShiyongchangquPosition;
- private System.Windows.Forms.TextBox textShiyanshiPosition;
- private System.Windows.Forms.TextBox textBanciPosition;
- private System.Windows.Forms.TextBox textLiaohaoPosition;
- private System.Windows.Forms.Label label24;
- private System.Windows.Forms.Label label23;
- private System.Windows.Forms.Label label22;
- private System.Windows.Forms.Label label21;
- private System.Windows.Forms.Label label20;
- private System.Windows.Forms.Label label19;
- private System.Windows.Forms.Label label18;
- private System.Windows.Forms.Label label17;
- private System.Windows.Forms.Label label16;
- private System.Windows.Forms.Label label15;
- private System.Windows.Forms.TextBox textDanwei;
- private System.Windows.Forms.Button buttonChooseModel;
- private System.Windows.Forms.TextBox textModel;
- private System.Windows.Forms.TextBox textOutNumber;
- private System.Windows.Forms.ListBox listRules;
- private System.Windows.Forms.GroupBox groupOutInfo;
- private System.Windows.Forms.ComboBox comboCengbie;
- private System.Windows.Forms.Panel panelOutInfo;
- private void InitializeComponent()
- {
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.button2 = new System.Windows.Forms.Button();
- this.groupBox5 = new System.Windows.Forms.GroupBox();
- this.buttonDetermine = new System.Windows.Forms.Button();
- this.buttonClose = new System.Windows.Forms.Button();
- this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.buttonDelete = new System.Windows.Forms.Button();
- this.buttonCopy = new System.Windows.Forms.Button();
- this.buttonAdd = new System.Windows.Forms.Button();
- this.buttonSetUp = new System.Windows.Forms.Button();
- this.listRules = new System.Windows.Forms.ListBox();
- this.groupBox3 = new System.Windows.Forms.GroupBox();
- this.comboBox2 = new System.Windows.Forms.ComboBox();
- this.label26 = new System.Windows.Forms.Label();
- this.comboBox1 = new System.Windows.Forms.ComboBox();
- this.label25 = new System.Windows.Forms.Label();
- this.textBeizhu = new SmartCoalApplication.Core.CustomControl.NewTextBox();
- this.textMingcheng = new SmartCoalApplication.Core.CustomControl.NewTextBox();
- this.label2 = new System.Windows.Forms.Label();
- this.label1 = new System.Windows.Forms.Label();
- this.groupBox4 = new System.Windows.Forms.GroupBox();
- this.labelNowDate = new System.Windows.Forms.Label();
- this.textBoxDatePos = new System.Windows.Forms.TextBox();
- this.labelDatePos = new System.Windows.Forms.Label();
- this.labelDate = new System.Windows.Forms.Label();
- this.comboDianduxianbie = new SmartCoalApplication.Core.CustomControl.NewTextBox();
- this.comboCengbie = new System.Windows.Forms.ComboBox();
- this.textDanweiPosition = new System.Windows.Forms.TextBox();
- this.textDianduxianbiePosition = new System.Windows.Forms.TextBox();
- this.textCengbiePosition = new System.Windows.Forms.TextBox();
- this.textPihaoPosition = new System.Windows.Forms.TextBox();
- this.textDanhaoPosition = new System.Windows.Forms.TextBox();
- this.textZhichengbiePosition = new System.Windows.Forms.TextBox();
- this.textShiyongchangquPosition = new System.Windows.Forms.TextBox();
- this.textShiyanshiPosition = new System.Windows.Forms.TextBox();
- this.textBanciPosition = new System.Windows.Forms.TextBox();
- this.textLiaohaoPosition = new System.Windows.Forms.TextBox();
- this.label24 = new System.Windows.Forms.Label();
- this.label23 = new System.Windows.Forms.Label();
- this.label22 = new System.Windows.Forms.Label();
- this.label21 = new System.Windows.Forms.Label();
- this.label20 = new System.Windows.Forms.Label();
- this.label19 = new System.Windows.Forms.Label();
- this.label18 = new System.Windows.Forms.Label();
- this.label17 = new System.Windows.Forms.Label();
- this.label16 = new System.Windows.Forms.Label();
- this.label15 = new System.Windows.Forms.Label();
- this.textDanwei = new System.Windows.Forms.TextBox();
- this.textPihao = new SmartCoalApplication.Core.CustomControl.NewTextBox();
- this.comboZhichengbie = new System.Windows.Forms.ComboBox();
- this.comboShiyongchangqu = new System.Windows.Forms.ComboBox();
- this.comboShiyanshi = new System.Windows.Forms.ComboBox();
- this.comboBanci = new System.Windows.Forms.ComboBox();
- this.textDanhao = new SmartCoalApplication.Core.CustomControl.NewTextBox();
- this.textLiaohao = new SmartCoalApplication.Core.CustomControl.NewTextBox();
- this.label12 = new System.Windows.Forms.Label();
- this.label11 = new System.Windows.Forms.Label();
- this.label10 = new System.Windows.Forms.Label();
- this.label9 = new System.Windows.Forms.Label();
- this.label8 = new System.Windows.Forms.Label();
- this.label7 = new System.Windows.Forms.Label();
- this.label6 = new System.Windows.Forms.Label();
- this.label5 = new System.Windows.Forms.Label();
- this.label4 = new System.Windows.Forms.Label();
- this.label3 = new System.Windows.Forms.Label();
- this.groupBox6 = new System.Windows.Forms.GroupBox();
- this.button1 = new System.Windows.Forms.Button();
- this.buttonChooseModel = new System.Windows.Forms.Button();
- this.textModel = new System.Windows.Forms.TextBox();
- this.textOutNumber = new System.Windows.Forms.TextBox();
- this.label13 = new System.Windows.Forms.Label();
- this.label14 = new System.Windows.Forms.Label();
- this.groupOutInfo = new System.Windows.Forms.GroupBox();
- this.panel1 = new System.Windows.Forms.Panel();
- this.panelOutInfo = new System.Windows.Forms.Panel();
- this.groupBox1.SuspendLayout();
- this.groupBox2.SuspendLayout();
- this.groupBox3.SuspendLayout();
- this.groupBox4.SuspendLayout();
- this.groupBox6.SuspendLayout();
- this.groupOutInfo.SuspendLayout();
- this.panel1.SuspendLayout();
- this.SuspendLayout();
- //
- // groupBox1
- //
- this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox1.Controls.Add(this.button2);
- this.groupBox1.Controls.Add(this.groupBox5);
- this.groupBox1.Controls.Add(this.buttonDetermine);
- this.groupBox1.Controls.Add(this.buttonClose);
- this.groupBox1.Location = new System.Drawing.Point(12, 12);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(1192, 57);
- this.groupBox1.TabIndex = 2;
- this.groupBox1.TabStop = false;
- this.groupBox1.Text = "操作";
- //
- // button2
- //
- this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.button2.Location = new System.Drawing.Point(937, 20);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(87, 23);
- this.button2.TabIndex = 13;
- this.button2.Text = "基礎信息設置";
- this.button2.UseVisualStyleBackColor = true;
- this.button2.Click += new System.EventHandler(this.button2_Click);
- //
- // groupBox5
- //
- this.groupBox5.AutoSize = true;
- this.groupBox5.Location = new System.Drawing.Point(632, 63);
- this.groupBox5.Name = "groupBox5";
- this.groupBox5.Size = new System.Drawing.Size(521, 383);
- this.groupBox5.TabIndex = 12;
- this.groupBox5.TabStop = false;
- this.groupBox5.Text = "輸出信息";
- //
- // buttonDetermine
- //
- this.buttonDetermine.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.buttonDetermine.Location = new System.Drawing.Point(1030, 20);
- this.buttonDetermine.Name = "buttonDetermine";
- this.buttonDetermine.Size = new System.Drawing.Size(75, 23);
- this.buttonDetermine.TabIndex = 2;
- this.buttonDetermine.Text = "確定";
- this.buttonDetermine.UseVisualStyleBackColor = true;
- this.buttonDetermine.Click += new System.EventHandler(this.buttonDetermine_Click);
- //
- // buttonClose
- //
- this.buttonClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.buttonClose.Location = new System.Drawing.Point(1111, 20);
- this.buttonClose.Name = "buttonClose";
- this.buttonClose.Size = new System.Drawing.Size(75, 23);
- this.buttonClose.TabIndex = 0;
- this.buttonClose.Text = "關閉";
- this.buttonClose.UseVisualStyleBackColor = true;
- this.buttonClose.Click += new System.EventHandler(this.buttonClose_Click);
- //
- // groupBox2
- //
- this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)));
- this.groupBox2.Controls.Add(this.buttonDelete);
- this.groupBox2.Controls.Add(this.buttonCopy);
- this.groupBox2.Controls.Add(this.buttonAdd);
- this.groupBox2.Controls.Add(this.buttonSetUp);
- this.groupBox2.Controls.Add(this.listRules);
- this.groupBox2.Location = new System.Drawing.Point(12, 75);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(200, 694);
- this.groupBox2.TabIndex = 9;
- this.groupBox2.TabStop = false;
- this.groupBox2.Text = "測量規程列表";
- //
- // buttonDelete
- //
- this.buttonDelete.Location = new System.Drawing.Point(150, 30);
- this.buttonDelete.Name = "buttonDelete";
- this.buttonDelete.Size = new System.Drawing.Size(44, 23);
- this.buttonDelete.TabIndex = 9;
- this.buttonDelete.Text = "刪除";
- this.buttonDelete.UseVisualStyleBackColor = true;
- this.buttonDelete.Click += new System.EventHandler(this.buttonDelete_Click);
- //
- // buttonCopy
- //
- this.buttonCopy.Location = new System.Drawing.Point(101, 30);
- this.buttonCopy.Name = "buttonCopy";
- this.buttonCopy.Size = new System.Drawing.Size(44, 23);
- this.buttonCopy.TabIndex = 8;
- this.buttonCopy.Text = "複製";
- this.buttonCopy.UseVisualStyleBackColor = true;
- this.buttonCopy.Click += new System.EventHandler(this.buttonCopy_Click);
- //
- // buttonAdd
- //
- this.buttonAdd.Location = new System.Drawing.Point(54, 30);
- this.buttonAdd.Name = "buttonAdd";
- this.buttonAdd.Size = new System.Drawing.Size(44, 23);
- this.buttonAdd.TabIndex = 7;
- this.buttonAdd.Text = "新增";
- this.buttonAdd.UseVisualStyleBackColor = true;
- this.buttonAdd.Click += new System.EventHandler(this.buttonAdd_Click);
- //
- // buttonSetUp
- //
- this.buttonSetUp.Location = new System.Drawing.Point(6, 30);
- this.buttonSetUp.Name = "buttonSetUp";
- this.buttonSetUp.Size = new System.Drawing.Size(44, 23);
- this.buttonSetUp.TabIndex = 6;
- this.buttonSetUp.Text = "設置";
- this.buttonSetUp.UseVisualStyleBackColor = true;
- this.buttonSetUp.Click += new System.EventHandler(this.buttonSetUp_Click);
- //
- // listRules
- //
- this.listRules.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)));
- this.listRules.FormattingEnabled = true;
- this.listRules.ItemHeight = 12;
- this.listRules.Location = new System.Drawing.Point(6, 60);
- this.listRules.Name = "listRules";
- this.listRules.Size = new System.Drawing.Size(188, 604);
- this.listRules.TabIndex = 0;
- this.listRules.SelectedIndexChanged += new System.EventHandler(this.listRules_SelectedChange);
- //
- // groupBox3
- //
- this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox3.AutoSize = true;
- this.groupBox3.Controls.Add(this.comboBox2);
- this.groupBox3.Controls.Add(this.label26);
- this.groupBox3.Controls.Add(this.comboBox1);
- this.groupBox3.Controls.Add(this.label25);
- this.groupBox3.Controls.Add(this.textBeizhu);
- this.groupBox3.Controls.Add(this.textMingcheng);
- this.groupBox3.Controls.Add(this.label2);
- this.groupBox3.Controls.Add(this.label1);
- this.groupBox3.Location = new System.Drawing.Point(218, 75);
- this.groupBox3.Name = "groupBox3";
- this.groupBox3.Size = new System.Drawing.Size(437, 204);
- this.groupBox3.TabIndex = 10;
- this.groupBox3.TabStop = false;
- this.groupBox3.Text = "基本信息";
- //
- // comboBox2
- //
- this.comboBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.comboBox2.FormattingEnabled = true;
- this.comboBox2.Location = new System.Drawing.Point(64, 106);
- this.comboBox2.Name = "comboBox2";
- this.comboBox2.Size = new System.Drawing.Size(355, 20);
- this.comboBox2.TabIndex = 7;
- //
- // label26
- //
- this.label26.AutoSize = true;
- this.label26.Location = new System.Drawing.Point(6, 110);
- this.label26.Name = "label26";
- this.label26.Size = new System.Drawing.Size(65, 12);
- this.label26.TabIndex = 6;
- this.label26.Text = "命名規則:";
- //
- // comboBox1
- //
- this.comboBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.comboBox1.FormattingEnabled = true;
- this.comboBox1.Location = new System.Drawing.Point(64, 67);
- this.comboBox1.Name = "comboBox1";
- this.comboBox1.Size = new System.Drawing.Size(355, 20);
- this.comboBox1.TabIndex = 5;
- this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
- //
- // label25
- //
- this.label25.AutoSize = true;
- this.label25.Location = new System.Drawing.Point(6, 71);
- this.label25.Name = "label25";
- this.label25.Size = new System.Drawing.Size(41, 12);
- this.label25.TabIndex = 4;
- this.label25.Text = "标尺:";
- //
- // textBeizhu
- //
- this.textBeizhu.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.textBeizhu.Location = new System.Drawing.Point(64, 145);
- this.textBeizhu.Multiline = true;
- this.textBeizhu.Name = "textBeizhu";
- this.textBeizhu.Size = new System.Drawing.Size(355, 35);
- this.textBeizhu.TabIndex = 3;
- //
- // textMingcheng
- //
- this.textMingcheng.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.textMingcheng.Location = new System.Drawing.Point(64, 27);
- this.textMingcheng.Name = "textMingcheng";
- this.textMingcheng.Size = new System.Drawing.Size(355, 21);
- this.textMingcheng.TabIndex = 2;
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(6, 156);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(41, 12);
- this.label2.TabIndex = 1;
- this.label2.Text = "備注:";
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(6, 31);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(41, 12);
- this.label1.TabIndex = 0;
- this.label1.Text = "名稱:";
- //
- // groupBox4
- //
- this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox4.AutoSize = true;
- this.groupBox4.Controls.Add(this.labelNowDate);
- this.groupBox4.Controls.Add(this.textBoxDatePos);
- this.groupBox4.Controls.Add(this.labelDatePos);
- this.groupBox4.Controls.Add(this.labelDate);
- this.groupBox4.Controls.Add(this.comboDianduxianbie);
- this.groupBox4.Controls.Add(this.comboCengbie);
- this.groupBox4.Controls.Add(this.textDanweiPosition);
- this.groupBox4.Controls.Add(this.textDianduxianbiePosition);
- this.groupBox4.Controls.Add(this.textCengbiePosition);
- this.groupBox4.Controls.Add(this.textPihaoPosition);
- this.groupBox4.Controls.Add(this.textDanhaoPosition);
- this.groupBox4.Controls.Add(this.textZhichengbiePosition);
- this.groupBox4.Controls.Add(this.textShiyongchangquPosition);
- this.groupBox4.Controls.Add(this.textShiyanshiPosition);
- this.groupBox4.Controls.Add(this.textBanciPosition);
- this.groupBox4.Controls.Add(this.textLiaohaoPosition);
- this.groupBox4.Controls.Add(this.label24);
- this.groupBox4.Controls.Add(this.label23);
- this.groupBox4.Controls.Add(this.label22);
- this.groupBox4.Controls.Add(this.label21);
- this.groupBox4.Controls.Add(this.label20);
- this.groupBox4.Controls.Add(this.label19);
- this.groupBox4.Controls.Add(this.label18);
- this.groupBox4.Controls.Add(this.label17);
- this.groupBox4.Controls.Add(this.label16);
- this.groupBox4.Controls.Add(this.label15);
- this.groupBox4.Controls.Add(this.textDanwei);
- this.groupBox4.Controls.Add(this.textPihao);
- this.groupBox4.Controls.Add(this.comboZhichengbie);
- this.groupBox4.Controls.Add(this.comboShiyongchangqu);
- this.groupBox4.Controls.Add(this.comboShiyanshi);
- this.groupBox4.Controls.Add(this.comboBanci);
- this.groupBox4.Controls.Add(this.textDanhao);
- this.groupBox4.Controls.Add(this.textLiaohao);
- this.groupBox4.Controls.Add(this.label12);
- this.groupBox4.Controls.Add(this.label11);
- this.groupBox4.Controls.Add(this.label10);
- this.groupBox4.Controls.Add(this.label9);
- this.groupBox4.Controls.Add(this.label8);
- this.groupBox4.Controls.Add(this.label7);
- this.groupBox4.Controls.Add(this.label6);
- this.groupBox4.Controls.Add(this.label5);
- this.groupBox4.Controls.Add(this.label4);
- this.groupBox4.Controls.Add(this.label3);
- this.groupBox4.Location = new System.Drawing.Point(218, 282);
- this.groupBox4.Name = "groupBox4";
- this.groupBox4.Size = new System.Drawing.Size(437, 487);
- this.groupBox4.TabIndex = 11;
- this.groupBox4.TabStop = false;
- this.groupBox4.Text = "基本信息";
- //
- // labelNowDate
- //
- this.labelNowDate.AutoSize = true;
- this.labelNowDate.Location = new System.Drawing.Point(83, 347);
- this.labelNowDate.Name = "labelNowDate";
- this.labelNowDate.Size = new System.Drawing.Size(53, 12);
- this.labelNowDate.TabIndex = 49;
- this.labelNowDate.Text = "当前日期";
- //
- // textBoxDatePos
- //
- this.textBoxDatePos.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.textBoxDatePos.Location = new System.Drawing.Point(298, 342);
- this.textBoxDatePos.Name = "textBoxDatePos";
- this.textBoxDatePos.Size = new System.Drawing.Size(121, 21);
- this.textBoxDatePos.TabIndex = 47;
- this.textBoxDatePos.Text = "NowDateTime";
- //
- // labelDatePos
- //
- this.labelDatePos.AutoSize = true;
- this.labelDatePos.Location = new System.Drawing.Point(255, 345);
- this.labelDatePos.Name = "labelDatePos";
- this.labelDatePos.Size = new System.Drawing.Size(41, 12);
- this.labelDatePos.TabIndex = 48;
- this.labelDatePos.Text = "位置:";
- //
- // labelDate
- //
- this.labelDate.AutoSize = true;
- this.labelDate.Location = new System.Drawing.Point(3, 347);
- this.labelDate.Name = "labelDate";
- this.labelDate.Size = new System.Drawing.Size(65, 12);
- this.labelDate.TabIndex = 45;
- this.labelDate.Text = "报告日期:";
- //
- // comboDianduxianbie
- //
- this.comboDianduxianbie.Location = new System.Drawing.Point(85, 275);
- this.comboDianduxianbie.Name = "comboDianduxianbie";
- this.comboDianduxianbie.Size = new System.Drawing.Size(164, 21);
- this.comboDianduxianbie.TabIndex = 44;
- //
- // comboCengbie
- //
- this.comboCengbie.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.comboCengbie.FormattingEnabled = true;
- this.comboCengbie.Location = new System.Drawing.Point(85, 244);
- this.comboCengbie.Name = "comboCengbie";
- this.comboCengbie.Size = new System.Drawing.Size(164, 20);
- this.comboCengbie.TabIndex = 43;
- //
- // textDanweiPosition
- //
- this.textDanweiPosition.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.textDanweiPosition.Location = new System.Drawing.Point(298, 306);
- this.textDanweiPosition.Name = "textDanweiPosition";
- this.textDanweiPosition.Size = new System.Drawing.Size(121, 21);
- this.textDanweiPosition.TabIndex = 42;
- //
- // textDianduxianbiePosition
- //
- this.textDianduxianbiePosition.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.textDianduxianbiePosition.Location = new System.Drawing.Point(298, 275);
- this.textDianduxianbiePosition.Name = "textDianduxianbiePosition";
- this.textDianduxianbiePosition.Size = new System.Drawing.Size(121, 21);
- this.textDianduxianbiePosition.TabIndex = 41;
- //
- // textCengbiePosition
- //
- this.textCengbiePosition.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.textCengbiePosition.Location = new System.Drawing.Point(298, 244);
- this.textCengbiePosition.Name = "textCengbiePosition";
- this.textCengbiePosition.Size = new System.Drawing.Size(121, 21);
- this.textCengbiePosition.TabIndex = 40;
- //
- // textPihaoPosition
- //
- this.textPihaoPosition.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.textPihaoPosition.Location = new System.Drawing.Point(298, 213);
- this.textPihaoPosition.Name = "textPihaoPosition";
- this.textPihaoPosition.Size = new System.Drawing.Size(121, 21);
- this.textPihaoPosition.TabIndex = 39;
- //
- // textDanhaoPosition
- //
- this.textDanhaoPosition.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.textDanhaoPosition.Location = new System.Drawing.Point(298, 182);
- this.textDanhaoPosition.Name = "textDanhaoPosition";
- this.textDanhaoPosition.Size = new System.Drawing.Size(121, 21);
- this.textDanhaoPosition.TabIndex = 38;
- //
- // textZhichengbiePosition
- //
- this.textZhichengbiePosition.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.textZhichengbiePosition.Location = new System.Drawing.Point(298, 153);
- this.textZhichengbiePosition.Name = "textZhichengbiePosition";
- this.textZhichengbiePosition.Size = new System.Drawing.Size(121, 21);
- this.textZhichengbiePosition.TabIndex = 37;
- //
- // textShiyongchangquPosition
- //
- this.textShiyongchangquPosition.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.textShiyongchangquPosition.Location = new System.Drawing.Point(298, 124);
- this.textShiyongchangquPosition.Name = "textShiyongchangquPosition";
- this.textShiyongchangquPosition.Size = new System.Drawing.Size(121, 21);
- this.textShiyongchangquPosition.TabIndex = 36;
- //
- // textShiyanshiPosition
- //
- this.textShiyanshiPosition.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.textShiyanshiPosition.Location = new System.Drawing.Point(298, 95);
- this.textShiyanshiPosition.Name = "textShiyanshiPosition";
- this.textShiyanshiPosition.Size = new System.Drawing.Size(121, 21);
- this.textShiyanshiPosition.TabIndex = 35;
- //
- // textBanciPosition
- //
- this.textBanciPosition.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.textBanciPosition.Location = new System.Drawing.Point(298, 64);
- this.textBanciPosition.Name = "textBanciPosition";
- this.textBanciPosition.Size = new System.Drawing.Size(121, 21);
- this.textBanciPosition.TabIndex = 34;
- //
- // textLiaohaoPosition
- //
- this.textLiaohaoPosition.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.textLiaohaoPosition.Location = new System.Drawing.Point(298, 33);
- this.textLiaohaoPosition.Name = "textLiaohaoPosition";
- this.textLiaohaoPosition.Size = new System.Drawing.Size(121, 21);
- this.textLiaohaoPosition.TabIndex = 33;
- //
- // label24
- //
- this.label24.AutoSize = true;
- this.label24.Location = new System.Drawing.Point(255, 314);
- this.label24.Name = "label24";
- this.label24.Size = new System.Drawing.Size(41, 12);
- this.label24.TabIndex = 32;
- this.label24.Text = "位置:";
- //
- // label23
- //
- this.label23.AutoSize = true;
- this.label23.Location = new System.Drawing.Point(255, 278);
- this.label23.Name = "label23";
- this.label23.Size = new System.Drawing.Size(41, 12);
- this.label23.TabIndex = 31;
- this.label23.Text = "位置:";
- //
- // label22
- //
- this.label22.AutoSize = true;
- this.label22.Location = new System.Drawing.Point(255, 247);
- this.label22.Name = "label22";
- this.label22.Size = new System.Drawing.Size(41, 12);
- this.label22.TabIndex = 30;
- this.label22.Text = "位置:";
- //
- // label21
- //
- this.label21.AutoSize = true;
- this.label21.Location = new System.Drawing.Point(255, 216);
- this.label21.Name = "label21";
- this.label21.Size = new System.Drawing.Size(41, 12);
- this.label21.TabIndex = 29;
- this.label21.Text = "位置:";
- //
- // label20
- //
- this.label20.AutoSize = true;
- this.label20.Location = new System.Drawing.Point(255, 185);
- this.label20.Name = "label20";
- this.label20.Size = new System.Drawing.Size(41, 12);
- this.label20.TabIndex = 28;
- this.label20.Text = "位置:";
- //
- // label19
- //
- this.label19.AutoSize = true;
- this.label19.Location = new System.Drawing.Point(255, 156);
- this.label19.Name = "label19";
- this.label19.Size = new System.Drawing.Size(41, 12);
- this.label19.TabIndex = 27;
- this.label19.Text = "位置:";
- //
- // label18
- //
- this.label18.AutoSize = true;
- this.label18.Location = new System.Drawing.Point(255, 127);
- this.label18.Name = "label18";
- this.label18.Size = new System.Drawing.Size(41, 12);
- this.label18.TabIndex = 26;
- this.label18.Text = "位置:";
- //
- // label17
- //
- this.label17.AutoSize = true;
- this.label17.Location = new System.Drawing.Point(255, 98);
- this.label17.Name = "label17";
- this.label17.Size = new System.Drawing.Size(41, 12);
- this.label17.TabIndex = 25;
- this.label17.Text = "位置:";
- //
- // label16
- //
- this.label16.AutoSize = true;
- this.label16.Location = new System.Drawing.Point(255, 67);
- this.label16.Name = "label16";
- this.label16.Size = new System.Drawing.Size(41, 12);
- this.label16.TabIndex = 24;
- this.label16.Text = "位置:";
- //
- // label15
- //
- this.label15.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.label15.AutoSize = true;
- this.label15.Location = new System.Drawing.Point(255, 36);
- this.label15.Name = "label15";
- this.label15.Size = new System.Drawing.Size(41, 12);
- this.label15.TabIndex = 23;
- this.label15.Text = "位置:";
- //
- // textDanwei
- //
- this.textDanwei.Location = new System.Drawing.Point(85, 309);
- this.textDanwei.Multiline = true;
- this.textDanwei.Name = "textDanwei";
- this.textDanwei.ReadOnly = true;
- this.textDanwei.Size = new System.Drawing.Size(164, 20);
- this.textDanwei.TabIndex = 22;
- //
- // textPihao
- //
- this.textPihao.Location = new System.Drawing.Point(85, 213);
- this.textPihao.Name = "textPihao";
- this.textPihao.Size = new System.Drawing.Size(164, 21);
- this.textPihao.TabIndex = 19;
- //
- // comboZhichengbie
- //
- this.comboZhichengbie.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.comboZhichengbie.FormattingEnabled = true;
- this.comboZhichengbie.Location = new System.Drawing.Point(85, 153);
- this.comboZhichengbie.Name = "comboZhichengbie";
- this.comboZhichengbie.Size = new System.Drawing.Size(164, 20);
- this.comboZhichengbie.TabIndex = 18;
- //
- // comboShiyongchangqu
- //
- this.comboShiyongchangqu.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.comboShiyongchangqu.FormattingEnabled = true;
- this.comboShiyongchangqu.Location = new System.Drawing.Point(85, 124);
- this.comboShiyongchangqu.Name = "comboShiyongchangqu";
- this.comboShiyongchangqu.Size = new System.Drawing.Size(164, 20);
- this.comboShiyongchangqu.TabIndex = 17;
- //
- // comboShiyanshi
- //
- this.comboShiyanshi.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.comboShiyanshi.FormattingEnabled = true;
- this.comboShiyanshi.Location = new System.Drawing.Point(85, 95);
- this.comboShiyanshi.Name = "comboShiyanshi";
- this.comboShiyanshi.Size = new System.Drawing.Size(164, 20);
- this.comboShiyanshi.TabIndex = 16;
- //
- // comboBanci
- //
- this.comboBanci.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.comboBanci.FormattingEnabled = true;
- this.comboBanci.Location = new System.Drawing.Point(85, 64);
- this.comboBanci.Name = "comboBanci";
- this.comboBanci.Size = new System.Drawing.Size(164, 20);
- this.comboBanci.TabIndex = 0;
- //
- // textDanhao
- //
- this.textDanhao.Location = new System.Drawing.Point(85, 182);
- this.textDanhao.Name = "textDanhao";
- this.textDanhao.Size = new System.Drawing.Size(164, 21);
- this.textDanhao.TabIndex = 15;
- //
- // textLiaohao
- //
- this.textLiaohao.Location = new System.Drawing.Point(85, 33);
- this.textLiaohao.Name = "textLiaohao";
- this.textLiaohao.Size = new System.Drawing.Size(164, 21);
- this.textLiaohao.TabIndex = 11;
- //
- // label12
- //
- this.label12.AutoSize = true;
- this.label12.Location = new System.Drawing.Point(27, 314);
- this.label12.Name = "label12";
- this.label12.Size = new System.Drawing.Size(41, 12);
- this.label12.TabIndex = 10;
- this.label12.Text = "單位:";
- //
- // label11
- //
- this.label11.AutoSize = true;
- this.label11.Location = new System.Drawing.Point(3, 278);
- this.label11.Name = "label11";
- this.label11.Size = new System.Drawing.Size(65, 12);
- this.label11.TabIndex = 9;
- this.label11.Text = "電鍍綫別:";
- //
- // label10
- //
- this.label10.AutoSize = true;
- this.label10.Location = new System.Drawing.Point(27, 247);
- this.label10.Name = "label10";
- this.label10.Size = new System.Drawing.Size(41, 12);
- this.label10.TabIndex = 8;
- this.label10.Text = "層別:";
- //
- // label9
- //
- this.label9.AutoSize = true;
- this.label9.Location = new System.Drawing.Point(27, 216);
- this.label9.Name = "label9";
- this.label9.Size = new System.Drawing.Size(41, 12);
- this.label9.TabIndex = 7;
- this.label9.Text = "批號:";
- //
- // label8
- //
- this.label8.AutoSize = true;
- this.label8.Location = new System.Drawing.Point(27, 185);
- this.label8.Name = "label8";
- this.label8.Size = new System.Drawing.Size(41, 12);
- this.label8.TabIndex = 6;
- this.label8.Text = "單號:";
- //
- // label7
- //
- this.label7.AutoSize = true;
- this.label7.Location = new System.Drawing.Point(12, 156);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(53, 12);
- this.label7.TabIndex = 5;
- this.label7.Text = "製成別:";
- //
- // label6
- //
- this.label6.AutoSize = true;
- this.label6.Location = new System.Drawing.Point(0, 127);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(65, 12);
- this.label6.TabIndex = 4;
- this.label6.Text = "使用廠區:";
- //
- // label5
- //
- this.label5.AutoSize = true;
- this.label5.Location = new System.Drawing.Point(12, 98);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(53, 12);
- this.label5.TabIndex = 3;
- this.label5.Text = "實驗室:";
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(27, 67);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(41, 12);
- this.label4.TabIndex = 2;
- this.label4.Text = "班次:";
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(27, 36);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(41, 12);
- this.label3.TabIndex = 1;
- this.label3.Text = "料號:";
- //
- // groupBox6
- //
- this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox6.AutoSize = true;
- this.groupBox6.Controls.Add(this.button1);
- this.groupBox6.Controls.Add(this.buttonChooseModel);
- this.groupBox6.Controls.Add(this.textModel);
- this.groupBox6.Controls.Add(this.textOutNumber);
- this.groupBox6.Controls.Add(this.label13);
- this.groupBox6.Controls.Add(this.label14);
- this.groupBox6.Location = new System.Drawing.Point(662, 652);
- this.groupBox6.Name = "groupBox6";
- this.groupBox6.Size = new System.Drawing.Size(542, 117);
- this.groupBox6.TabIndex = 13;
- this.groupBox6.TabStop = false;
- this.groupBox6.Text = "其他信息";
- //
- // button1
- //
- this.button1.Location = new System.Drawing.Point(485, 59);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(44, 23);
- this.button1.TabIndex = 15;
- this.button1.Text = "打开";
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // buttonChooseModel
- //
- this.buttonChooseModel.Location = new System.Drawing.Point(435, 59);
- this.buttonChooseModel.Name = "buttonChooseModel";
- this.buttonChooseModel.Size = new System.Drawing.Size(44, 23);
- this.buttonChooseModel.TabIndex = 14;
- this.buttonChooseModel.Text = "選擇";
- this.buttonChooseModel.UseVisualStyleBackColor = true;
- this.buttonChooseModel.Click += new System.EventHandler(this.buttonChooseModel_Click);
- //
- // textModel
- //
- this.textModel.Location = new System.Drawing.Point(114, 61);
- this.textModel.Multiline = true;
- this.textModel.Name = "textModel";
- this.textModel.ReadOnly = true;
- this.textModel.Size = new System.Drawing.Size(305, 32);
- this.textModel.TabIndex = 13;
- //
- // textOutNumber
- //
- this.textOutNumber.Location = new System.Drawing.Point(114, 24);
- this.textOutNumber.Name = "textOutNumber";
- this.textOutNumber.Size = new System.Drawing.Size(149, 21);
- this.textOutNumber.TabIndex = 12;
- this.textOutNumber.Text = "5";
- //
- // label13
- //
- this.label13.AutoSize = true;
- this.label13.Location = new System.Drawing.Point(6, 71);
- this.label13.Name = "label13";
- this.label13.Size = new System.Drawing.Size(65, 12);
- this.label13.TabIndex = 1;
- this.label13.Text = "選擇模板:";
- //
- // label14
- //
- this.label14.AutoSize = true;
- this.label14.Location = new System.Drawing.Point(6, 30);
- this.label14.Name = "label14";
- this.label14.Size = new System.Drawing.Size(89, 12);
- this.label14.TabIndex = 0;
- this.label14.Text = "輸出圖片個數:";
- //
- // groupOutInfo
- //
- this.groupOutInfo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupOutInfo.Controls.Add(this.panel1);
- this.groupOutInfo.Location = new System.Drawing.Point(662, 75);
- this.groupOutInfo.Name = "groupOutInfo";
- this.groupOutInfo.Size = new System.Drawing.Size(542, 579);
- this.groupOutInfo.TabIndex = 14;
- this.groupOutInfo.TabStop = false;
- this.groupOutInfo.Text = "輸出信息";
- //
- // panel1
- //
- this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.panel1.AutoScroll = true;
- this.panel1.Controls.Add(this.panelOutInfo);
- this.panel1.Location = new System.Drawing.Point(6, 13);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(530, 560);
- this.panel1.TabIndex = 1;
- //
- // panelOutInfo
- //
- this.panelOutInfo.AutoSize = true;
- this.panelOutInfo.Location = new System.Drawing.Point(1, 0);
- this.panelOutInfo.Name = "panelOutInfo";
- this.panelOutInfo.Size = new System.Drawing.Size(527, 392);
- this.panelOutInfo.TabIndex = 0;
- //
- // MeasureSettingDialog
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(1211, 774);
- this.Controls.Add(this.groupBox6);
- this.Controls.Add(this.groupBox4);
- this.Controls.Add(this.groupOutInfo);
- this.Controls.Add(this.groupBox3);
- this.Controls.Add(this.groupBox2);
- this.Controls.Add(this.groupBox1);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "MeasureSettingDialog";
- this.Text = "设置测试规程";
- this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
- this.Load += new System.EventHandler(this.MeasureSettingDialog_Load);
- this.Resize += new System.EventHandler(this.MeasureSettingDialog_Resize);
- this.Controls.SetChildIndex(this.groupBox1, 0);
- this.Controls.SetChildIndex(this.groupBox2, 0);
- this.Controls.SetChildIndex(this.groupBox3, 0);
- this.Controls.SetChildIndex(this.groupOutInfo, 0);
- this.Controls.SetChildIndex(this.groupBox4, 0);
- this.Controls.SetChildIndex(this.groupBox6, 0);
- this.groupBox1.ResumeLayout(false);
- this.groupBox1.PerformLayout();
- this.groupBox2.ResumeLayout(false);
- this.groupBox3.ResumeLayout(false);
- this.groupBox3.PerformLayout();
- this.groupBox4.ResumeLayout(false);
- this.groupBox4.PerformLayout();
- this.groupBox6.ResumeLayout(false);
- this.groupBox6.PerformLayout();
- this.groupOutInfo.ResumeLayout(false);
- this.panel1.ResumeLayout(false);
- this.panel1.PerformLayout();
- this.ResumeLayout(false);
- this.PerformLayout();
- }
- #endregion
- public const int WM_NCLBUTTONDBLCLK = 0xA3;
- const int WM_NCLBUTTONDOWN = 0x00A1;
- const int HTCAPTION = 2;
- protected override void WndProc(ref Message m)
- {
- if (m.Msg == WM_NCLBUTTONDOWN && m.WParam.ToInt32() == HTCAPTION)
- return;
- if (m.Msg == WM_NCLBUTTONDBLCLK)
- return;
- base.WndProc(ref m);
- }
- /// <summary>
- /// 生成随机纯字母随机数
- /// </summary>
- /// <param name="Length">生成长度</param>
- /// <param name="Sleep">是否要在生成前将当前线程阻止以避免重复</param>
- /// <returns></returns>
- public static string Str_char(int Length, bool Sleep)
- {
- if (Sleep) System.Threading.Thread.Sleep(3);
- 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' };
- string result = "";
- int n = Pattern.Length;
- System.Random random = new Random(~unchecked((int)DateTime.Now.Ticks));
- for (int i = 0; i < Length; i++)
- {
- int rnd = random.Next(0, n);
- result += Pattern[rnd];
- }
- return result;
- }
- public MeasureSettingDialog(AppWorkspace appWorkspace)
- {
- //var sssfilePath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\basicTreeData.xml";
- //var measureMaintenanceTreeData = XmlSerializeHelper.DESerializer<MeasureMaintenanceTreeData>(FileOperationHelper.ReadStringFromFile(sssfilePath, FileMode.Open));
- //foreach (var abc in measureMaintenanceTreeData.MeasureMaintenanceTreeDataList)
- //{
- // foreach (var bcd in abc.MeasureMaintenanceTreeSpecificSonDataList)
- // {
- // for (int i = 0; i < bcd.MeasureMaintenanceTreeSpecificFormulaDataList.Count; i++)
- // {
- // bcd.MeasureMaintenanceTreeSpecificFormulaDataList[i].FormulaParameterShowName = $"{bcd.MeasureMaintenanceTreeSpecificFormulaDataList[i].FormulaParameterName}({bcd.MeasureMaintenanceTreeSpecificFormulaDataList[i].FormulaParameterAliasName})";
- // }
- // }
- //}
- //string stageModelXml = XmlSerializeHelper.XmlSerialize<MeasureMaintenanceTreeData>(measureMaintenanceTreeData);
- //FileOperationHelper.WriteStringToFile(stageModelXml, sssfilePath, FileMode.Create);
- this.appWorkspace = appWorkspace;
- InitializeComponent();
- InitializeComponent2();
- this.Icon = PdnInfo.AppIcon;
- #region [命名规则]
- comboBox2.DataSource = Program.instance.fileNameRule.NameRuleList;
- comboBox2.DisplayMember = "Name";
- comboBox2.SelectedIndex = -1;
- #endregion
- #region [标尺相关信息]
- List<mic_rulers> list = Program.instance.mic_rulersAll;
- comboBox1.DataSource = list;
- comboBox1.DisplayMember = "ruler_name";
- comboBox1.SelectedIndex = -1;
- #endregion
- #region [读取xml中的数据]
- string filePath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceTypeList.xml";
- if (!System.IO.File.Exists(filePath))
- {
- measureMaintenanceTypeList = new MeasureMaintenanceTypeList();
- measureMaintenanceTypeList.measureMaintenanceTypeList = new List<MeasureMaintenanceType>();
- }
- else {
- measureMaintenanceTypeList = XmlSerializeHelper.DESerializer<MeasureMaintenanceTypeList>(FileOperationHelper.ReadStringFromFile(filePath, FileMode.Open));
- }
- #endregion
- ReadXml2();
- comboShiyongchangqu.SelectedIndex = -1;
- comboShiyanshi.SelectedIndex = -1;
- comboCengbie.SelectedIndex = -1;
- comboZhichengbie.SelectedIndex = -1;
- comboBanci.SelectedIndex = -1;
- this.FormClosed += new FormClosedEventHandler(formClosing);
- this.MaximizedBounds = Screen.PrimaryScreen.WorkingArea;//在窗体初始化后添加一句代码
- }
- private void InitializeComponent2()
- {
- this.Text = PdnResources.GetString("NewSetTestProcedure");
- this.groupBox1.Text = PdnResources.GetString("NewOperation");
- this.groupBox5.Text = PdnResources.GetString("NewOutputInformation");
- this.buttonDetermine.Text = PdnResources.GetString("NewConfirm");
- this.buttonClose.Text = PdnResources.GetString("NewClosing");
- this.groupBox2.Text = PdnResources.GetString("NewListSurveyProcedures");
- this.buttonDelete.Text = PdnResources.GetString("NewDelete");
- this.buttonCopy.Text = PdnResources.GetString("NewCopy");
- this.buttonAdd.Text = PdnResources.GetString("NewAdd");
- this.buttonSetUp.Text = PdnResources.GetString("NewSetting");
- this.groupBox3.Text = PdnResources.GetString("NewEssentialInformation");
- this.label25.Text = PdnResources.GetString("NewRuler");
- this.label2.Text = PdnResources.GetString("NewRemark") + ":";
- this.label1.Text = PdnResources.GetString("NewName") + ":";
- this.groupBox4.Text = PdnResources.GetString("NewEssentialInformation");
- this.label24.Text = PdnResources.GetString("NewPosition") + ":";
- this.label23.Text = PdnResources.GetString("NewPosition") + ":";
- this.label22.Text = PdnResources.GetString("NewPosition") + ":";
- this.label21.Text = PdnResources.GetString("NewPosition") + ":";
- this.label20.Text = PdnResources.GetString("NewPosition") + ":";
- this.label19.Text = PdnResources.GetString("NewPosition") + ":";
- this.label18.Text = PdnResources.GetString("NewPosition") + ":";
- this.label17.Text = PdnResources.GetString("NewPosition") + ":";
- this.label16.Text = PdnResources.GetString("NewPosition") + ":";
- this.label15.Text = PdnResources.GetString("NewPosition") + ":";
- this.label12.Text = PdnResources.GetString("NewUnit") + ":";
- this.label11.Text = PdnResources.GetString("NewElectroplatingLine") + ":";
- this.label10.Text = PdnResources.GetString("NewLayers") + ":";
- this.label9.Text = PdnResources.GetString("NewBatchNumber") + ":";
- this.label8.Text = PdnResources.GetString("NewOrderNo") + ":";
- this.label7.Text = PdnResources.GetString("NewMadeOf") + ":";
- this.label6.Text = PdnResources.GetString("NewUseFactory") + ":";
- this.label5.Text = PdnResources.GetString("NewLaboratory") + ":";
- this.label4.Text = PdnResources.GetString("NewFrequency") + ":";
- this.label3.Text = PdnResources.GetString("NewItemNo") + ":";
- this.groupBox6.Text = PdnResources.GetString("NewOtherInformation");
- this.button1.Text = PdnResources.GetString("NewOpen");
- this.buttonChooseModel.Text = PdnResources.GetString("NewChoice");
- this.label13.Text = PdnResources.GetString("NewSelectTemplate") + ":";
- this.label14.Text = PdnResources.GetString("NewNumberOutputPictures") + ":";
- this.groupOutInfo.Text = PdnResources.GetString("NewOutputInformation");
- this.button2.Text = PdnResources.GetString("NewBasicInfoSetting");
- this.label26.Text = PdnResources.GetString("MeasureSettingDialog.label26");
- this.labelDate.Text = PdnResources.GetString("MeasureSettingDialog.labelDate") + ":";
- this.labelDatePos.Text = PdnResources.GetString("MeasureSettingDialog.labelDatePos");
- this.labelNowDate.Text = PdnResources.GetString("MeasureSettingDialog.textBoxDate");
- }
- private void formClosing(object sender, FormClosedEventArgs e)
- {
- //清空未命名XMl
- string path = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceType\\.xml";
- if (System.IO.File.Exists(path))
- {
- try
- {
- System.IO.File.Delete(path);
- }
- catch (Exception)
- {
- }
- }
- }
- /// <summary>
- /// 關閉
- /// </summary>
- private void buttonClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- /// <summary>
- /// 設置
- /// </summary>
- private void buttonSetUp_Click(object sender, EventArgs e)
- {
- string name;
- List<MeasureMaintenanceFormula> list;
- if (listRules.SelectedItem == null)
- {
- if (!string.IsNullOrEmpty(this.copyName))
- {
- name = this.copyName;
- }
- else {
- name = string.Empty;
- }
- list = new List<MeasureMaintenanceFormula>();
- list.AddRange(everyFourmulaList);
- }
- else {
- name = ((MeasureMaintenanceType)listRules.SelectedItem).measureMaintenanceName;
- list = ((MeasureMaintenanceType)listRules.SelectedItem).MeasureMaintenanceTreeFourthDataList;
- }
- MeasureSetUp form = new MeasureSetUp(name, list,this.appWorkspace);
- form.TransferEvent += frm_TransEvent;
- form.ShowDialog();
- }
- private void frm_TransEvent(List<MeasureMaintenanceFormula> list)
- {
- everyFourmulaList.Clear();
- everyFourmulaList.AddRange(list);
- if (this.listRules.SelectedItem != null)
- {
- var selectItem = (MeasureMaintenanceType)this.listRules.SelectedItem;
- var data = measureMaintenanceTypeList.measureMaintenanceTypeList.Where(m => m.measureMaintenanceTypeId.Equals(selectItem.measureMaintenanceTypeId)).FirstOrDefault();
- if (data != null)
- {
- data.MeasureMaintenanceTreeFourthDataList.Clear();
- data.MeasureMaintenanceTreeFourthDataList.AddRange(list);
- selectItem.MeasureMaintenanceTreeFourthDataList.Clear();
- selectItem.MeasureMaintenanceTreeFourthDataList.AddRange(list);
- }
- }
- OutInfoShow();
- }
- /// <summary>
- /// 新增規程
- /// </summary>
- private void buttonAdd_Click(object sender, EventArgs e)
- {
- listRules.SelectedIndex = - 1;
- this.copyName = string.Empty;
- textMingcheng.Text = string.Empty;//名稱
- textBeizhu.Text = string.Empty;//備注
- textLiaohao.Text = string.Empty;//料號
- textLiaohaoPosition.Text = "ItemNumber";
- comboBanci.SelectedItem = string.Empty;//班次
- textBanciPosition.Text = "DNShift";
- comboShiyanshi.Text = string.Empty;//實驗室
- textShiyanshiPosition.Text = "Lab";
- comboShiyongchangqu.SelectedItem = string.Empty;//使用廠區
- textShiyongchangquPosition.Text = "factory";
- comboZhichengbie.SelectedItem = string.Empty;//製成別
- textZhichengbiePosition.Text = "ProcType";
- textDanhao.Text = string.Empty;//單號
- textDanhaoPosition.Text = "WorkOrder";
- textPihao.Text = string.Empty;//批號
- textPihaoPosition.Text = "LotNumber";
- comboCengbie.SelectedItem = string.Empty;//層別
- textCengbiePosition.Text = "LayerType";
- comboDianduxianbie.Text = string.Empty;//電鍍綫別
- textDianduxianbiePosition.Text = "EplatType";
- textDanwei.Text = this.appWorkspace.GetPxPerUnit()[1];//單位
- textDanweiPosition.Text = "Unit";
- textOutNumber.Text = "5";
- textModel.Text = string.Empty;
- textBoxDatePos.Text = "NowDateTime";
- comboBox1.SelectedIndex = -1;
- comboBox2.SelectedIndex = -1;
- panelOutInfo.Controls.Clear();
- everyFourmulaList.Clear();
- //清空未命名XMl
- string path = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceType\\.xml";
- if (System.IO.File.Exists(path))
- {
- try
- {
- System.IO.File.Delete(path);
- }
- catch (Exception)
- {
- }
- }
- if (!buttonSetUp.Enabled || !buttonCopy.Enabled || !buttonDetermine.Enabled || !buttonDelete.Enabled)
- {
- buttonSetUp.Enabled = true;
- buttonCopy.Enabled = true;
- buttonDetermine.Enabled = true;
- buttonDelete.Enabled = true;
- }
- }
- /// <summary>
- /// 確認規程
- /// </summary>
- private void buttonDetermine_Click(object sender, EventArgs e)
- {
- if (string.IsNullOrEmpty(textMingcheng.Text))
- {
- MessageBox.Show(PdnResources.GetString("NullName"));
- return;
- }
- var repeatData = measureMaintenanceTypeList.measureMaintenanceTypeList.Where(m => m.measureMaintenanceName.Equals(textMingcheng.Text)).FirstOrDefault();
- if (repeatData != null)
- {
- if (listRules.SelectedItem == null)
- {
- MessageBox.Show(PdnResources.GetString("RepeatName"));
- return;
- }
- else {
-
- var data = (MeasureMaintenanceType)listRules.SelectedItem;
- if (!data.measureMaintenanceTypeId.Equals(repeatData.measureMaintenanceTypeId)) {
- MessageBox.Show(PdnResources.GetString("RepeatName"));
- return;
- }
- }
- }
- MeasureMaintenanceType copyData;
- int index = listRules.SelectedIndex;
- if (listRules.SelectedItem == null)
- {
- if (string.IsNullOrEmpty(textModel.Text))
- {
- MessageBox.Show(PdnResources.GetString("SelectModel"));
- }
- copyData = new MeasureMaintenanceType();
- copyData.measureMaintenanceTypeId = Guid.NewGuid().ToString();
- copyData.measureMaintenanceBasicDataList = new List<MeasureMaintenanceBasicData>();
- MeasureMaintenanceBasicData data = new MeasureMaintenanceBasicData();
- MeasureMaintenanceBasicData data1 = new MeasureMaintenanceBasicData();
- MeasureMaintenanceBasicData data2 = new MeasureMaintenanceBasicData();
- MeasureMaintenanceBasicData data3 = new MeasureMaintenanceBasicData();
- MeasureMaintenanceBasicData data4 = new MeasureMaintenanceBasicData();
- MeasureMaintenanceBasicData data5 = new MeasureMaintenanceBasicData();
- MeasureMaintenanceBasicData data6 = new MeasureMaintenanceBasicData();
- MeasureMaintenanceBasicData data7 = new MeasureMaintenanceBasicData();
- MeasureMaintenanceBasicData data8 = new MeasureMaintenanceBasicData();
- MeasureMaintenanceBasicData data9 = new MeasureMaintenanceBasicData();
- MeasureMaintenanceBasicData data10 = new MeasureMaintenanceBasicData();
- MeasureMaintenanceBasicData data11 = new MeasureMaintenanceBasicData();
- data.measureMaintenanceBasicDataIndex = 0;
- copyData.measureMaintenanceBasicDataList.Add(data);
- data1.measureMaintenanceBasicDataIndex = 1;
- copyData.measureMaintenanceBasicDataList.Add(data1);
- data2.measureMaintenanceBasicDataIndex = 2;
- copyData.measureMaintenanceBasicDataList.Add(data2);
- data3.measureMaintenanceBasicDataIndex = 3;
- copyData.measureMaintenanceBasicDataList.Add(data3);
- data4.measureMaintenanceBasicDataIndex = 4;
- copyData.measureMaintenanceBasicDataList.Add(data4);
- data5.measureMaintenanceBasicDataIndex = 5;
- copyData.measureMaintenanceBasicDataList.Add(data5);
- data6.measureMaintenanceBasicDataIndex = 6;
- copyData.measureMaintenanceBasicDataList.Add(data6);
- data7.measureMaintenanceBasicDataIndex = 7;
- copyData.measureMaintenanceBasicDataList.Add(data7);
- data8.measureMaintenanceBasicDataIndex = 8;
- copyData.measureMaintenanceBasicDataList.Add(data8);
- data9.measureMaintenanceBasicDataIndex = 9;
- copyData.measureMaintenanceBasicDataList.Add(data9);
- data10.measureMaintenanceBasicDataIndex = 10;
- copyData.measureMaintenanceBasicDataList.Add(data10);
- copyData.measureMaintenanceContent = string.Empty;//備注
- copyData.measureMaintenanceBasicDataList[0].measureMaintenanceBasicDataValue = string.Empty;//料號
- copyData.measureMaintenanceBasicDataList[0].measureMaintenanceBasicDataPosition = "ItemNumber";
- copyData.measureMaintenanceBasicDataList[1].measureMaintenanceBasicDataValue = string.Empty;//班次
- copyData.measureMaintenanceBasicDataList[1].measureMaintenanceBasicDataPosition = "DNShift";
- copyData.measureMaintenanceBasicDataList[2].measureMaintenanceBasicDataValue = string.Empty;//實驗室
- copyData.measureMaintenanceBasicDataList[2].measureMaintenanceBasicDataPosition = "Lab";
- copyData.measureMaintenanceBasicDataList[3].measureMaintenanceBasicDataValue = string.Empty;//使用廠區
- copyData.measureMaintenanceBasicDataList[3].measureMaintenanceBasicDataPosition = "factory";
- copyData.measureMaintenanceBasicDataList[4].measureMaintenanceBasicDataValue = string.Empty;//製成別
- copyData.measureMaintenanceBasicDataList[4].measureMaintenanceBasicDataPosition = "ProcType";
- copyData.measureMaintenanceBasicDataList[5].measureMaintenanceBasicDataValue = string.Empty;//單號
- copyData.measureMaintenanceBasicDataList[5].measureMaintenanceBasicDataPosition = "WorkOrder";
- copyData.measureMaintenanceBasicDataList[6].measureMaintenanceBasicDataValue = string.Empty;//批號
- copyData.measureMaintenanceBasicDataList[6].measureMaintenanceBasicDataPosition = "LotNumber";
- copyData.measureMaintenanceBasicDataList[7].measureMaintenanceBasicDataValue = string.Empty;//層別
- copyData.measureMaintenanceBasicDataList[7].measureMaintenanceBasicDataPosition = "LayerType";
- copyData.measureMaintenanceBasicDataList[8].measureMaintenanceBasicDataValue = string.Empty;//電鍍綫別
- copyData.measureMaintenanceBasicDataList[8].measureMaintenanceBasicDataPosition = "EplatType";
- copyData.measureMaintenanceBasicDataList[9].measureMaintenanceBasicDataValue = string.Empty;//單位
- copyData.measureMaintenanceBasicDataList[9].measureMaintenanceBasicDataPosition = "Unit";
- copyData.measureMaintenanceBasicDataList[10].measureMaintenanceBasicDataValue = string.Empty;//报告时间
- copyData.measureMaintenanceBasicDataList[10].measureMaintenanceBasicDataPosition = "NowDateTime";
- copyData.MeasureMaintenanceTreeFourthDataList = new List<MeasureMaintenanceFormula>();
- copyData.MeasureMaintenanceTreeFourthDataList.AddRange(everyFourmulaList);
- }
- else
- {
- copyData = (MeasureMaintenanceType)listRules.SelectedItem;
-
- if (string.IsNullOrEmpty(copyData.templateFilePath))
- {
- MessageBox.Show(PdnResources.GetString("SelectModel"));
- }
- }
- copyData.measureMaintenanceName = textMingcheng.Text;//名稱
- copyData.measureMaintenanceContent = textBeizhu.Text;//備注
- copyData.measureMaintenanceBasicDataList[0].measureMaintenanceBasicDataValue = textLiaohao.Text;//料號
- copyData.measureMaintenanceBasicDataList[0].measureMaintenanceBasicDataPosition = textLiaohaoPosition.Text;
- copyData.measureMaintenanceBasicDataList[1].measureMaintenanceBasicDataValue = comboBanci.SelectedItem == null ? "": comboBanci.SelectedItem.ToString();//班次
- copyData.measureMaintenanceBasicDataList[1].measureMaintenanceBasicDataPosition = textBanciPosition.Text;
- copyData.measureMaintenanceBasicDataList[2].measureMaintenanceBasicDataValue = comboShiyanshi.SelectedItem == null ? "" : comboShiyanshi.SelectedItem.ToString();//實驗室
- copyData.measureMaintenanceBasicDataList[2].measureMaintenanceBasicDataPosition = textShiyanshiPosition.Text;
- copyData.measureMaintenanceBasicDataList[3].measureMaintenanceBasicDataValue = comboShiyongchangqu.SelectedItem == null ? "" : comboShiyongchangqu.SelectedItem.ToString();//使用廠區
- copyData.measureMaintenanceBasicDataList[3].measureMaintenanceBasicDataPosition = textShiyongchangquPosition.Text;
- copyData.measureMaintenanceBasicDataList[4].measureMaintenanceBasicDataValue = comboZhichengbie.SelectedItem == null ? "" : comboZhichengbie.SelectedItem.ToString();//製成別
- copyData.measureMaintenanceBasicDataList[4].measureMaintenanceBasicDataPosition = textZhichengbiePosition.Text;
- copyData.measureMaintenanceBasicDataList[5].measureMaintenanceBasicDataValue = textDanhao.Text;//單號
- copyData.measureMaintenanceBasicDataList[5].measureMaintenanceBasicDataPosition = textDanhaoPosition.Text;
- copyData.measureMaintenanceBasicDataList[6].measureMaintenanceBasicDataValue = textPihao.Text;//批號
- copyData.measureMaintenanceBasicDataList[6].measureMaintenanceBasicDataPosition = textPihaoPosition.Text;
- copyData.measureMaintenanceBasicDataList[7].measureMaintenanceBasicDataValue = comboCengbie.SelectedItem == null ? "" : comboCengbie.SelectedItem.ToString();//層別
- copyData.measureMaintenanceBasicDataList[7].measureMaintenanceBasicDataPosition = textCengbiePosition.Text;
- copyData.measureMaintenanceBasicDataList[8].measureMaintenanceBasicDataValue = comboDianduxianbie.Text;//電鍍綫別
- copyData.measureMaintenanceBasicDataList[8].measureMaintenanceBasicDataPosition = textDianduxianbiePosition.Text;
- copyData.measureMaintenanceBasicDataList[9].measureMaintenanceBasicDataValue = textDanwei.Text;//單位
- copyData.measureMaintenanceBasicDataList[9].measureMaintenanceBasicDataPosition = textDanweiPosition.Text;
- copyData.measureMaintenanceBasicDataList[10].measureMaintenanceBasicDataPosition = textBoxDatePos.Text; //报告日期
- //UNDONE:由于数据问题,暂时为try-catch
- //try
- //{
-
- //}
- //catch
- //{
- // var mData = new MeasureMaintenanceBasicData();
- // mData.measureMaintenanceBasicDataIndex = 10;
- // mData.measureMaintenanceBasicDataPosition = "NowDateTime";
- // copyData.measureMaintenanceBasicDataList.Add(mData);
- //}
- #region [根据语言包改写名称]
- string basicFilePath;
- if (Program.instance.configModel.Language == 1)
- {
- basicFilePath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\basicTreeDataSimple.xml";
- }
- else
- {
- basicFilePath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\basicTreeDataTraditional.xml";
- }
- MeasureMaintenanceTreeData basicMeasureMaintenanceTreeData = XmlSerializeHelper.DESerializer<MeasureMaintenanceTreeData>(FileOperationHelper.ReadStringFromFile(basicFilePath, FileMode.Open));
- foreach (var item in copyData.MeasureMaintenanceTreeFourthDataList)
- {
- MeasureMaintenanceTreeSpecificData basicData;
- this.appWorkspace.RecursionGetData(item.HoleTypeId, basicMeasureMaintenanceTreeData.MeasureMaintenanceTreeDataList, out basicData);
- if (basicData != null)
- {
- item.HoleType = basicData.MeasureMaintenanceTreeSpecificName;
- }
- }
- foreach (var item in this.everyFourmulaList)
- {
- MeasureMaintenanceTreeSpecificData basicData;
- this.appWorkspace.RecursionGetData(item.HoleTypeId, basicMeasureMaintenanceTreeData.MeasureMaintenanceTreeDataList, out basicData);
- if (basicData != null)
- {
- item.HoleType = basicData.MeasureMaintenanceTreeSpecificName;
- }
- }
- #endregion
- try
- {
- int num = Convert.ToInt32(textOutNumber.Text);
- copyData.outputPicturesNum = num;
- }
- catch (Exception)
- {
- copyData.outputPicturesNum = 0;
- }
- //赋值文件到临时文件夹 并且一直用
- string tempPath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\Temp\\";
- if (!System.IO.Directory.Exists(tempPath)) {
- Directory.CreateDirectory(tempPath);
- }
- //有变化了才复写文件
- if (!textModel.Text.Equals(copyData.templateFilePath))
- {
- if (System.IO.File.Exists(copyData.templateFilePath))
- {
- //删除之前的旧文件
- try
- {
- System.IO.File.Delete(copyData.templateFilePath);
- }
- catch (Exception)
- {
- }
- }
- var dateTimeStr = DateTime.Now.ToString("yyyyMMddHHmmss");
- if (FileOperationHelper.CopyFile(textModel.Text, tempPath, dateTimeStr, true))
- {
- string[] fileName = textModel.Text.Split('\\');
- tempPath += dateTimeStr + "_" + fileName[fileName.Length - 1];
- copyData.templateFilePath = tempPath;
- }
- }
- if (comboBox1.SelectedIndex != -1)
- {
- if (copyData.ruleMessage == null)
- {
- copyData.ruleMessage = new RuleMessage();
- }
- copyData.ruleMessage.ruleId = Program.instance.mic_rulersAll[comboBox1.SelectedIndex].id.ToString();
- copyData.ruleMessage.ruleName = Program.instance.mic_rulersAll[comboBox1.SelectedIndex].ruler_name;
- copyData.ruleMessage.pixelLength = Program.instance.mic_rulersAll[comboBox1.SelectedIndex].pixel_length;
- copyData.ruleMessage.physicalLength = Program.instance.mic_rulersAll[comboBox1.SelectedIndex].physical_length;
- copyData.ruleMessage.rulerUnits = Program.instance.mic_rulersAll[comboBox1.SelectedIndex].ruler_units;
- copyData.ruleMessage.ruleGain = Program.instance.mic_rulersAll[comboBox1.SelectedIndex].gain_multiple;
- }
- if (comboBox2.SelectedIndex != -1)
- {
- var nameRuleListDetailsA = (NameRuleListDetails)this.comboBox2.SelectedItem;
- copyData.NameRuleID = nameRuleListDetailsA.ID;
- }
- if (index == -1)
- {
- measureMaintenanceTypeList.measureMaintenanceTypeList.Add(copyData);
- index = measureMaintenanceTypeList.measureMaintenanceTypeList.Count - 1;
- }
- else
- {
- measureMaintenanceTypeList.measureMaintenanceTypeList[index] = copyData;
- }
- if (!string.IsNullOrEmpty(this.copyName))
- {
- string oldFilePath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceType\\" + this.copyName + ".xml";
- string newFilePath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceType\\" + this.textMingcheng.Text + ".xml";
- if (System.IO.File.Exists(oldFilePath))
- {
- System.IO.FileInfo file = new System.IO.FileInfo(oldFilePath);
- file.MoveTo(newFilePath);
- }
- }
- this.copyName = string.Empty;
- this.listRules.SelectedIndexChanged -= new System.EventHandler(this.listRules_SelectedChange);
- listRules.DataSource = null;
- listRules.DataSource = measureMaintenanceTypeList.measureMaintenanceTypeList;
- listRules.DisplayMember = "measureMaintenanceName";
- this.listRules.SelectedIndexChanged += new System.EventHandler(this.listRules_SelectedChange);
- listRules.SelectedIndex = index;
- OutInfoShow();
- WriteXml();
- }
- /// <summary>
- /// 刪除規程
- /// </summary>
- private void buttonDelete_Click(object sender, EventArgs e)
- {
- if (this.listRules.SelectedIndex == -1)
- {
- MessageBox.Show(PdnResources.GetString("DeleteError"));
- if (this.listRules.Items.Count == 0)
- {
- buttonAdd_Click(null, null);
- }
- return;
- }
- DialogResult result = MessageBox.Show(PdnResources.GetString("Delete") + "?", PdnResources.GetString("DelStndard"), MessageBoxButtons.OKCancel);
- if (result == DialogResult.OK)
- {
- var deleteItem = (MeasureMaintenanceType)this.listRules.SelectedItem;
- measureMaintenanceTypeList.measureMaintenanceTypeList.Remove(deleteItem);
- listRules.DataSource = null;
- listRules.DataSource = measureMaintenanceTypeList.measureMaintenanceTypeList;
- listRules.DisplayMember = "measureMaintenanceName";
- if (measureMaintenanceTypeList.measureMaintenanceTypeList.Count > 0)
- {
- listRules.SelectedIndex = 0;
- }
- else {
- buttonAdd_Click(null, null);
- buttonSetUp.Enabled = false;
- buttonCopy.Enabled = false;
- buttonDetermine.Enabled = false;
- buttonDelete.Enabled = false;
- }
- string filePath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceTypeList.xml";
- string stageModelXml = XmlSerializeHelper.XmlSerialize<MeasureMaintenanceTypeList>(measureMaintenanceTypeList);
- FileOperationHelper.WriteStringToFile(stageModelXml, filePath, FileMode.Create);
- //清空未命名XMl
- string path = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceType\\" + deleteItem.measureMaintenanceName + ".xml";
- try
- {
- if (System.IO.File.Exists(path))
- {
- System.IO.File.Delete(path);
- }
- if (System.IO.File.Exists(deleteItem.templateFilePath))
- {
- System.IO.File.Delete(deleteItem.templateFilePath);
- }
- }
- catch (Exception)
- {
- }
- }
- }
- /// <summary>
- /// 複製
- /// </summary>
- private void buttonCopy_Click(object sender, EventArgs e)
- {
- if (this.listRules.SelectedItem == null) {
- return;
- }
- var selectedItem = (MeasureMaintenanceType)this.listRules.SelectedItem;
- var copyData = new MeasureMaintenanceType();
- List<MeasureMaintenanceBasicData> measureMaintenanceBasicDatas = new List<MeasureMaintenanceBasicData>();
- for (int i = 0; i < selectedItem.measureMaintenanceBasicDataList.Count; i++)
- {
- MeasureMaintenanceBasicData measureMaintenanceFormula = new MeasureMaintenanceBasicData();
- measureMaintenanceFormula.measureMaintenanceBasicDataIndex = selectedItem.measureMaintenanceBasicDataList[i].measureMaintenanceBasicDataIndex;
- measureMaintenanceFormula.measureMaintenanceBasicDataPosition = selectedItem.measureMaintenanceBasicDataList[i].measureMaintenanceBasicDataPosition;
- measureMaintenanceFormula.measureMaintenanceBasicDataValue = selectedItem.measureMaintenanceBasicDataList[i].measureMaintenanceBasicDataValue;
- measureMaintenanceBasicDatas.Add(measureMaintenanceFormula);
- }
- List<MeasureMaintenanceFormula> measureMaintenanceFormulas = new List<MeasureMaintenanceFormula>();
- for (int i = 0; i < selectedItem.MeasureMaintenanceTreeFourthDataList.Count; i++)
- {
- MeasureMaintenanceFormula measureMaintenanceFormula = new MeasureMaintenanceFormula();
- measureMaintenanceFormula.FatherHoleTypeId = selectedItem.MeasureMaintenanceTreeFourthDataList[i].FatherHoleTypeId;
- measureMaintenanceFormula.FormulaExpression = selectedItem.MeasureMaintenanceTreeFourthDataList[i].FormulaExpression;
- measureMaintenanceFormula.FormulaExpressionLineID = selectedItem.MeasureMaintenanceTreeFourthDataList[i].FormulaExpressionLineID;
- measureMaintenanceFormula.FormulaId = selectedItem.MeasureMaintenanceTreeFourthDataList[i].FormulaId;
- measureMaintenanceFormula.FormulaName = selectedItem.MeasureMaintenanceTreeFourthDataList[i].FormulaName;
- measureMaintenanceFormula.FormulaParentId = selectedItem.MeasureMaintenanceTreeFourthDataList[i].FormulaParentId;
- measureMaintenanceFormula.HoleType = selectedItem.MeasureMaintenanceTreeFourthDataList[i].HoleType;
- measureMaintenanceFormula.HoleTypeId = selectedItem.MeasureMaintenanceTreeFourthDataList[i].HoleTypeId;
- measureMaintenanceFormula.isConductiveCloth = selectedItem.MeasureMaintenanceTreeFourthDataList[i].isConductiveCloth;
- measureMaintenanceFormula.isFanweibuchang = selectedItem.MeasureMaintenanceTreeFourthDataList[i].isFanweibuchang;
- measureMaintenanceFormula.isErzhichuli = selectedItem.MeasureMaintenanceTreeFourthDataList[i].isErzhichuli;
- measureMaintenanceFormula.Specification = selectedItem.MeasureMaintenanceTreeFourthDataList[i].Specification;
- measureMaintenanceFormula.TestItems = selectedItem.MeasureMaintenanceTreeFourthDataList[i].TestItems;
- measureMaintenanceFormulas.Add(measureMaintenanceFormula);
- }
- copyData.measureMaintenanceBasicDataList.AddRange(measureMaintenanceBasicDatas);
- copyData.MeasureMaintenanceTreeFourthDataList.AddRange(measureMaintenanceFormulas);
- copyData.measureMaintenanceContent = selectedItem.measureMaintenanceContent;
- copyData.measureMaintenanceName = selectedItem.measureMaintenanceName;
- copyData.measureMaintenanceTypeId = selectedItem.measureMaintenanceTypeId;
- copyData.outputPicturesNum = selectedItem.outputPicturesNum;
- copyData.ruleMessage = selectedItem.ruleMessage;
- copyData.templateFilePath = selectedItem.templateFilePath;
- //更改顯示
- textMingcheng.Text = copyData.measureMaintenanceName + "-" + copyNum;//名稱
- this.copyName = textMingcheng.Text;
- #region [复制检验项目]
- string SourcePath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceType\\" + copyData.measureMaintenanceName + ".xml";
- string DestinationPath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceType\\" + textMingcheng.Text + ".xml";
- if (System.IO.File.Exists(SourcePath))
- {
- FileInfo flinfo = new FileInfo(SourcePath);
- flinfo.CopyTo(DestinationPath);
- }
- #endregion
- textBeizhu.Text = copyData.measureMaintenanceContent;//備注
- List<int> list = Program.instance.mic_rulersAll.Select(m => m.id).ToList();
- if (copyData.ruleMessage != null)
- {
- comboBox1.SelectedIndex = list.IndexOf(Convert.ToInt32(copyData.ruleMessage.ruleId));
- }
- if (!string.IsNullOrEmpty(copyData.NameRuleID))
- {
- List<string> dlist = Program.instance.fileNameRule.NameRuleList.Select(m => m.ID).ToList();
- if (dlist.Count > 0)
- {
- comboBox2.SelectedIndex = dlist.IndexOf(copyData.NameRuleID);
- }
- else
- {
- comboBox2.SelectedIndex = -1;
- }
- }
- textLiaohao.Text = copyData.measureMaintenanceBasicDataList[0].measureMaintenanceBasicDataValue;//料號
- textLiaohaoPosition.Text = copyData.measureMaintenanceBasicDataList[0].measureMaintenanceBasicDataPosition;
- comboBanci.SelectedItem = copyData.measureMaintenanceBasicDataList[1]. measureMaintenanceBasicDataValue;//班次
- textBanciPosition.Text = copyData.measureMaintenanceBasicDataList[1].measureMaintenanceBasicDataPosition;
- comboShiyanshi.SelectedItem = copyData.measureMaintenanceBasicDataList[2].measureMaintenanceBasicDataValue;//實驗室
- textShiyanshiPosition.Text = copyData.measureMaintenanceBasicDataList[2].measureMaintenanceBasicDataPosition;
- comboShiyongchangqu.SelectedItem = copyData.measureMaintenanceBasicDataList[3].measureMaintenanceBasicDataValue;//使用廠區
- textShiyongchangquPosition.Text = copyData.measureMaintenanceBasicDataList[3].measureMaintenanceBasicDataPosition;
- comboZhichengbie.SelectedItem = copyData.measureMaintenanceBasicDataList[4].measureMaintenanceBasicDataValue;//製成別
- textZhichengbiePosition.Text = copyData.measureMaintenanceBasicDataList[4].measureMaintenanceBasicDataPosition;
- textDanhao.Text = copyData.measureMaintenanceBasicDataList[5].measureMaintenanceBasicDataValue;//單號
- textDanhaoPosition.Text = copyData.measureMaintenanceBasicDataList[5].measureMaintenanceBasicDataPosition;
- textPihao.Text = copyData.measureMaintenanceBasicDataList[6].measureMaintenanceBasicDataValue;//批號
- textPihaoPosition.Text = copyData.measureMaintenanceBasicDataList[6].measureMaintenanceBasicDataPosition;
- comboCengbie.SelectedItem = copyData.measureMaintenanceBasicDataList[7].measureMaintenanceBasicDataValue;//層別
- textCengbiePosition.Text = copyData.measureMaintenanceBasicDataList[7].measureMaintenanceBasicDataPosition;
- comboDianduxianbie.Text = copyData.measureMaintenanceBasicDataList[8].measureMaintenanceBasicDataValue;//電鍍綫別
- textDianduxianbiePosition.Text = copyData.measureMaintenanceBasicDataList[8].measureMaintenanceBasicDataPosition;
- textDanwei.Text = copyData.measureMaintenanceBasicDataList[9].measureMaintenanceBasicDataValue;//單位
- textDanweiPosition.Text = copyData.measureMaintenanceBasicDataList[9].measureMaintenanceBasicDataPosition;
- textBoxDatePos.Text = copyData.measureMaintenanceBasicDataList[10].measureMaintenanceBasicDataPosition;//报告日期
-
- textOutNumber.Text = copyData.outputPicturesNum.ToString();//輸出圖片數量
- textModel.Text = copyData.templateFilePath;
- listRules.SelectedIndex = -1;
- this.formClosing(null, null);
- }
- /// <summary>
- /// 加载初始化
- /// </summary>2
- private void MeasureSettingDialog_Load(object sender, EventArgs e)
- {
- listRules.DataSource = null;
- listRules.DataSource = measureMaintenanceTypeList.measureMaintenanceTypeList;
- listRules.DisplayMember = "measureMaintenanceName";
- if (measureMaintenanceTypeList.measureMaintenanceTypeList == null || measureMaintenanceTypeList.measureMaintenanceTypeList.Count == 0)
- {
- buttonSetUp.Enabled = false;
- buttonCopy.Enabled = false;
- buttonDetermine.Enabled = false;
- buttonDelete.Enabled = false;
- }
- }
- /// <summary>
- /// 点击时显示选中的内容
- /// </summary>
- private void listRules_SelectedChange(object sender, EventArgs e)
- {
- if (this.listRules.SelectedItem == null)
- {
- return;
- }
- var copyData = (MeasureMaintenanceType)this.listRules.SelectedItem;
- this.copyName = string.Empty;
- if (copyData.ruleMessage == null)
- {
- comboBox1.SelectedIndex = -1;
- }
- else {
- List<mic_rulers> list = Program.instance.mic_rulersAll;
- var ruler = list.Where(m => m.ruler_name == copyData.ruleMessage.ruleName).FirstOrDefault();
- if (ruler != null)
- {
- comboBox1.SelectedIndex = list.IndexOf(ruler);
- }
- else {
- comboBox1.SelectedIndex = -1;
- }
- }
- if (!string.IsNullOrEmpty(copyData.NameRuleID))
- {
- List<string> dlist = Program.instance.fileNameRule.NameRuleList.Select(m => m.ID).ToList();
- if (dlist.Count > 0)
- {
- comboBox2.SelectedIndex = dlist.IndexOf(copyData.NameRuleID);
- }
- else {
- comboBox2.SelectedIndex = -1;
- }
- }
- else {
- comboBox2.SelectedIndex = -1;
- }
- //更改顯示
- textMingcheng.Text = copyData.measureMaintenanceName;//名稱
- textBeizhu.Text = copyData.measureMaintenanceContent;//備注
- List<MeasureMaintenanceBasicData> measureMaintenanceBasicDatas = new List<MeasureMaintenanceBasicData>();
- for (int i = 0; i < copyData.measureMaintenanceBasicDataList.Count; i++)
- {
- MeasureMaintenanceBasicData measureMaintenanceFormula = new MeasureMaintenanceBasicData();
- measureMaintenanceFormula.measureMaintenanceBasicDataIndex = copyData.measureMaintenanceBasicDataList[i].measureMaintenanceBasicDataIndex;
- measureMaintenanceFormula.measureMaintenanceBasicDataPosition = copyData.measureMaintenanceBasicDataList[i].measureMaintenanceBasicDataPosition;
- measureMaintenanceFormula.measureMaintenanceBasicDataValue = copyData.measureMaintenanceBasicDataList[i].measureMaintenanceBasicDataValue;
- measureMaintenanceBasicDatas.Add(measureMaintenanceFormula);
- }
- textLiaohao.Text = measureMaintenanceBasicDatas[0].measureMaintenanceBasicDataValue;//料號
- textLiaohaoPosition.Text = measureMaintenanceBasicDatas[0].measureMaintenanceBasicDataPosition;
- if (string.IsNullOrEmpty(measureMaintenanceBasicDatas[1].measureMaintenanceBasicDataValue))
- {
- comboBanci.SelectedIndex = -1;//班次
- }
- else {
- comboBanci.SelectedItem = measureMaintenanceBasicDatas[1].measureMaintenanceBasicDataValue;//班次
- }
- textBanciPosition.Text = measureMaintenanceBasicDatas[1].measureMaintenanceBasicDataPosition;
- if (string.IsNullOrEmpty(measureMaintenanceBasicDatas[2].measureMaintenanceBasicDataValue))
- {
- comboShiyanshi.SelectedIndex = -1;//班次
- }
- else
- {
- comboShiyanshi.SelectedItem = measureMaintenanceBasicDatas[2].measureMaintenanceBasicDataValue;//班次
- }
- textShiyanshiPosition.Text = measureMaintenanceBasicDatas[2].measureMaintenanceBasicDataPosition;
- if (string.IsNullOrEmpty(measureMaintenanceBasicDatas[3].measureMaintenanceBasicDataValue))
- {
- comboShiyongchangqu.SelectedIndex = -1;//班次
- }
- else
- {
- comboShiyongchangqu.SelectedItem = measureMaintenanceBasicDatas[3].measureMaintenanceBasicDataValue;//班次
- }
- textShiyongchangquPosition.Text = measureMaintenanceBasicDatas[3].measureMaintenanceBasicDataPosition;
- comboZhichengbie.SelectedItem = measureMaintenanceBasicDatas[4].measureMaintenanceBasicDataValue;//製成別
- if (string.IsNullOrEmpty(measureMaintenanceBasicDatas[4].measureMaintenanceBasicDataValue))
- {
- comboZhichengbie.SelectedIndex = -1;//班次
- }
- else
- {
- comboZhichengbie.SelectedItem = measureMaintenanceBasicDatas[4].measureMaintenanceBasicDataValue;//班次
- }
- textZhichengbiePosition.Text = measureMaintenanceBasicDatas[4].measureMaintenanceBasicDataPosition;
- textDanhao.Text = measureMaintenanceBasicDatas[5].measureMaintenanceBasicDataValue;//單號
- textDanhaoPosition.Text = measureMaintenanceBasicDatas[5].measureMaintenanceBasicDataPosition;
- textPihao.Text = measureMaintenanceBasicDatas[6].measureMaintenanceBasicDataValue;//批號
- textPihaoPosition.Text = measureMaintenanceBasicDatas[6].measureMaintenanceBasicDataPosition;
- if (string.IsNullOrEmpty(measureMaintenanceBasicDatas[7].measureMaintenanceBasicDataValue))
- {
- comboCengbie.SelectedIndex = -1;//班次
- }
- else
- {
- comboCengbie.SelectedItem = measureMaintenanceBasicDatas[7].measureMaintenanceBasicDataValue;//班次
- }
- textCengbiePosition.Text = measureMaintenanceBasicDatas[7].measureMaintenanceBasicDataPosition;
- comboDianduxianbie.Text = measureMaintenanceBasicDatas[8].measureMaintenanceBasicDataValue;//電鍍綫別
- textDianduxianbiePosition.Text = measureMaintenanceBasicDatas[8].measureMaintenanceBasicDataPosition;
- textDanwei.Text = measureMaintenanceBasicDatas[9].measureMaintenanceBasicDataValue;//單位
- textDanweiPosition.Text = measureMaintenanceBasicDatas[9].measureMaintenanceBasicDataPosition;
- //UNDONE:由于数据问题,暂时为try-catch
- try
- {
- textBoxDatePos.Text = copyData.measureMaintenanceBasicDataList[10].measureMaintenanceBasicDataPosition;//报告日期
- }
- catch
- {
- var mData = new MeasureMaintenanceBasicData();
- mData.measureMaintenanceBasicDataIndex = 10;
- mData.measureMaintenanceBasicDataPosition = "NowDateTime";
- copyData.measureMaintenanceBasicDataList.Add(mData);
- }
-
- textOutNumber.Text = copyData.outputPicturesNum.ToString();//輸出圖片數量
- textModel.Text = copyData.templateFilePath;
- this.everyFourmulaList.Clear();
- List<MeasureMaintenanceFormula> measureMaintenanceFormulas = new List<MeasureMaintenanceFormula>();
- for (int i = 0; i < copyData.MeasureMaintenanceTreeFourthDataList.Count; i++)
- {
- MeasureMaintenanceFormula measureMaintenanceFormula = new MeasureMaintenanceFormula();
- measureMaintenanceFormula.FatherHoleTypeId = copyData.MeasureMaintenanceTreeFourthDataList[i].FatherHoleTypeId;
- measureMaintenanceFormula.FormulaExpression = copyData.MeasureMaintenanceTreeFourthDataList[i].FormulaExpression;
- measureMaintenanceFormula.FormulaExpressionLineID = copyData.MeasureMaintenanceTreeFourthDataList[i].FormulaExpressionLineID;
- measureMaintenanceFormula.FormulaId = copyData.MeasureMaintenanceTreeFourthDataList[i].FormulaId;
- measureMaintenanceFormula.FormulaName = copyData.MeasureMaintenanceTreeFourthDataList[i].FormulaName;
- measureMaintenanceFormula.FormulaParentId = copyData.MeasureMaintenanceTreeFourthDataList[i].FormulaParentId;
- measureMaintenanceFormula.HoleType = copyData.MeasureMaintenanceTreeFourthDataList[i].HoleType;
- measureMaintenanceFormula.HoleTypeId = copyData.MeasureMaintenanceTreeFourthDataList[i].HoleTypeId;
- measureMaintenanceFormula.isConductiveCloth = copyData.MeasureMaintenanceTreeFourthDataList[i].isConductiveCloth;
- measureMaintenanceFormula.isFanweibuchang = copyData.MeasureMaintenanceTreeFourthDataList[i].isFanweibuchang;
- measureMaintenanceFormula.isErzhichuli = copyData.MeasureMaintenanceTreeFourthDataList[i].isErzhichuli;
- measureMaintenanceFormula.Specification = copyData.MeasureMaintenanceTreeFourthDataList[i].Specification;
- measureMaintenanceFormula.TestItems = copyData.MeasureMaintenanceTreeFourthDataList[i].TestItems;
- measureMaintenanceFormulas.Add(measureMaintenanceFormula);
- }
- this.everyFourmulaList.AddRange(measureMaintenanceFormulas);
- OutInfoShow();
- }
- /// <summary>
- /// 写入XML
- /// </summary>
- public void WriteXml()
- {
- string filePath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceTypeList.xml";
- string stageModelXml = XmlSerializeHelper.XmlSerialize<MeasureMaintenanceTypeList>(measureMaintenanceTypeList);
- FileOperationHelper.WriteStringToFile(stageModelXml, filePath, FileMode.Create);
- //清空未命名XMl
- string path = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceType\\.xml";
- if (System.IO.File.Exists(path))
- {
- try
- {
- string newpath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\MeasureMaintenanceType\\"+ this.textMingcheng.Text +".xml";
- System.IO.File.Move(path, newpath);
- }
- catch (Exception)
- {
- }
- }
- }
- /// <summary>
- /// 讀取基本信息
- /// </summary>
- private void ReadXml2()
- {
- XmlDocument xDoc = new XmlDocument();
- string filePath = Application.StartupPath + "\\Config\\" + Program.instance.SettingPrefix + "\\basicInformation.xml";
- if (System.IO.File.Exists(filePath))
- {
- xDoc.Load(filePath);
- }
- else
- {
- XmlDeclaration declaration = xDoc.CreateXmlDeclaration("1.0", "UTF-8", "yes");
- xDoc.AppendChild(declaration);
- //根结点
- XmlElement genjiedian = xDoc.CreateElement("leixings");
- xDoc.AppendChild(genjiedian);
- //规程结点
- for (int i = 0; i < 6; i++)
- {
- XmlElement leixing = xDoc.CreateElement("類型");
- genjiedian.AppendChild(leixing);
- }
- xDoc.Save(filePath);
- }
- XmlNode rootNode = xDoc.SelectSingleNode("leixings");
- XmlNodeList leixingList = rootNode.ChildNodes;
- for (int i = 0; i < leixingList.Count; i++)
- {
- XmlNodeList leixingChild = leixingList[i].ChildNodes;
- List<string> strList = new List<string>();
- for (int j = 0; j < leixingChild.Count; j++)
- {
- string mingcheng = leixingChild[j].InnerText;
- strList.Add(mingcheng);
- }
- switch (i) {
- case 0:
- comboShiyongchangqu.DataSource = strList;
- break;
- case 1:
- comboShiyanshi.DataSource = strList;
- break;
- case 2:
- comboCengbie.DataSource = strList;
- break;
- case 3:
- comboZhichengbie.DataSource = strList;
- break;
- case 4:
- comboBanci.DataSource = strList;
- break;
- //case 5:
- // comboDianduxianbie.DataSource = strList;
- // break;
- }
- }
- }
- /// <summary>
- /// 輸出信息顯示
- /// </summary>
- private void OutInfoShow()
- {
- panelOutInfo.Controls.Clear();
- int height = 38;
- int width = (groupOutInfo.Size.Width - 14) / 4;
- string[] titles = { PdnResources.GetString("Pass"), PdnResources.GetString("InspectionItem"), PdnResources.GetString("Size"), PdnResources.GetString("MeasuringPos") }; // 孔型 檢驗項目 規格 測量位置
- string[] titleNames = { "kongxing", "jianyanxiangmu", "guige", "celiangweizhi" };
- List<Label> positions = new List<Label>();
- List<Label> specifications = new List<Label>();
- List<Label> testItems = new List<Label>();
- List<Label> holeTypes = new List<Label>();
- int i,k;
- for (i = 0; i < 4; i++)
- {
- Label title = new Label();
- title.AutoSize = false;
- title.TextAlign = ContentAlignment.MiddleCenter;
- title.BorderStyle = BorderStyle.FixedSingle;
- title.Location = new System.Drawing.Point(3 + (width - 1) * i, 1);
- title.Name = titleNames[i];
- title.Size = new System.Drawing.Size(width, height);
- title.TabIndex = 2;
- title.Text = titles[i];
- panelOutInfo.Controls.Add(title);
- }
- var list1 = everyFourmulaList.GroupBy(m => m.HoleType);
- foreach (var item in list1)
- {
- int rowInt = 0;
- var list2 = item.GroupBy(m => m.TestItems);
- foreach (var item2 in list2)
- {
- k = 0;
- foreach (var item3 in item2)
- {
- #region [測量位置]
- Label position = new Label();
- position.AutoSize = false;
- position.TextAlign = ContentAlignment.MiddleCenter;
- position.BorderStyle = BorderStyle.FixedSingle;
- if (positions.Count == 0)
- position.Location = new System.Drawing.Point(3 + (width - 1) * 3, height);
- else
- position.Location = new System.Drawing.Point(3 + (width - 1) * 3, positions[positions.Count - 1].Location.Y + height - 1);
- position.Name = item3.FormulaParentId + "3";
- position.Size = new System.Drawing.Size(width, height);
- position.TabIndex = 2;
- position.Text = item3.FormulaName;
- panelOutInfo.Controls.Add(position);
- positions.Add(position);
- #endregion
- k++;
- rowInt++;
- }
- // TODO:规格
- #region [規格]
- Label specification = new Label();
- specification.AutoSize = false;
- specification.TextAlign = ContentAlignment.MiddleCenter;
- specification.BorderStyle = BorderStyle.FixedSingle;
- if (specifications.Count == 0)
- specification.Location = new System.Drawing.Point(3 + (width - 1) * 2, height);
- else
- specification.Location = new System.Drawing.Point(3 + (width - 1) * 2, specifications[specifications.Count - 1].Location.Y + specifications[specifications.Count - 1].Size.Height - 1);
- specification.Name = item2.First().Specification + "2";
- specification.Size = new System.Drawing.Size(width, height * k - (k - 1));
- specification.TabIndex = 2;
- #region[替换字符]
- item2.First().Specification = item2.First().Specification.Replace("LQ", "<=");
- item2.First().Specification = item2.First().Specification.Replace("L", "<");
- #endregion
- specification.Text = item2.First().Specification;
- //specification.Text = "1";
- panelOutInfo.Controls.Add(specification);
- specifications.Add(specification);
- #endregion
- #region [檢驗項目]
- Label testItem = new Label();
- testItem.AutoSize = false;
- testItem.TextAlign = ContentAlignment.MiddleCenter;
- testItem.BorderStyle = BorderStyle.FixedSingle;
- if (testItems.Count == 0)
- testItem.Location = new System.Drawing.Point(3 + (width - 1) * 1, height);
- else
- testItem.Location = new System.Drawing.Point(3 + (width - 1) * 1, testItems[testItems.Count - 1].Location.Y + testItems[testItems.Count - 1].Size.Height - 1);
- testItem.Name = item2.Key + "1";
- testItem.Size = new System.Drawing.Size(width, height * k - (k - 1));
- testItem.TabIndex = 2;
- testItem.Text = item2.Key;
- panelOutInfo.Controls.Add(testItem);
- testItems.Add(testItem);
- #endregion
- }
- #region [孔型]
- Label holeType = new Label();
- holeType.AutoSize = false;
- holeType.TextAlign = ContentAlignment.MiddleCenter;
- holeType.BorderStyle = BorderStyle.FixedSingle;
- if (holeTypes.Count == 0)
- holeType.Location = new System.Drawing.Point(3, height);
- else
- holeType.Location = new System.Drawing.Point(3, holeTypes[holeTypes.Count - 1].Location.Y + holeTypes[holeTypes.Count - 1].Size.Height - 1);
- holeType.Name = item.Key + "0";
- holeType.Size = new System.Drawing.Size(width, height * rowInt - (rowInt - 1));
- holeType.TabIndex = 2;
- holeType.Text = item.Key;
- panelOutInfo.Controls.Add(holeType);
- holeTypes.Add(holeType);
- #endregion
- }
- }
- private void MeasureSettingDialog_Resize(object sender, EventArgs e)
- {
- panelOutInfo.Controls.Clear();
- OutInfoShow();
- }
- /// <summary>
- /// 选择模板
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void buttonChooseModel_Click(object sender, EventArgs e)
- {
- OpenFileDialog dialog = new OpenFileDialog();
- dialog.Filter = "Excel文件|*.xls;*.xlsx";
- dialog.Multiselect = false; //该值确定是否可以选择多个文件
- if (dialog.ShowDialog() != DialogResult.OK)
- {
- return;
- }
- string file = dialog.FileName;
- textModel.Text = file;
- }
- /// <summary>
- /// 标尺选中
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- int index = this.comboBox1.SelectedIndex;
- if (index == -1) {
- textDanwei.Text = this.appWorkspace.GetPxPerUnit()[1];//單位
- return;
- }
- var ruler = Program.instance.mic_rulersAll[index];
- textDanwei.Text = InvariantData.unitsDictionary[ruler.ruler_units];
- }
- /// <summary>
- /// 打开
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button1_Click(object sender, EventArgs e)
- {
- string path = textModel.Text;
- try
- {
- if (!OfficeFileHandleHelper.OpenOfficeFile(path))
- {
- MessageBox.Show(PdnResources.GetString("Menu.Fileopenfailed.Text"));
- }
- }
- catch (Exception)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Fileopenfailed.Text"));
- }
- }
- /// <summary>
- /// 基础信息设置
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button2_Click(object sender, EventArgs e)
- {
- using (BasicInformationSettings af = new BasicInformationSettings(this))
- {
- af.StartPosition = FormStartPosition.CenterScreen;
- af.ShowDialog();
- }
- }
- /// <summary>
- ///
- /// </summary>
- public void resetInformation() {
- ReadXml2();
- comboShiyongchangqu.SelectedIndex = -1;
- comboShiyanshi.SelectedIndex = -1;
- comboCengbie.SelectedIndex = -1;
- comboZhichengbie.SelectedIndex = -1;
- comboBanci.SelectedIndex = -1;
- }
- }
- }
|