Browse Source

修改打印张数赋值

章政 8 years ago
parent
commit
ea6588a408

+ 58 - 54
UAS-MES/FunctionCode/Make/Make_CustomLabelPrint.Designer.cs

@@ -39,7 +39,7 @@
             this.label6 = new System.Windows.Forms.Label();
             this.pr_detail = new System.Windows.Forms.Label();
             this.pr_spec = new System.Windows.Forms.Label();
-            this.printNum = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
+            this.PrintNum = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
             this.printButton = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.pr_code = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.inputText = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
@@ -51,9 +51,9 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label1.Location = new System.Drawing.Point(55, 37);
+            this.label1.Location = new System.Drawing.Point(49, 31);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(110, 31);
+            this.label1.Size = new System.Drawing.Size(92, 27);
             this.label1.TabIndex = 0;
             this.label1.Text = "产品代码";
             // 
@@ -61,9 +61,9 @@
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label2.Location = new System.Drawing.Point(58, 114);
+            this.label2.Location = new System.Drawing.Point(52, 95);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(110, 31);
+            this.label2.Size = new System.Drawing.Size(92, 27);
             this.label2.TabIndex = 1;
             this.label2.Text = "产品名称";
             // 
@@ -71,9 +71,9 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label3.Location = new System.Drawing.Point(423, 114);
+            this.label3.Location = new System.Drawing.Point(376, 95);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(62, 31);
+            this.label3.Size = new System.Drawing.Size(52, 27);
             this.label3.TabIndex = 2;
             this.label3.Text = "规格";
             // 
@@ -81,22 +81,22 @@
             // 
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(916, 117);
+            this.PrintLabel.Location = new System.Drawing.Point(814, 97);
             this.PrintLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.PrintLabel.Name = "PrintLabel";
-            this.PrintLabel.Size = new System.Drawing.Size(190, 26);
+            this.PrintLabel.Size = new System.Drawing.Size(169, 23);
             this.PrintLabel.TabIndex = 185;
-            this.PrintLabel.SelectedIndexChanged += new System.EventHandler(this.PrintLabel_SelectedIndexChanged);
+            this.PrintLabel.SelectedValueChanged += new System.EventHandler(this.PrintLabel_SelectedValueChanged);
             this.PrintLabel.TextChanged += new System.EventHandler(this.PrintLabel_TextChanged);
             // 
             // label4
             // 
             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(796, 33);
+            this.label4.Location = new System.Drawing.Point(708, 27);
             this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(86, 31);
+            this.label4.Size = new System.Drawing.Size(72, 27);
             this.label4.TabIndex = 184;
             this.label4.Text = "打印机";
             // 
@@ -104,10 +104,10 @@
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(807, 110);
+            this.label5.Location = new System.Drawing.Point(717, 92);
             this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(62, 31);
+            this.label5.Size = new System.Drawing.Size(52, 27);
             this.label5.TabIndex = 183;
             this.label5.Text = "标签";
             // 
@@ -117,10 +117,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(43, 550);
+            this.sncode_label.Location = new System.Drawing.Point(38, 458);
             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(86, 31);
+            this.sncode_label.Size = new System.Drawing.Size(72, 27);
             this.sncode_label.TabIndex = 188;
             this.sncode_label.Text = "输入框";
             // 
@@ -128,9 +128,9 @@
             // 
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label6.Location = new System.Drawing.Point(620, 553);
+            this.label6.Location = new System.Drawing.Point(551, 461);
             this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(62, 31);
+            this.label6.Size = new System.Drawing.Size(52, 27);
             this.label6.TabIndex = 189;
             this.label6.Text = "份数";
             // 
@@ -138,35 +138,36 @@
             // 
             this.pr_detail.AutoSize = true;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.pr_detail.Location = new System.Drawing.Point(174, 112);
+            this.pr_detail.Location = new System.Drawing.Point(155, 93);
             this.pr_detail.Name = "pr_detail";
-            this.pr_detail.Size = new System.Drawing.Size(0, 31);
+            this.pr_detail.Size = new System.Drawing.Size(0, 27);
             this.pr_detail.TabIndex = 193;
             // 
             // pr_spec
             // 
             this.pr_spec.AutoSize = true;
             this.pr_spec.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.pr_spec.Location = new System.Drawing.Point(491, 114);
+            this.pr_spec.Location = new System.Drawing.Point(436, 95);
             this.pr_spec.Name = "pr_spec";
-            this.pr_spec.Size = new System.Drawing.Size(0, 31);
+            this.pr_spec.Size = new System.Drawing.Size(0, 27);
             this.pr_spec.TabIndex = 194;
             // 
-            // printNum
-            // 
-            this.printNum.AllPower = null;
-            this.printNum.BackColor = System.Drawing.Color.White;
-            this.printNum.ID = null;
-            this.printNum.Location = new System.Drawing.Point(708, 553);
-            this.printNum.Name = "printNum";
-            this.printNum.Negative = false;
-            this.printNum.Power = null;
-            this.printNum.Size = new System.Drawing.Size(196, 28);
-            this.printNum.Str = null;
-            this.printNum.Str1 = null;
-            this.printNum.Str2 = null;
-            this.printNum.TabIndex = 195;
-            this.printNum.Text = "1";
+            // PrintNum
+            // 
+            this.PrintNum.AllPower = null;
+            this.PrintNum.BackColor = System.Drawing.Color.White;
+            this.PrintNum.ID = null;
+            this.PrintNum.Location = new System.Drawing.Point(629, 461);
+            this.PrintNum.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.PrintNum.Name = "PrintNum";
+            this.PrintNum.Negative = false;
+            this.PrintNum.Power = null;
+            this.PrintNum.Size = new System.Drawing.Size(175, 25);
+            this.PrintNum.Str = null;
+            this.PrintNum.Str1 = null;
+            this.PrintNum.Str2 = null;
+            this.PrintNum.TabIndex = 195;
+            this.PrintNum.Text = "1";
             // 
             // printButton
             // 
@@ -175,12 +176,13 @@
             this.printButton.DownImage = ((System.Drawing.Image)(resources.GetObject("printButton.DownImage")));
             this.printButton.Image = null;
             this.printButton.IsShowBorder = true;
-            this.printButton.Location = new System.Drawing.Point(957, 551);
+            this.printButton.Location = new System.Drawing.Point(851, 459);
+            this.printButton.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.printButton.MoveImage = ((System.Drawing.Image)(resources.GetObject("printButton.MoveImage")));
             this.printButton.Name = "printButton";
             this.printButton.NormalImage = ((System.Drawing.Image)(resources.GetObject("printButton.NormalImage")));
             this.printButton.Power = null;
-            this.printButton.Size = new System.Drawing.Size(75, 28);
+            this.printButton.Size = new System.Drawing.Size(67, 23);
             this.printButton.TabIndex = 192;
             this.printButton.Text = "打印";
             this.printButton.UseVisualStyleBackColor = false;
@@ -192,10 +194,11 @@
             this.pr_code.BackColor = System.Drawing.Color.White;
             this.pr_code.Font = new System.Drawing.Font("宋体", 9F);
             this.pr_code.ID = null;
-            this.pr_code.Location = new System.Drawing.Point(180, 40);
+            this.pr_code.Location = new System.Drawing.Point(160, 33);
+            this.pr_code.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.pr_code.Name = "pr_code";
             this.pr_code.Power = null;
-            this.pr_code.Size = new System.Drawing.Size(252, 28);
+            this.pr_code.Size = new System.Drawing.Size(224, 25);
             this.pr_code.Str = null;
             this.pr_code.Str1 = null;
             this.pr_code.Str2 = null;
@@ -210,11 +213,11 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.inputText.BackColor = System.Drawing.Color.White;
             this.inputText.ID = null;
-            this.inputText.Location = new System.Drawing.Point(167, 553);
-            this.inputText.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.inputText.Location = new System.Drawing.Point(148, 461);
+            this.inputText.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.inputText.Name = "inputText";
             this.inputText.Power = null;
-            this.inputText.Size = new System.Drawing.Size(292, 28);
+            this.inputText.Size = new System.Drawing.Size(260, 25);
             this.inputText.Str = null;
             this.inputText.Str1 = null;
             this.inputText.Str2 = null;
@@ -225,27 +228,27 @@
             // 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(49, 162);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.OperateResult.Location = new System.Drawing.Point(44, 135);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(1057, 354);
+            this.OperateResult.Size = new System.Drawing.Size(940, 296);
             this.OperateResult.TabIndex = 186;
             this.OperateResult.Text = "";
             // 
             // Printer
             // 
-            this.Printer.Location = new System.Drawing.Point(916, 37);
-            this.Printer.Margin = new System.Windows.Forms.Padding(6);
+            this.Printer.Location = new System.Drawing.Point(814, 31);
+            this.Printer.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
             this.Printer.Name = "Printer";
-            this.Printer.Size = new System.Drawing.Size(190, 37);
+            this.Printer.Size = new System.Drawing.Size(169, 31);
             this.Printer.TabIndex = 182;
             // 
             // Make_CustomLabelPrint
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1157, 618);
-            this.Controls.Add(this.printNum);
+            this.ClientSize = new System.Drawing.Size(1028, 515);
+            this.Controls.Add(this.PrintNum);
             this.Controls.Add(this.pr_spec);
             this.Controls.Add(this.pr_detail);
             this.Controls.Add(this.printButton);
@@ -262,6 +265,7 @@
             this.Controls.Add(this.label2);
             this.Controls.Add(this.label1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Name = "Make_CustomLabelPrint";
             this.Tag = "Make!CustomLabelPrint";
             this.Text = "Make_CustomLabelPrint";
@@ -290,6 +294,6 @@
         private CustomControl.ButtonUtil.NormalButton printButton;
         private System.Windows.Forms.Label pr_detail;
         private System.Windows.Forms.Label pr_spec;
-        private CustomControl.TextBoxWithIcon.NumOnlyTextBox printNum;
+        private CustomControl.TextBoxWithIcon.NumOnlyTextBox PrintNum;
     }
 }

+ 11 - 7
UAS-MES/FunctionCode/Make/Make_CustomLabelPrint.cs

@@ -174,7 +174,7 @@ namespace UAS_MES.Make
                         //保存本次赋值进行打印
                         doc.Save();
                         doc.Printer.SwitchTo(Printer.Text);
-                        doc.PrintDocument(int.Parse(printNum.Text));
+                        doc.PrintDocument(int.Parse(PrintNum.Text));
                         doc.Close();
                         //讲文件最后写入时间改成数据库中拿到的时间
                         //记录打印日志
@@ -234,11 +234,6 @@ namespace UAS_MES.Make
             asc.controlAutoSize(this);
         }
 
-        private void PrintLabel_SelectedIndexChanged(object sender, EventArgs e)
-        {
-           
-        }
-
         private void Make_CustomLabelPrint_FormClosing(object sender, FormClosingEventArgs e)
         {
             BaseUtil.ClosePrint(lbl);
@@ -273,7 +268,7 @@ namespace UAS_MES.Make
                 //保存本次赋值进行打印
                 doc.Save();
                 doc.Printer.SwitchTo(Printer.Text);
-                doc.PrintDocument(int.Parse(printNum.Text));
+                doc.PrintDocument(int.Parse(PrintNum.Text));
                 doc.Close();
                 //讲文件最后写入时间改成数据库中拿到的时间
                 //记录打印日志
@@ -286,5 +281,14 @@ namespace UAS_MES.Make
                 OperateResult.AppendText("<<标签参数未全部输入完成\n", Color.Red);
             }
         }
+
+        private void PrintLabel_SelectedValueChanged(object sender, EventArgs e)
+        {
+            if (PrintLabel.SelectedValue != null && PrintLabel.SelectedValue.ToString() != "System.Data.DataRowView")
+            {
+                string PrintNums = dh.getFieldDataByCondition("label", "la_printnos", "la_id='" + PrintLabel.SelectedValue.ToString() + "'").ToString();
+                PrintNum.Text = (PrintNums == "" ? "1" : PrintNums);
+            }
+        }
     }
 }