Browse Source

Merge branch 'master' of ssh://10.10.101.21/source/mes-client

Hcsy 8 years ago
parent
commit
bc43b5db50

+ 134 - 70
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.Designer.cs

@@ -36,7 +36,7 @@
             this.label4 = new System.Windows.Forms.Label();
             this.sncode_label = new System.Windows.Forms.Label();
             this.pr_detail_label = new System.Windows.Forms.Label();
-            this.label1 = new System.Windows.Forms.Label();
+            this.sncode = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
             this.PrintLabel = new System.Windows.Forms.ComboBox();
             this.Printer = new UAS_MES.CustomControl.ComBoxWithFocus.PrinterCombox();
@@ -46,17 +46,22 @@
             this.pr_detail = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.ms_makecode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.PrintNum = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
-            this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
+            this.label3 = new System.Windows.Forms.Label();
+            this.load = new System.Windows.Forms.RadioButton();
+            this.unload = new System.Windows.Forms.RadioButton();
+            this.code = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.code_label = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
             // ms_makecode_label
             // 
             this.ms_makecode_label.AutoSize = true;
             this.ms_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode_label.Location = new System.Drawing.Point(33, 41);
+            this.ms_makecode_label.Location = new System.Drawing.Point(50, 62);
+            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_makecode_label.Name = "ms_makecode_label";
-            this.ms_makecode_label.Size = new System.Drawing.Size(74, 21);
+            this.ms_makecode_label.Size = new System.Drawing.Size(110, 31);
             this.ms_makecode_label.TabIndex = 125;
             this.ms_makecode_label.Text = "归属工单";
             // 
@@ -64,9 +69,10 @@
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(252, 41);
+            this.pr_code_label.Location = new System.Drawing.Point(378, 62);
+            this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_code_label.Name = "pr_code_label";
-            this.pr_code_label.Size = new System.Drawing.Size(74, 21);
+            this.pr_code_label.Size = new System.Drawing.Size(110, 31);
             this.pr_code_label.TabIndex = 126;
             this.pr_code_label.Text = "产品编号";
             // 
@@ -74,9 +80,10 @@
             // 
             this.mcd_okqty_label.AutoSize = true;
             this.mcd_okqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty_label.Location = new System.Drawing.Point(33, 90);
+            this.mcd_okqty_label.Location = new System.Drawing.Point(378, 130);
+            this.mcd_okqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_okqty_label.Name = "mcd_okqty_label";
-            this.mcd_okqty_label.Size = new System.Drawing.Size(74, 21);
+            this.mcd_okqty_label.Size = new System.Drawing.Size(110, 31);
             this.mcd_okqty_label.TabIndex = 127;
             this.mcd_okqty_label.Text = "打印计数";
             // 
@@ -84,9 +91,10 @@
             // 
             this.mcd_remainqty_label.AutoSize = true;
             this.mcd_remainqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty_label.Location = new System.Drawing.Point(252, 90);
+            this.mcd_remainqty_label.Location = new System.Drawing.Point(706, 130);
+            this.mcd_remainqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_remainqty_label.Name = "mcd_remainqty_label";
-            this.mcd_remainqty_label.Size = new System.Drawing.Size(58, 21);
+            this.mcd_remainqty_label.Size = new System.Drawing.Size(86, 31);
             this.mcd_remainqty_label.TabIndex = 128;
             this.mcd_remainqty_label.Text = "剩余数";
             // 
@@ -94,9 +102,10 @@
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(471, 90);
+            this.label4.Location = new System.Drawing.Point(1121, 222);
+            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(74, 21);
+            this.label4.Size = new System.Drawing.Size(110, 31);
             this.label4.TabIndex = 129;
             this.label4.Text = "打印张数";
             // 
@@ -106,9 +115,10 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.sncode_label.AutoSize = true;
             this.sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sncode_label.Location = new System.Drawing.Point(33, 448);
+            this.sncode_label.Location = new System.Drawing.Point(50, 128);
+            this.sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.sncode_label.Name = "sncode_label";
-            this.sncode_label.Size = new System.Drawing.Size(58, 21);
+            this.sncode_label.Size = new System.Drawing.Size(86, 31);
             this.sncode_label.TabIndex = 145;
             this.sncode_label.Text = "序列号";
             // 
@@ -116,29 +126,32 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(471, 41);
+            this.pr_detail_label.Location = new System.Drawing.Point(706, 62);
+            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
+            this.pr_detail_label.Size = new System.Drawing.Size(110, 31);
             this.pr_detail_label.TabIndex = 146;
             this.pr_detail_label.Text = "产品名称";
             // 
-            // label1
+            // sncode
             // 
-            this.label1.AutoSize = true;
-            this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(745, 90);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(42, 21);
-            this.label1.TabIndex = 160;
-            this.label1.Text = "标签";
+            this.sncode.AutoSize = true;
+            this.sncode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.sncode.Location = new System.Drawing.Point(1118, 135);
+            this.sncode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.sncode.Name = "sncode";
+            this.sncode.Size = new System.Drawing.Size(62, 31);
+            this.sncode.TabIndex = 160;
+            this.sncode.Text = "标签";
             // 
             // label2
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(745, 39);
+            this.label2.Location = new System.Drawing.Point(1118, 58);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(58, 21);
+            this.label2.Size = new System.Drawing.Size(86, 31);
             this.label2.TabIndex = 161;
             this.label2.Text = "打印机";
             // 
@@ -146,27 +159,27 @@
             // 
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(822, 90);
-            this.PrintLabel.Margin = new System.Windows.Forms.Padding(2);
+            this.PrintLabel.Location = new System.Drawing.Point(1233, 135);
             this.PrintLabel.Name = "PrintLabel";
-            this.PrintLabel.Size = new System.Drawing.Size(152, 20);
+            this.PrintLabel.Size = new System.Drawing.Size(226, 26);
             this.PrintLabel.TabIndex = 162;
             // 
             // Printer
             // 
-            this.Printer.Location = new System.Drawing.Point(822, 39);
-            this.Printer.Margin = new System.Windows.Forms.Padding(4);
+            this.Printer.Location = new System.Drawing.Point(1233, 58);
+            this.Printer.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.Printer.Name = "Printer";
-            this.Printer.Size = new System.Drawing.Size(152, 25);
+            this.Printer.Size = new System.Drawing.Size(228, 38);
             this.Printer.TabIndex = 159;
             // 
             // mcd_remainqty
             // 
             this.mcd_remainqty.AutoSize = true;
             this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty.Location = new System.Drawing.Point(347, 90);
+            this.mcd_remainqty.Location = new System.Drawing.Point(848, 130);
+            this.mcd_remainqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_remainqty.Name = "mcd_remainqty";
-            this.mcd_remainqty.Size = new System.Drawing.Size(19, 21);
+            this.mcd_remainqty.Size = new System.Drawing.Size(28, 31);
             this.mcd_remainqty.TabIndex = 158;
             this.mcd_remainqty.Text = "0";
             // 
@@ -174,9 +187,10 @@
             // 
             this.mcd_okqty.AutoSize = true;
             this.mcd_okqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty.Location = new System.Drawing.Point(127, 90);
+            this.mcd_okqty.Location = new System.Drawing.Point(518, 130);
+            this.mcd_okqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_okqty.Name = "mcd_okqty";
-            this.mcd_okqty.Size = new System.Drawing.Size(19, 21);
+            this.mcd_okqty.Size = new System.Drawing.Size(28, 31);
             this.mcd_okqty.TabIndex = 157;
             this.mcd_okqty.Text = "0";
             // 
@@ -184,9 +198,10 @@
             // 
             this.pr_code.AutoSize = true;
             this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code.Location = new System.Drawing.Point(347, 41);
+            this.pr_code.Location = new System.Drawing.Point(520, 62);
+            this.pr_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_code.Name = "pr_code";
-            this.pr_code.Size = new System.Drawing.Size(0, 21);
+            this.pr_code.Size = new System.Drawing.Size(0, 31);
             this.pr_code.TabIndex = 156;
             this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
             // 
@@ -194,18 +209,20 @@
             // 
             this.pr_detail.AutoSize = true;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(568, 41);
+            this.pr_detail.Location = new System.Drawing.Point(852, 62);
+            this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail.Name = "pr_detail";
-            this.pr_detail.Size = new System.Drawing.Size(0, 21);
+            this.pr_detail.Size = new System.Drawing.Size(0, 31);
             this.pr_detail.TabIndex = 154;
             // 
             // ms_makecode
             // 
             this.ms_makecode.AutoSize = true;
             this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(127, 41);
+            this.ms_makecode.Location = new System.Drawing.Point(190, 62);
+            this.ms_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_makecode.Name = "ms_makecode";
-            this.ms_makecode.Size = new System.Drawing.Size(0, 21);
+            this.ms_makecode.Size = new System.Drawing.Size(0, 31);
             this.ms_makecode.TabIndex = 152;
             // 
             // PrintNum
@@ -213,51 +230,94 @@
             this.PrintNum.AllPower = null;
             this.PrintNum.BackColor = System.Drawing.Color.White;
             this.PrintNum.ID = null;
-            this.PrintNum.Location = new System.Drawing.Point(566, 90);
+            this.PrintNum.Location = new System.Drawing.Point(1264, 222);
+            this.PrintNum.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.PrintNum.Name = "PrintNum";
             this.PrintNum.Negative = false;
             this.PrintNum.Power = null;
-            this.PrintNum.Size = new System.Drawing.Size(165, 21);
+            this.PrintNum.Size = new System.Drawing.Size(197, 28);
             this.PrintNum.Str = null;
             this.PrintNum.Str1 = null;
             this.PrintNum.Str2 = null;
             this.PrintNum.TabIndex = 151;
             // 
-            // sncode
-            // 
-            this.sncode.AllPower = "ifall";
-            this.sncode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Left)));
-            this.sncode.BackColor = System.Drawing.Color.White;
-            this.sncode.ID = null;
-            this.sncode.Location = new System.Drawing.Point(122, 449);
-            this.sncode.Name = "sncode";
-            this.sncode.Power = null;
-            this.sncode.Size = new System.Drawing.Size(196, 21);
-            this.sncode.Str = null;
-            this.sncode.Str1 = null;
-            this.sncode.Str2 = null;
-            this.sncode.TabIndex = 144;
-            this.sncode.Tag = "ifwrite";
-            this.sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sn_code_KeyDown);
-            // 
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(37, 130);
+            this.OperateResult.Location = new System.Drawing.Point(56, 195);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(706, 305);
+            this.OperateResult.Size = new System.Drawing.Size(1057, 456);
             this.OperateResult.TabIndex = 143;
             this.OperateResult.Text = "";
             // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label3.Location = new System.Drawing.Point(174, 128);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(0, 31);
+            this.label3.TabIndex = 163;
+            // 
+            // load
+            // 
+            this.load.AutoSize = true;
+            this.load.Location = new System.Drawing.Point(72, 679);
+            this.load.Name = "load";
+            this.load.Size = new System.Drawing.Size(69, 22);
+            this.load.TabIndex = 164;
+            this.load.TabStop = true;
+            this.load.Text = "上料";
+            this.load.UseVisualStyleBackColor = true;
+            // 
+            // unload
+            // 
+            this.unload.AutoSize = true;
+            this.unload.Location = new System.Drawing.Point(247, 679);
+            this.unload.Name = "unload";
+            this.unload.Size = new System.Drawing.Size(69, 22);
+            this.unload.TabIndex = 165;
+            this.unload.TabStop = true;
+            this.unload.Text = "下料";
+            this.unload.UseVisualStyleBackColor = true;
+            // 
+            // code
+            // 
+            this.code.AllPower = null;
+            this.code.BackColor = System.Drawing.Color.White;
+            this.code.ID = null;
+            this.code.Location = new System.Drawing.Point(566, 678);
+            this.code.Name = "code";
+            this.code.Power = null;
+            this.code.Size = new System.Drawing.Size(196, 28);
+            this.code.Str = null;
+            this.code.Str1 = null;
+            this.code.Str2 = null;
+            this.code.TabIndex = 166;
+            // 
+            // code_label
+            // 
+            this.code_label.AutoSize = true;
+            this.code_label.Location = new System.Drawing.Point(458, 683);
+            this.code_label.Name = "code_label";
+            this.code_label.Size = new System.Drawing.Size(62, 18);
+            this.code_label.TabIndex = 167;
+            this.code_label.Text = "录入框";
+            // 
             // Make_ColorBoxLoadPrint
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1012, 483);
+            this.ClientSize = new System.Drawing.Size(1518, 724);
+            this.Controls.Add(this.code_label);
+            this.Controls.Add(this.code);
+            this.Controls.Add(this.unload);
+            this.Controls.Add(this.load);
+            this.Controls.Add(this.label3);
             this.Controls.Add(this.PrintLabel);
             this.Controls.Add(this.label2);
-            this.Controls.Add(this.label1);
+            this.Controls.Add(this.sncode);
             this.Controls.Add(this.Printer);
             this.Controls.Add(this.mcd_remainqty);
             this.Controls.Add(this.mcd_okqty);
@@ -267,7 +327,6 @@
             this.Controls.Add(this.PrintNum);
             this.Controls.Add(this.pr_detail_label);
             this.Controls.Add(this.sncode_label);
-            this.Controls.Add(this.sncode);
             this.Controls.Add(this.OperateResult);
             this.Controls.Add(this.label4);
             this.Controls.Add(this.mcd_remainqty_label);
@@ -275,6 +334,7 @@
             this.Controls.Add(this.pr_code_label);
             this.Controls.Add(this.ms_makecode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.Name = "Make_ColorBoxLoadPrint";
             this.Tag = "Make!ColorBoxLoadPrint";
             this.Text = "标签打印";
@@ -294,7 +354,6 @@
         private System.Windows.Forms.Label mcd_remainqty_label;
         private System.Windows.Forms.Label label4;
         private CustomControl.RichText.RichTextAutoBottom OperateResult;
-        private CustomControl.TextBoxWithIcon.EnterTextBox sncode;
         private System.Windows.Forms.Label sncode_label;
         private System.Windows.Forms.Label pr_detail_label;
         private CustomControl.TextBoxWithIcon.NumOnlyTextBox PrintNum;
@@ -304,8 +363,13 @@
         private CustomControl.ValueLabel.ValueNumLabel mcd_okqty;
         private CustomControl.ValueLabel.ValueNumLabel mcd_remainqty;
         private CustomControl.ComBoxWithFocus.PrinterCombox Printer;
-        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label sncode;
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.ComboBox PrintLabel;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.RadioButton load;
+        private System.Windows.Forms.RadioButton unload;
+        private CustomControl.TextBoxWithIcon.EnterTextBox code;
+        private System.Windows.Forms.Label code_label;
     }
 }

+ 34 - 32
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -19,7 +19,7 @@ namespace UAS_MES.Make
         //保存StepProduct查询出来的数据
         DataTable ListA = new DataTable();
         //保存make left join makecraftdetail left join product的数据
-        // DataTable ListB;
+        DataTable mapB;
         //保存ProductLabel数据
         DataTable ListC;
         //工序编号
@@ -31,24 +31,26 @@ namespace UAS_MES.Make
         //制造单号
         string ma_code;
         //当前工单的序列号
-        string sn_code;
+        //string sn_code;
         //当前提示的索引
         int RemainIndex = 0;
 
-        string Step = "Loading";
+        //string Step = "Loading";
 
         ApplicationClass lbl;
 
         public Make_ColorBoxLoadPrint()
         {
             InitializeComponent();
+            //默认选中上料
+            load.Checked = true;
         }
 
         private void 标签打印_Load(object sender, EventArgs e)
         {
             dh = new DataHelper();
             lbl = new ApplicationClass();
-            sncode.Focus();
+            code.Focus();
             asc.controllInitializeSize(this);
         }
 
@@ -56,28 +58,26 @@ namespace UAS_MES.Make
         {
             if (e.KeyCode == Keys.Enter)
             {
-                if (sncode.Text == "")
+                if (code.Text == "")
                 {
-                    OperateResult.AppendText(">>序列号不能为空\n", Color.Red);
+                    OperateResult.AppendText(">>输入内容不能为空\n", Color.Red);
                     return;
                 }
+                //string Omakecode;
+                //string Omsid;
+                //string Oerrormessage;
+                //LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, code.Text, User.UserCode, out Omakecode, out Omsid, out Oerrormessage)
                 //通过输入指定字符来设置当前执行的步骤
-                if (sncode.Text == "L")
+                if (load.Checked=true)
                 {
-                    Step = " ";
                     OperateResult.AppendText(">>开始执行上料工序\n", Color.Green);
-                    sncode.Text = "";
-                    return;
                 }
-                else if (sncode.Text == "R")
+                else if (unload.Checked=true)
                 {
-                    Step = "UnLoading";
                     OperateResult.AppendText(">>开始执行下料工序\n", Color.Green);
-                    sncode.Text = "";
-                    return;
                 }
                 //判断如果该序列号的归属工单和之前查询的是一致的话,就不进行重复数据的查询
-                ma_code = dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_sncode='" + sncode.Text + "'").ToString();
+                ma_code = dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_sncode='" + code.Text + "'").ToString();
                 if (ms_makecode.Text != ma_code || ma_code == "")
                 {
                     //ma_code不为空的时候表示不是第一次加载,提示用户切换工单
@@ -86,41 +86,43 @@ namespace UAS_MES.Make
                         OperateResult.AppendText(">>切换工单至工单号" + ma_code + "\n", Color.Red);
                     }
                     sql.Clear();
-                    sql.Append("select ma_code,mcd_okqty,ma_qty,ma_qty-mcd_inqty as mcd_remainqty,pr_detail,pr_code ");
+                    sql.Append("select ma_code as ms_makecode,mcd_okqty,ma_qty,ma_qty-mcd_inqty as mcd_remainqty,pr_detail,pr_code ");
                     sql.Append("from makeserial left join make on ms_makecode=ma_code left join product on ");
                     sql.Append("ms_prodcode=pr_code left join makecraftdetail on ms_makecode=mcd_macode where ms_sncode=:sncode");
-                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", sncode.Text);
+                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", code.Text);
                     if (dt.Rows.Count > 0)
                     {
                         BaseUtil.SetFormValue(this.Controls, dt);
-                        sn_code = sncode.Text;
+                        sncode.Text = code.Text;
                     }
                     else
                     {
-                        OperateResult.AppendText(">>序列号" + sncode.Text + "不存在\n", Color.Red);
+                        OperateResult.AppendText(">>序列号" + code.Text + "不存在\n", Color.Red);
                         return;
                     }
 
                     //判断当前的执行状态 ,Loading表示执行上料操作,UnLoading表示执行下料操作
-                    if (Step == "Loading")
+                    if (load.Checked=true)
                     {
                         sql.Clear();
                         sql.Append("select ma_code,ma_craftcode,ms_nextstepcode, ms_status,ms_stepcode from makeserial ");
                         sql.Append("left join make on ma_code=ms_makecode where ms_sncode=:sncode or ms_psn=:sncode");
-                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", sncode.Text, sncode.Text);
+                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", code.Text, code.Text);
                         //记录一些变量
                         stepcode = dt.Rows[0]["ms_stepcode"].ToString();
                         nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
                         craftcode = dt.Rows[0]["ma_craftcode"].ToString();
                         string ErrorMessage;
-                        bool ifFirst;
+                        string Omakecode;
+                        string Omsid;
+                        //string Oerrormessage;
                         //检测当前序列号和岗位资源是否对应
-                        if (LogicHandler.CheckCurrentStepAndIfFirst(sncode.Text, ms_makecode.Text, User.UserSourceCode, Tag.ToString(), out ifFirst, out ErrorMessage))
+                        if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, code.Text, User.UserCode, out Omakecode, out Omsid, out ErrorMessage))
                         {
                             //判断当前工序是否是上料工序cd_ifinput或者是否是测试工序cd_iftest
                             sql.Clear();
                             sql.Append("select cr_code,cd_stepcode,cd_ifinput,cd_iftest from makeserial left join  craft on ms_craftcode=cr_code left join craftdetail on cd_crid=cr_id and ");
-                            sql.Append("cd_stepcode=ms_nextstepcode where ms_sncode='" + sncode.Text + "' and ms_makecode='" + ms_makecode.Text + "'");
+                            sql.Append("cd_stepcode=ms_nextstepcode where ms_sncode='" + code.Text + "' and ms_makecode='" + ms_makecode.Text + "'");
                             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                             if (dt.Rows.Count > 0)
                             {
@@ -155,17 +157,17 @@ namespace UAS_MES.Make
                         }
                         else
                         {
-                            Print.CodeSoft(lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text);
+                            Print.CodeSoft(lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, code.Text);
                             OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                         }
                     }
                     //如果执行的是下料操作
-                    else if (Step == "UnLoading")
+                    else if (unload.Checked=true)
                     {
                         string ErrorMessage1 = "";
-                        if (LogicHandler.SetMaterialDown(sn_code, sncode.Text,User.UserSourceCode, User.CurrentStepCode, User.UserName, out ErrorMessage1))
+                        if (LogicHandler.SetMaterialDown(sncode.Text, code.Text,User.UserSourceCode, User.CurrentStepCode, User.UserName, out ErrorMessage1))
                         {
-                            OperateResult.AppendText(">>条码" + sncode.Text + "下料成功\n", Color.Green);
+                            OperateResult.AppendText(">>条码" + code.Text + "下料成功\n", Color.Green);
                         }
                         else
                         {
@@ -187,7 +189,7 @@ namespace UAS_MES.Make
                         if (RemainIndex == ListA.Rows.Count - 1)
                         {
                             OperateResult.AppendText(">>序列号对应的工单已经采集完成\n", Color.Green);
-                            sn_code = "";
+                            sncode.Text = "";
                             return;
                         }
                         string ErrorMessage;
@@ -195,7 +197,7 @@ namespace UAS_MES.Make
                         string soncode = ListA.Rows[RemainIndex]["sp_soncode"].ToString();
                         string sonID = ListA.Rows[RemainIndex]["sp_id"].ToString();
                         //执行上料
-                        if (LogicHandler.SetMaterialUp(sn_code, ms_makecode.Text, sncode.Text, soncode, User.UserSourceCode, User.UserName, sonID, out ErrorMessage))
+                        if (LogicHandler.SetMaterialUp(sncode.Text, ms_makecode.Text, code.Text, soncode, User.UserSourceCode, User.UserName, sonID, out ErrorMessage))
                         {
                             RemainIndex = RemainIndex + 1;
                             OperateResult.AppendText(">>请采集物料编号为" + ListA.Rows[RemainIndex]["sp_soncode"].ToString() + "的条码\n", Color.Green);
@@ -220,7 +222,7 @@ namespace UAS_MES.Make
             //局部变量ErrorMessage1
             string ErrorMessage1;
             //由于打印驱动暂时不可用,暂时注释打印方法
-            if (LogicHandler.SetCollectionFinish(sncode.Text, ms_makecode.Text, User.UserName, User.UserSourceCode, out ErrorMessage1))
+            if (LogicHandler.SetCollectionFinish(code.Text, ms_makecode.Text, User.UserName, User.UserSourceCode, out ErrorMessage1))
             {
                 sncode.Text = "";
                 //如果值为空默认设置为0
@@ -255,7 +257,7 @@ namespace UAS_MES.Make
 
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
-            dt = (DataTable)dh.ExecuteSql("select pl_labelname,pl_labelcode from productlabel where pl_prodcode='" + pr_code.Text + "'", "select");
+            dt = (DataTable)dh.ExecuteSql("select pl_labelname,pl_labelcode from productlabel where pl_prodcode='" + pr_code.Text + "' order by pl_isdefault desc", "select");
             PrintLabel.DataSource = dt;
             PrintLabel.DisplayMember = "pl_labelname";
             PrintLabel.ValueMember = "pl_labelcode";

+ 39 - 210
UAS-MES/FunctionCode/Make/Make_FuselageLabelPrint.cs

@@ -17,29 +17,29 @@ namespace UAS_MES.Make
         LogStringBuilder sql = new LogStringBuilder();
         AutoSizeFormClass asc = new AutoSizeFormClass();
         //保存StepProduct查询出来的数据
-        DataTable ListA = new DataTable();
+        //        DataTable ListA = new DataTable();
         //保存make left join makecraftdetail left join product的数据
         // DataTable ListB;
         DataTable mapB;
         //保存ProductLabel数据
         DataTable ListC;
         //工序编号
-        string stepcode;
+        //        string stepcode;
         //下一工序编号
-        string nextstepcode;
+        //        string nextstepcode;
         //工艺路线编号
-        string craftcode;
+        //        string craftcode;
         //制造单号
-        string make_code;
+        //        string make_code;
         //当前工单的序列号
-        string sn_code;
+        //        tring sn_code;
         //当前提示的索引
-        int RemainIndex = 0;
+        //        int RemainIndex = 0;
 
-        string Step = "Loading";
+        //        string Step = "Loading";
 
         ApplicationClass lbl;
-        
+
         string oErrorMessage = "";
 
         public Make_FuselageLabelPrint()
@@ -70,7 +70,8 @@ namespace UAS_MES.Make
                 string oMakeCode = "";
                 string oMsId = "";
                 //调用公共方法CheckStepSNAndMacode判断工序是否正确
-                if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, sncode.Text,User.UserCode,out oMakeCode,out oMsId, out oErrorMessage)) {
+                if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsId, out oErrorMessage))
+                {
                     //IF (如果ma_code 为空)THEN
                     if (ma_code.Text == "")
                     {
@@ -78,20 +79,22 @@ namespace UAS_MES.Make
                         sql.Clear();
                         sql.Append("select ma_code,nvl(mcd_okqty,0),ma_prodcode,pr_detail,");
                         sql.Append("pr_spec,ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on ");
-                        sql.Append("mcd_maid=ma_id left join product on pr_code=ma_prodcode where ma_code='"+oMakeCode+"' and mcd_stepcode='"+User.CurrentStepCode+"'");
-                        mapB = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-                        //将工单的其他信息赋值到对应的控件
-                        if (mapB.Rows.Count>0) {
-                            BaseUtil.SetFormValue(this.Controls,mapB);
+                        sql.Append("mcd_maid=ma_id left join product on pr_code=ma_prodcode where ma_code='" + oMakeCode + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
+                        mapB = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                        //如果有数据的话
+                        if (mapB.Rows.Count > 0)
+                        {
+                            //将工单的其他信息赋值到对应的控件
+                            BaseUtil.SetFormValue(this.Controls, mapB);
+                            //提示用户“<<工单号:取ma_makecode”
+                            OperateResult.AppendText("<<工单号:" + ma_code.Text + "\n", Color.Green);
+                            //提示用户“<< 序列号:XXXX”
+                            OperateResult.AppendText("<<序列号:" + sncode.Text + "\n", Color.Green);
                         }
-
-                        //获取对应 产品的机身标的打印模板
-                        sql.Clear();
-                        sql.Append("select * from productlabel where pl_prodcode='"+ma_prodcode.Text+"' and PL_LABELTYPE='彩盒标',");
-                        ListC = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-                        //查询没有结果就提示
-                        if (ListC.Rows.Count==0) {
-                            OperateResult.AppendText(">>该序列号对应的产品未维护机身标标签模板\n", Color.Red);
+                        //没有数据
+                        else
+                        {
+                            OperateResult.AppendText(">>无序列号" + sncode.Text + "对应工单信息\n", Color.Red);
                         }
 
                         //所选标签不为空
@@ -111,17 +114,18 @@ namespace UAS_MES.Make
                                 sncode.Text = "";
                                 sncode.Focus();
                                 //刷新打印数量和剩余数量
-                                mcd_remainqty.Text = int.Parse(mcd_remainqty.Text) - int.Parse(PrintNum.Text) + "";
-                                mcd_okqty.Text = int.Parse(PrintNum.Text)+"";
+                                mcd_remainqty.Text = int.Parse(mcd_remainqty.Text) - 1 + "";
+                                mcd_okqty.Text = int.Parse(mcd_okqty.Text) + 1 + "";
 
                                 //IF 剩余数=0,则清空form中的数据, 提示用户“工单:xx已经打印完成,>>请输入SN”, 清空mapB,listC 中的数据
                                 if (int.Parse(mcd_remainqty.Text) == 0)
                                 {
                                     BaseUtil.CleanForm(this);
-                                    OperateResult.AppendText(">>工单:"+ma_code.Text+"打印完成,>>请输入SN\n", Color.Green);
+                                    OperateResult.AppendText(">>工单:" + ma_code.Text + "打印完成,>>请输入SN\n", Color.Green);
                                 }
                                 //剩余数量不为0
-                                else {
+                                else
+                                {
                                     //提示用户“>>请输入SN”
                                     OperateResult.AppendText(">>请输入SN\n", Color.Green);
                                 }
@@ -133,200 +137,25 @@ namespace UAS_MES.Make
                             }
                         }
                         //标签为空
-                        else {
+                        else
+                        {
                             OperateResult.AppendText(">>无可用标签\n", Color.Red);
                         }
                     }
                 }
-                else {
-                    OperateResult.AppendText(">>"+oErrorMessage+"\n", Color.Red);
-                }
-
-                //    //通过输入指定字符来设置当前执行的步骤
-                //    if (sncode.Text == "L")
-                //    {
-                //        Step = " ";
-                //        OperateResult.AppendText(">>开始执行上料工序\n", Color.Green);
-                //        sncode.Text = "";
-                //        return;
-                //    }
-                //    else if (sncode.Text == "R")
-                //    {
-                //        Step = "UnLoading";
-                //        OperateResult.AppendText(">>开始执行下料工序\n", Color.Green);
-                //        sncode.Text = "";
-                //        return;
-                //    }
-                //    //判断如果该序列号的归属工单和之前查询的是一致的话,就不进行重复数据的查询
-                //    ma_code = dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_sncode='" + sncode.Text + "'").ToString();
-                //    if (ms_makecode.Text != ma_code || ma_code == "")
-                //    {
-                //        //ma_code不为空的时候表示不是第一次加载,提示用户切换工单
-                //        if (ma_code != "" && ms_makecode.Text != "")
-                //        {
-                //            OperateResult.AppendText(">>切换工单至工单号" + ma_code + "\n", Color.Red);
-                //        }
-                //        sql.Clear();
-                //        sql.Append("select ma_code,mcd_okqty,ma_qty,ma_qty-mcd_inqty as mcd_remainqty,pr_detail,pr_code ");
-                //        sql.Append("from makeserial left join make on ms_makecode=ma_code left join product on ");
-                //        sql.Append("ms_prodcode=pr_code left join makecraftdetail on ms_makecode=mcd_macode where ms_sncode=:sncode");
-                //        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", sncode.Text);
-                //        if (dt.Rows.Count > 0)
-                //        {
-                //            BaseUtil.SetFormValue(this.Controls, dt);
-                //            sn_code = sncode.Text;
-                //        }
-                //        else
-                //        {
-                //            OperateResult.AppendText(">>序列号" + sncode.Text + "不存在\n", Color.Red);
-                //            return;
-                //        }
-
-                //        //判断当前的执行状态 ,Loading表示执行上料操作,UnLoading表示执行下料操作
-                //        if (Step == "Loading")
-                //        {
-                //            sql.Clear();
-                //            sql.Append("select ma_code,ma_craftcode,ms_nextstepcode, ms_status,ms_stepcode from makeserial ");
-                //            sql.Append("left join make on ma_code=ms_makecode where ms_sncode=:sncode or ms_psn=:sncode");
-                //            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", sncode.Text, sncode.Text);
-                //            //记录一些变量
-                //            stepcode = dt.Rows[0]["ms_stepcode"].ToString();
-                //            nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
-                //            craftcode = dt.Rows[0]["ma_craftcode"].ToString();
-                //            string ErrorMessage;
-                //            bool ifFirst;
-                //            //检测当前序列号和岗位资源是否对应
-                //            if (LogicHandler.CheckCurrentStepAndIfFirst(sncode.Text, ms_makecode.Text, User.UserSourceCode, Tag.ToString(), out ifFirst, out ErrorMessage))
-                //            {
-                //                //判断当前工序是否是上料工序cd_ifinput或者是否是测试工序cd_iftest
-                //                sql.Clear();
-                //                sql.Append("select cr_code,cd_stepcode,cd_ifinput,cd_iftest from makeserial left join  craft on ms_craftcode=cr_code left join craftdetail on cd_crid=cr_id and ");
-                //                sql.Append("cd_stepcode=ms_nextstepcode where ms_sncode='" + sncode.Text + "' and ms_makecode='" + ms_makecode.Text + "'");
-                //                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                //                if (dt.Rows.Count > 0)
-                //                {
-                //                    //如果是上料工序
-                //                    if (dt.Rows[0]["cd_ifinput"].ToString() != "0")
-                //                    {
-                //                        // 查询没有结果,提示该上料工序没有需要上料的数据,请先维护对应的数据
-                //                        sql.Clear();
-                //                        sql.Append("select sp_id,sp_description,sp_soncode,pr_detail,pr_spec,sp_repcode,pr_id,sp_type,");
-                //                        sql.Append("'未采集' sp_ifpick ,sp_prefix,sp_length,sp_regex,sp_regex,sp_ifforsn from stepproduct ");
-                //                        sql.Append("left join product on pr_code=sp_soncode  where sp_craftcode='" + dt.Rows[0]["cd_ifinput"].ToString() + "' and sp_stepcode='" + dt.Rows[0]["cd_stepcode"].ToString() + "' ");
-                //                        sql.Append("And sp_mothercode='" + pr_code.Text + "' and ((sp_type='物料' and pr_tracekind<>2)or sp_type<>'物料') ");
-                //                        sql.Append("order by SP_DETNO asc");
-                //                        ListA = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                //                        //获取对应 产品的机身标的打印模板
-                //                        if (ListA.Rows.Count > 0)
-                //                        {
-                //                            OperateResult.AppendText(">>请采集" + ListA.Rows[RemainIndex]["sp_soncode"].ToString() + "的条码\n", Color.Green);
-                //                        }
-                //                        //未查询到数据时标识是测试工序
-                //                        else
-                //                        {
-                //                            DoTestProcedure();
-                //                        }
-                //                    }
-                //                    //同上,如果,iftest不等于0也进入测试工序
-                //                    else if (dt.Rows[0]["cd_iftest"].ToString() != "0")
-                //                    {
-                //                        DoTestProcedure();
-                //                    }
-                //                }
-                //            }
-                //            else
-                //            {
-                //                Print.CodeSoft(lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text);
-                //                OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
-                //            }
-                //        }
-                //        //如果执行的是下料操作
-                //        else if (Step == "UnLoading")
-                //        {
-                //            string ErrorMessage1 = "";
-                //            if (LogicHandler.SetMaterialDown(sn_code, sncode.Text, User.CurrentStepCode, User.UserName, out ErrorMessage1))
-                //            {
-                //                OperateResult.AppendText(">>条码" + sncode.Text + "下料成功\n", Color.Green);
-                //            }
-                //            else
-                //            {
-                //                OperateResult.AppendText(">>" + ErrorMessage1 + "\n", Color.Red);
-                //            }
-                //        }
-                //    }
-                //    else
-                //    {
-                //        //如果ListA中没有数据执行的是测试工序
-                //        if (ListA.Rows.Count == 0)
-                //        {
-                //            DoTestProcedure();
-                //        }
-                //        //存在数据执行的是上料采集
-                //        else
-                //        {
-                //            //如果当前的索引和长度相等则表示采集完成
-                //            if (RemainIndex == ListA.Rows.Count - 1)
-                //            {
-                //                OperateResult.AppendText(">>序列号对应的工单已经采集完成\n", Color.Green);
-                //                sn_code = "";
-                //                return;
-                //            }
-                //            string ErrorMessage;
-                //            //获取上料需要传递的参数,sp_soncode,sp_id
-                //            string soncode = ListA.Rows[RemainIndex]["sp_soncode"].ToString();
-                //            string sonID = ListA.Rows[RemainIndex]["sp_id"].ToString();
-                //            //执行上料
-                //            if (LogicHandler.SetMaterialUp(sn_code, ms_makecode.Text, sncode.Text, soncode, User.UserSourceCode, User.UserName, sonID, out ErrorMessage))
-                //            {
-                //                RemainIndex = RemainIndex + 1;
-                //                OperateResult.AppendText(">>请采集物料编号为" + ListA.Rows[RemainIndex]["sp_soncode"].ToString() + "的条码\n", Color.Green);
-                //            }
-                //            else
-                //            {
-                //                OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
-                //            }
-                //        }
-                //    }
-            }
-        }
-
-        //执行测试工序
-        private void DoTestProcedure()
-        {
-            //局部变量ErrorMessage1
-            string ErrorMessage1;
-            //由于打印驱动暂时不可用,暂时注释打印方法
-            if (LogicHandler.SetCollectionFinish(sncode.Text, ma_code.Text, User.UserName, User.UserSourceCode, out ErrorMessage1))
-            {
-                sncode.Text = "";
-                //如果值为空默认设置为0
-                if (int.Parse(mcd_remainqty.Text) > 0)
-                {
-                    dh.UpdateByCondition("makecraftdetail", "mcd_okqty=mcd_okqty+1,mcd_inqty=mcd_inqty+1", "mcd_macode='" + ma_code.Text + "'");
-                    sql.Clear();
-                    sql.Append("select mcd_okqty,ma_qty-mcd_inqty mcd_remainqty from makecraftdetail left join make on ");
-                    sql.Append("ma_code=mcd_macode where mcd_macode='" + ma_code.Text + "'");
-                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                    BaseUtil.SetFormValue(this.Controls, dt);
-                    if (mcd_remainqty.Text == "0")
-                    {
-                        OperateResult.AppendText(">>工单" + ma_code.Text + "采集完成\n", Color.Green);
-                        BaseUtil.CleanForm(this);
-                    }
-                }
                 else
                 {
-                    BaseUtil.CleanForm(this);
-                    OperateResult.AppendText(">>该序列号所属工单" + ma_code.Text + "已全部采集完成\n", Color.Green);
+                    OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red);
                 }
             }
-            else
-                MessageBox.Show(ErrorMessage1);
         }
-
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
-            dt = (DataTable)dh.ExecuteSql("select pl_labelname,pl_labelcode from productlabel where pl_prodcode='" + ma_prodcode.Text + "'", "select");
+            dt = (DataTable)dh.ExecuteSql("select pl_labelname,pl_labelcode from productlabel where pl_prodcode='" + ma_prodcode.Text + "'and PL_LABELTYPE='机身标' order by pl_isdefault desc", "select");
+            if (dt.Rows.Count == 0)
+            {
+                OperateResult.AppendText(">>该序列号对应的产品未维护机身标标签模板\n", Color.Red);
+            }
             PrintLabel.DataSource = dt;
             PrintLabel.DisplayMember = "pl_labelname";
             PrintLabel.ValueMember = "pl_labelcode";