ソースを参照

自定义标签打印

shim 8 年 前
コミット
981798c4c9

+ 290 - 0
UAS-MES/FunctionCode/Make/Make_CustomLablePrint.Designer.cs

@@ -0,0 +1,290 @@
+namespace UAS_MES.FunctionCode.Make
+{
+    partial class Make_CustomLablePrint
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #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 void InitializeComponent()
+        {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_CustomLablePrint));
+            this.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.PrintLabel = new System.Windows.Forms.ComboBox();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.Printer = new UAS_MES.CustomControl.ComBoxWithFocus.PrinterCombox();
+            this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
+            this.sncode_label = new System.Windows.Forms.Label();
+            this.inputText = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.label6 = new System.Windows.Forms.Label();
+            this.pr_code = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.printButton = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            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.SuspendLayout();
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label1.Location = new System.Drawing.Point(55, 37);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(110, 31);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "产品代码";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label2.Location = new System.Drawing.Point(58, 114);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(110, 31);
+            this.label2.TabIndex = 1;
+            this.label2.Text = "产品名称";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label3.Location = new System.Drawing.Point(423, 114);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(62, 31);
+            this.label3.TabIndex = 2;
+            this.label3.Text = "规格";
+            // 
+            // PrintLabel
+            // 
+            this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.PrintLabel.FormattingEnabled = true;
+            this.PrintLabel.Location = new System.Drawing.Point(916, 117);
+            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.TabIndex = 185;
+            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.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.TabIndex = 184;
+            this.label4.Text = "打印机";
+            // 
+            // label5
+            // 
+            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.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.TabIndex = 183;
+            this.label5.Text = "标签";
+            // 
+            // Printer
+            // 
+            this.Printer.Location = new System.Drawing.Point(916, 37);
+            this.Printer.Margin = new System.Windows.Forms.Padding(6);
+            this.Printer.Name = "Printer";
+            this.Printer.Size = new System.Drawing.Size(190, 37);
+            this.Printer.TabIndex = 182;
+            // 
+            // 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.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(1057, 354);
+            this.OperateResult.TabIndex = 186;
+            this.OperateResult.Text = "";
+            // 
+            // sncode_label
+            // 
+            this.sncode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | 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.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.TabIndex = 188;
+            this.sncode_label.Text = "输入框";
+            // 
+            // inputText
+            // 
+            this.inputText.AllPower = "ifall";
+            this.inputText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | 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.Name = "inputText";
+            this.inputText.Power = null;
+            this.inputText.Size = new System.Drawing.Size(292, 28);
+            this.inputText.Str = null;
+            this.inputText.Str1 = null;
+            this.inputText.Str2 = null;
+            this.inputText.TabIndex = 187;
+            this.inputText.Tag = "ifwrite";
+            this.inputText.KeyDown += new System.Windows.Forms.KeyEventHandler(this.inputText_KeyDown);
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label6.Location = new System.Drawing.Point(620, 553);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(62, 31);
+            this.label6.TabIndex = 189;
+            this.label6.Text = "份数";
+            // 
+            // pr_code
+            // 
+            this.pr_code.AllPower = null;
+            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.Name = "pr_code";
+            this.pr_code.Power = null;
+            this.pr_code.Size = new System.Drawing.Size(252, 28);
+            this.pr_code.Str = null;
+            this.pr_code.Str1 = null;
+            this.pr_code.Str2 = null;
+            this.pr_code.TabIndex = 191;
+            this.pr_code.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pr_code_KeyDown);
+            // 
+            // printButton
+            // 
+            this.printButton.AllPower = null;
+            this.printButton.BackColor = System.Drawing.Color.Transparent;
+            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.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.TabIndex = 192;
+            this.printButton.Text = "打印";
+            this.printButton.UseVisualStyleBackColor = false;
+            // 
+            // pr_detail
+            // 
+            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.Name = "pr_detail";
+            this.pr_detail.Size = new System.Drawing.Size(0, 31);
+            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.Name = "pr_spec";
+            this.pr_spec.Size = new System.Drawing.Size(0, 31);
+            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";
+            // 
+            // Make_CustomLablePrint
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1157, 618);
+            this.Controls.Add(this.printNum);
+            this.Controls.Add(this.pr_spec);
+            this.Controls.Add(this.pr_detail);
+            this.Controls.Add(this.printButton);
+            this.Controls.Add(this.pr_code);
+            this.Controls.Add(this.label6);
+            this.Controls.Add(this.sncode_label);
+            this.Controls.Add(this.inputText);
+            this.Controls.Add(this.OperateResult);
+            this.Controls.Add(this.PrintLabel);
+            this.Controls.Add(this.label4);
+            this.Controls.Add(this.label5);
+            this.Controls.Add(this.Printer);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.label1);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Name = "Make_CustomLablePrint";
+            this.Tag = "Make!CustomLabelPrint";
+            this.Text = "Make_CustomLablePrint";
+            this.Load += new System.EventHandler(this.Make_CustomLablePrint_Load);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.ComboBox PrintLabel;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label5;
+        private CustomControl.ComBoxWithFocus.PrinterCombox Printer;
+        private CustomControl.RichText.RichTextAutoBottom OperateResult;
+        private System.Windows.Forms.Label sncode_label;
+        private CustomControl.TextBoxWithIcon.EnterTextBox inputText;
+        private System.Windows.Forms.Label label6;
+        private CustomControl.TextBoxWithIcon.EnterTextBox pr_code;
+        private CustomControl.ButtonUtil.NormalButton printButton;
+        private System.Windows.Forms.Label pr_detail;
+        private System.Windows.Forms.Label pr_spec;
+        private CustomControl.TextBoxWithIcon.NumOnlyTextBox printNum;
+    }
+}

+ 220 - 0
UAS-MES/FunctionCode/Make/Make_CustomLablePrint.cs

@@ -0,0 +1,220 @@
+using LabelManager2;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Windows.Forms;
+using UAS_MES.DataOperate;
+using UAS_MES.PublicForm;
+using UAS_MES.PublicMethod;
+
+namespace UAS_MES.FunctionCode.Make
+{
+    public partial class Make_CustomLablePrint : Form
+    {
+        DataHelper dh;
+
+        LogStringBuilder sql = new LogStringBuilder();
+
+        AutoSizeFormClass asc = new AutoSizeFormClass();
+
+        ApplicationClass lbl;
+
+        Thread InitPrint;
+        //存放产品信息
+        DataTable dt;
+        //存放标签信息
+        DataTable listA;
+        //存放标签参数列表信息
+        DataTable paramsInfo;
+        //记录当前的步骤数
+        int currentIndex = 0;
+
+        Document doc;
+
+        FileInfo info;
+
+        ftpOperater ftp;
+
+        System.DateTime[] indate;
+
+        StringBuilder sb = new StringBuilder();
+        public Make_CustomLablePrint()
+        {
+            InitializeComponent();
+        }
+
+        private void Make_CustomLablePrint_Load(object sender, EventArgs e)
+        {
+            dh = new DataHelper();
+            inputText.Focus();
+            asc.controllInitializeSize(this);
+            OperateResult.AppendText(">>请输入产品代码\n", Color.Black);
+            InitPrint = new Thread(InPrint);
+            SetLoadingWindow stw = new SetLoadingWindow(InitPrint, "初始化打印程序");
+            BaseUtil.SetFormCenter(stw);
+            stw.ShowDialog();
+        }
+        private void InPrint()
+        {
+            try
+            {
+                lbl = new ApplicationClass();
+                BaseUtil.WriteLbl(lbl);
+            }
+            catch (Exception ex)
+            {
+                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+            }
+        }
+
+        private void pr_code_KeyDown(object sender, KeyEventArgs e)
+        {
+            //按下enter键
+            if (e.KeyCode == Keys.Enter)
+            {
+                //判断产品是否存在
+                dt = (DataTable)dh.ExecuteSql("select pr_code,pr_detail,pr_spec from product where pr_code='" + pr_code.Text + "'  and pr_statuscode ='AUDITED'", "select");
+                //查询没有值,返回提示用户“产品:XXX,不存在或者为审核”,清空产品代码输入框中的值 
+                if (dt.Rows.Count == 0)
+                {
+                    OperateResult.AppendText("<<产品:" + pr_code.Text + ",不存在或者为审核\n", Color.Red);
+                    pr_code.Text = "";
+                    return;
+                }
+                //查询产品是否有自定义的标签模板
+                listA = (DataTable)dh.ExecuteSql("select pl_labelcode ||':'||pl_labelname pl_name,pl_id,pl_labeltype,pl_labelcode,pl_labelurl,pl_isdefault,pl_detno,pl_labelsoft,pl_status,pl_statuscode,pl_labelname,pl_indate from  productlabel where pl_prodcode='" + pr_code.Text + "' and pl_labeltype='自定义' order by pl_isdefault desc", "select");
+                if (listA.Rows.Count == 0)
+                {
+                    OperateResult.AppendText("<<产品:" + pr_code.Text + ",没有维护自定义模板\n", Color.Red);
+                    pr_code.Text = "";
+                    return;
+                }
+                if (listA.Rows[0]["pl_isdefault"].ToString() != "1") {
+                    //说明没有默认的模板,那就取pl_id最大的
+                    listA = (DataTable)dh.ExecuteSql("select pl_labelcode ||':'||pl_labelname pl_name,pl_id,pl_labeltype,pl_labelcode,pl_labelurl,pl_isdefault,pl_detno,pl_labelsoft,pl_status,pl_statuscode,pl_labelname,pl_indate from  productlabel where pl_prodcode='" + pr_code.Text + "' and pl_labeltype='自定义' order by pl_id desc", "select");
+                }
+                //标签显示
+                PrintLabel.DataSource = listA;
+                PrintLabel.DisplayMember = "pl_name";
+                PrintLabel.ValueMember = "pl_labelcode";
+                //下载标签
+                getLabels();
+                //有值,填充界面
+                BaseUtil.SetFormValue(this.Controls, dt);
+                //paramsInfo = (DataTable)dh.ExecuteSql("select lp_detno, lp_name, lp_valuetype,lp_sql from label left join labelparameter on lp_laid=la_id where la_code='"+ listA.Rows[0]["pl_labelcode"].ToString() + "' order by lp_detno asc", "select");
+                if (paramsInfo.Rows.Count > 0)
+                {
+                    //根据查询出来的参数,一次提示用户, “<<SN001 “, 
+                    //“>> 请输入自定义模板的(XXXX参数名称)lp_name”
+                    OperateResult.AppendText("<<" + listA.Rows[0]["pl_labelcode"].ToString() + "\n", Color.Black);
+                    OperateResult.AppendText(">>请输入自定义模板参数名为:" + paramsInfo.Rows[0]["lp_name"].ToString() + "的值\n", Color.Green);
+                    //打开模板路径
+                    doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text.Split(':')[1]);
+                    currentIndex = 1;
+                }
+                else
+                {
+                    OperateResult.AppendText("<<标签编号:" + listA.Rows[0]["pl_labelcode"].ToString() + "无标签参数\n", Color.Red);
+                }
+            }
+        }
+
+        private void inputText_KeyDown(object sender, KeyEventArgs e)
+        {
+            //按下enter键
+            if (e.KeyCode == Keys.Enter)
+            {
+                //产品编号为空
+                if (pr_code.Text.Trim() == "")
+                {
+                    OperateResult.AppendText("<<请先输入产品编号\n", Color.Red);
+                    return;
+                }
+                if (inputText.Text.Trim() == "")
+                {
+                    OperateResult.AppendText("<<输入不能为空\n", Color.Red);
+                    return;
+                }
+                if (paramsInfo == null || paramsInfo.Rows.Count == 0)
+                {
+                    OperateResult.AppendText("<<未维护标签参数\n", Color.Red);
+                }
+                else
+                {
+                    if (doc==null) {
+                        OperateResult.AppendText(">>标签无效\n", Color.Red);
+                        return;
+                    }
+                    //将值赋到doc对应的变量
+                    for (int i = 0; i < doc.Variables.FormVariables.Count; i++)
+                    {
+                        //找到对应的变量名
+                        if (doc.Variables.FormVariables.Item(i + 1).Name == paramsInfo.Rows[currentIndex - 1]["lp_name"].ToString())
+                        {
+                            //如果当时采集行的 lp_valuetype=’INPUT’,并且lp_sql 为空,则直接将采集的值赋给标签打印
+                            if (paramsInfo.Rows[currentIndex - 1]["lp_valuetype"].ToString() == "INPUT" && paramsInfo.Rows[currentIndex - 1]["lp_sql"].ToString() == "")
+                            {
+                                doc.Variables.FormVariables.Item(i + 1).Value = inputText.Text;
+                            }
+                            else
+                            {
+                                //取sql拿值赋给变量
+                                string sql = paramsInfo.Rows[currentIndex - 1]["lp_sql"].ToString();
+                                sql = sql.Substring(0, sql.IndexOf("{")) + "'" + inputText.Text + "'";
+                                doc.Variables.FormVariables.Item(i + 1).Value = dh.GetLabelParam(sql).ToString();
+                                sb.AppendLine("打印参数【" + doc.Variables.FormVariables.Item(i + 1).Name + "】赋值," + "取值SQL:" + sql + ",取到值" + doc.Variables.FormVariables.Item(i + 1).Value);
+                            }
+                        }
+                    }
+                    if (currentIndex == paramsInfo.Rows.Count)
+                    {
+                        OperateResult.AppendText("<<输入完成,正在打印\n", Color.Black);
+                        //打印
+                        LogManager.DoLog(sb.ToString());
+                        //保存本次赋值进行打印
+                        doc.Save();
+                        doc.Printer.SwitchTo(Printer.Text);
+                        doc.PrintDocument(int.Parse(printNum.Text));
+                        doc.Close();
+                        //讲文件最后写入时间改成数据库中拿到的时间
+                        info = new FileInfo(ftpOperater.DownLoadTo + PrintLabel.Text.Split(':')[1]);
+                        info.LastWriteTime = indate[PrintLabel.SelectedIndex];
+                        //打印成功
+                        OperateResult.AppendText("<<打印成功\n", Color.Green);
+                        //重置currenIndex为1
+                        currentIndex = 1;
+                        OperateResult.AppendText(">>请输入自定义模板参数名为:" + paramsInfo.Rows[0]["lp_name"].ToString() + "的值\n", Color.Green);
+                    }
+                    else
+                    {
+                        currentIndex++;
+                        OperateResult.AppendText("<<请输入模板参数名为:" + paramsInfo.Rows[currentIndex - 1]["lp_name"].ToString() + "的值\n", Color.Green);
+                    }
+                }
+            }
+        }
+
+        private void getLabels()
+        {
+            ftp = new ftpOperater();
+            indate = new System.DateTime[listA.Rows.Count];
+            for (int i = 0; i < listA.Rows.Count; i++)
+            {
+                BaseUtil.GetPrintLabel(listA.Rows[i]["pl_labelname"].ToString(), listA.Rows[i]["pl_labelurl"].ToString(), listA.Rows[i]["pl_indate"].ToString());
+                indate[i] = Convert.ToDateTime(listA.Rows[i]["pl_indate"].ToString());
+            }
+        }
+
+        private void PrintLabel_TextChanged(object sender, EventArgs e)
+        {
+            paramsInfo = (DataTable)dh.ExecuteSql("select lp_detno, lp_name, lp_valuetype,lp_sql from label left join labelparameter on lp_laid=la_id where la_code='" + PrintLabel.SelectedValue.ToString() + "' order by lp_detno asc", "select");
+        }
+    }
+}

+ 159 - 0
UAS-MES/FunctionCode/Make/Make_CustomLablePrint.resx

@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="printButton.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="printButton.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="printButton.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
+</root>

+ 3 - 1
UAS-MES/FunctionCode/Make/Make_FuselageLabelPrint.cs

@@ -34,6 +34,8 @@ namespace UAS_MES.Make
         Thread InitPrint;
 
         bool pr_change = false;
+
+        ftpOperater ftp;
         public Make_FuselageLabelPrint()
         {
             InitializeComponent();
@@ -195,7 +197,7 @@ namespace UAS_MES.Make
             PrintLabel.DataSource = dt;
             PrintLabel.DisplayMember = "pl_name";
             PrintLabel.ValueMember = "pl_labelcode";
-            ftpOperater ftp = new ftpOperater();
+            ftp = new ftpOperater();
             indate = new System.DateTime[dt.Rows.Count];
             for (int i = 0; i < dt.Rows.Count; i++)
             {