Browse Source

镝泰与万利达部分调整提交

caosy 4 years ago
parent
commit
358d90aef0

+ 4 - 3
UAS-MES/FunctionCode/Make/Make_FeedingCollection.Designer.cs

@@ -153,6 +153,7 @@
             this.UnLoading.TabIndex = 63;
             this.UnLoading.Text = "下料";
             this.UnLoading.UseVisualStyleBackColor = true;
+            this.UnLoading.Visible = false;
             // 
             // sn_code_label
             // 
@@ -393,7 +394,7 @@
             // ma_softversion
             // 
             this.ma_softversion.AllPower = null;
-            this.ma_softversion.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+            this.ma_softversion.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
             this.ma_softversion.BackColor = System.Drawing.Color.White;
             this.ma_softversion.ID = null;
@@ -409,7 +410,7 @@
             // ma_ecncode
             // 
             this.ma_ecncode.AllPower = null;
-            this.ma_ecncode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+            this.ma_ecncode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
             this.ma_ecncode.BackColor = System.Drawing.Color.White;
             this.ma_ecncode.ID = null;
@@ -488,7 +489,7 @@
             // sir_remark
             // 
             this.sir_remark.AllPower = null;
-            this.sir_remark.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+            this.sir_remark.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
             this.sir_remark.BackColor = System.Drawing.Color.White;
             this.sir_remark.ID = null;

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -851,8 +851,8 @@ namespace UAS_MES.Make
                                 {
                                     string ma_code = dt.Rows[i]["pd_makecode"].ToString();
                                     string num = dt.Rows[i]["num"].ToString();
-                                    SQLS1.Add("delete from makeprocess where mp_sncode in (select ms_sncode from makeserial where ms_outboxcode='" + pa_outboxcode.Text + "' and ms_makecode='" + ma_code + "') and mp_makecode='" + ma_code + "' and mp_stepcode='" + User.CurrentStepCode + "'");
-                                    SQLS1.Add("delete from steppassed where sp_sncode in (select ms_sncode from makeserial where ms_outboxcode='" + pa_outboxcode.Text + "' and ms_makecode='" + ma_code + "') and sp_makecode='" + ma_code + "' and sp_stepcode='" + User.CurrentStepCode + "'");
+                                   // SQLS1.Add("delete from makeprocess where mp_sncode in (select ms_sncode from makeserial where ms_outboxcode='" + pa_outboxcode.Text + "' and ms_makecode='" + ma_code + "') and mp_makecode='" + ma_code + "' and mp_stepcode='" + User.CurrentStepCode + "'");
+                                   // SQLS1.Add("delete from steppassed where sp_sncode in (select ms_sncode from makeserial where ms_outboxcode='" + pa_outboxcode.Text + "' and ms_makecode='" + ma_code + "') and sp_makecode='" + ma_code + "' and sp_stepcode='" + User.CurrentStepCode + "'");
                                     SQLS1.Add("update makecraftdetail set mcd_inqty=mcd_inqty-" + num + ",mcd_outqty=mcd_outqty-" + num + ",mcd_okqty=mcd_okqty-" + num + " where mcd_macode='" + ma_code + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
                                     //扣减已完工数
                                     SQLS1.Add("update make set ma_madeqty=ma_madeqty-(select count(1) from makeserial where  ms_outboxcode='" + pa_outboxcode.Text + "' and ms_makecode='" + ma_code + "' and ms_status=2) where ma_code='" + ma_code + "'");

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -841,8 +841,8 @@ namespace UAS_MES.Make
                                 {
                                     string ma_code = dt.Rows[i]["pd_makecode"].ToString();
                                     string num = dt.Rows[i]["num"].ToString();
-                                    SQLS1.Add("delete from makeprocess where mp_sncode in (select ms_sncode from makeserial where ms_outboxcode='" + pa_outboxcode.Text + "' and ms_makecode='" + ma_code + "') and mp_makecode='" + ma_code + "' and mp_stepcode='" + User.CurrentStepCode + "'");
-                                    SQLS1.Add("delete from steppassed where sp_sncode in (select ms_sncode from makeserial where ms_outboxcode='" + pa_outboxcode.Text + "' and ms_makecode='" + ma_code + "') and sp_makecode='" + ma_code + "' and sp_stepcode='" + User.CurrentStepCode + "'");
+                                   // SQLS1.Add("delete from makeprocess where mp_sncode in (select ms_sncode from makeserial where ms_outboxcode='" + pa_outboxcode.Text + "' and ms_makecode='" + ma_code + "') and mp_makecode='" + ma_code + "' and mp_stepcode='" + User.CurrentStepCode + "'");
+                                   // SQLS1.Add("delete from steppassed where sp_sncode in (select ms_sncode from makeserial where ms_outboxcode='" + pa_outboxcode.Text + "' and ms_makecode='" + ma_code + "') and sp_makecode='" + ma_code + "' and sp_stepcode='" + User.CurrentStepCode + "'");
                                     SQLS1.Add("update makecraftdetail set mcd_inqty=mcd_inqty-" + num + ",mcd_outqty=mcd_outqty-" + num + ",mcd_okqty=mcd_okqty-" + num + " where mcd_macode='" + ma_code + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
                                     //扣减已完工数
                                     SQLS1.Add("update make set ma_madeqty=ma_madeqty-(select count(1) from makeserial where  ms_outboxcode='" + pa_outboxcode.Text + "' and ms_makecode='" + ma_code + "' and ms_status=2) where ma_code='" + ma_code + "'");

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.cs

@@ -133,8 +133,8 @@ namespace UAS_MES.Make
                                     //}
                                     //else
                                     //{
-                                        OperateResult.AppendText("<<当前工序不允许重新转号\n", Color.Red, code);
-                                        return;
+                                        //OperateResult.AppendText("<<当前工序不允许重新转号\n", Color.Red, code);
+                                        //return;
                                     //}
                                 }
                                 else

+ 4 - 4
UAS-MES/PublicMethod/LogicHandler.cs

@@ -538,10 +538,10 @@ namespace UAS_MES.PublicMethod
             //更新完工数量
             ExeSQL.Add("update make set ma_madeqty=(select count(1) from makeserial where ms_makecode='" + iMakeCode + "' and ms_status=2) where ma_code='" + iMakeCode + "'");
             //删除StepPassed数据
-            sql.Clear();
-            sql.Append("delete from steppassed where sp_sncode in (select v_barcode from mes_package_view where v_outboxcode='" + iOutBoxCode + "') ");
-            sql.Append("and sp_makecode='" + iMakeCode + "' and sp_stepcode='" + CurrentStep + "'");
-            ExeSQL.Add(sql.ToString());
+            //sql.Clear();
+            //sql.Append("delete from steppassed where sp_sncode in (select v_barcode from mes_package_view where v_outboxcode='" + iOutBoxCode + "') ");
+            //sql.Append("and sp_makecode='" + iMakeCode + "' and sp_stepcode='" + CurrentStep + "'");
+            //ExeSQL.Add(sql.ToString());
             //更新大箱或栈板的母箱编号为空
             ExeSQL.Add("update package set pa_mothercode='' where pa_outboxcode in(select PD_INNERBOXCODE from package left join packagedetail on pa_id=pd_paid where pa_outboxcode='" + iOutBoxCode + "')");
             //删除从表明细

+ 1 - 1
UAS_MES_NEW/App.config

@@ -72,7 +72,7 @@
   <applicationSettings>
     <UAS_MES_NEW.Properties.Settings>
       <setting name="MES" serializeAs="String">
-        <value>Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.118)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
+        <value>Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=yitoadt.wicp.io)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
       </setting>
     </UAS_MES_NEW.Properties.Settings>
     <UAS_MES.Properties.Settings>

+ 7 - 8
UAS_MES_NEW/FunctionCode/Make/Make_ColorBoxLabelPrint.Designer.cs

@@ -62,7 +62,7 @@
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.FormattingEnabled = true;
             this.PrintLabel.Location = new System.Drawing.Point(790, 227);
-            this.PrintLabel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(2);
             this.PrintLabel.Name = "PrintLabel";
             this.PrintLabel.Size = new System.Drawing.Size(134, 20);
             this.PrintLabel.TabIndex = 181;
@@ -106,9 +106,9 @@
             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(262, 446);
             this.sncode_label.Name = "sncode_label";
-            this.sncode_label.Size = new System.Drawing.Size(70, 21);
+            this.sncode_label.Size = new System.Drawing.Size(32, 21);
             this.sncode_label.TabIndex = 170;
-            this.sncode_label.Text = "TSN/SN";
+            this.sncode_label.Text = "SN";
             // 
             // label4
             // 
@@ -163,8 +163,6 @@
             // CheckTSN
             // 
             this.CheckTSN.AutoSize = true;
-            this.CheckTSN.Checked = true;
-            this.CheckTSN.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CheckTSN.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.CheckTSN.Location = new System.Drawing.Point(32, 445);
             this.CheckTSN.Name = "CheckTSN";
@@ -172,6 +170,7 @@
             this.CheckTSN.TabIndex = 186;
             this.CheckTSN.Text = "是否检查TSN";
             this.CheckTSN.UseVisualStyleBackColor = true;
+            this.CheckTSN.Visible = false;
             this.CheckTSN.CheckedChanged += new System.EventHandler(this.CheckTSN_CheckedChanged);
             // 
             // StepCount
@@ -219,7 +218,7 @@
             // Printer
             // 
             this.Printer.Location = new System.Drawing.Point(790, 176);
-            this.Printer.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Printer.Margin = new System.Windows.Forms.Padding(4);
             this.Printer.Name = "Printer";
             this.Printer.Size = new System.Drawing.Size(134, 25);
             this.Printer.TabIndex = 178;
@@ -314,8 +313,6 @@
             // CollectRemark
             // 
             this.CollectRemark.AutoSize = true;
-            this.CollectRemark.Checked = true;
-            this.CollectRemark.CheckState = System.Windows.Forms.CheckState.Checked;
             this.CollectRemark.Font = new System.Drawing.Font("微软雅黑", 10F);
             this.CollectRemark.Location = new System.Drawing.Point(729, 289);
             this.CollectRemark.Name = "CollectRemark";
@@ -323,6 +320,7 @@
             this.CollectRemark.TabIndex = 197;
             this.CollectRemark.Text = "采集备注";
             this.CollectRemark.UseVisualStyleBackColor = true;
+            this.CollectRemark.Visible = false;
             // 
             // Remark
             // 
@@ -333,6 +331,7 @@
             this.Remark.Size = new System.Drawing.Size(204, 80);
             this.Remark.TabIndex = 196;
             this.Remark.Text = "";
+            this.Remark.Visible = false;
             // 
             // comboBox1
             // 

+ 63 - 24
UAS_MES_NEW/FunctionCode/Make/Make_ColorBoxLabelPrint.cs

@@ -32,6 +32,7 @@ namespace UAS_MES_NEW.Make
 
         Thread InitPrint;
         ApplicationClass lbl;
+        public BarTender.Application engine;
 
         DataTable Dbfind;
 
@@ -87,12 +88,13 @@ namespace UAS_MES_NEW.Make
         {
             try
             {
+                engine = new BarTender.Application();
                 lbl = new ApplicationClass();
                 BaseUtil.WriteLbl();
             }
-            catch (Exception )
+            catch (Exception ex)
             {
-                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+                OperateResult.AppendText("未正确安装CodeSoft软件\n" + ex.Message, Color.Red);
             }
         }
 
@@ -177,16 +179,16 @@ namespace UAS_MES_NEW.Make
                             OperateResult.AppendText("<<工单号:" + ma_code.Text + "\n", Color.Black);
                             //提示用户“<< 序列号:XXXX”
                             OperateResult.AppendText("<<序列号:" + sncode.Text + "\n", Color.Black);
-                            if (pr_change)
-                            {
-                                String dialog = MessageBox.Show("是否使用当前标签模板", "提示", MessageBoxButtons.OKCancel).ToString();
-                                if (dialog != "OK")
-                                {
-                                    OperateResult.AppendText(">>请重新选择标签模板\n", Color.Green);
-                                    return;
-                                }
-                                else pr_change = false;
-                            }
+                            //if (pr_change)
+                            //{
+                            //    String dialog = MessageBox.Show("是否使用当前标签模板", "提示", MessageBoxButtons.OKCancel).ToString();
+                            //    if (dialog != "OK")
+                            //    {
+                            //        OperateResult.AppendText(">>请重新选择标签模板\n", Color.Green);
+                            //        return;
+                            //    }
+                            //    else pr_change = false;
+                            //}
                         }
                         else
                         {
@@ -194,15 +196,15 @@ namespace UAS_MES_NEW.Make
                             sncode.Focus();
                             return;
                         }
-                        if (int.Parse(mcd_remainqty.Text) <= 0 && dt.Rows[0]["ma_unlimitin"].ToString() == "0")
-                        {
-                            macode = ma_code.Text;
-                            ErrorMessage = "工单" + macode + "打印结束\n>请输入SN";
-                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
-                            sncode.Focus();
-                        }
-                        else
-                        {
+                        //if (int.Parse(mcd_remainqty.Text) <= 0 && dt.Rows[0]["ma_unlimitin"].ToString() == "0")
+                        //{
+                        //    macode = ma_code.Text;
+                        //    ErrorMessage = "工单" + macode + "打印结束\n>请输入SN";
+                        //    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
+                        //    sncode.Focus();
+                        //}
+                        //else
+                        //{
                             //所选标签不为空
                             if (PrintLabel.SelectedValue != null)
                             {
@@ -223,16 +225,50 @@ namespace UAS_MES_NEW.Make
                                     if (ErrorMessage.Contains("AFTERSUCCESS"))
                                         OperateResult.AppendText(">>" + ErrorMessage + "\n");
                                     // doc = lbl.Documents.Open(PrintLabel.Text);
+                                    //if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, pr_code.Text, "彩盒标", "0", out ErrorMessage))
+                                    //{
+                                    //    //提示用户打印成功
+                                    //    OperateResult.AppendText(">>序列号:" + sncode.Text + "打印结束\n", Color.Green);
+                                    //}
+                                    //else
+                                    //{
+                                    //    OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
+                                    //}
+
+
+
+
+                                //doc = lbl.Documents.Open(PrintLabel.Text);
+                                if (comboBox1.Text == "CODESOFT")
+                                {
                                     if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, pr_code.Text, "彩盒标", "0", out ErrorMessage))
                                     {
-                                        //提示用户打印成功
                                         OperateResult.AppendText(">>序列号:" + sncode.Text + "打印结束\n", Color.Green);
                                     }
                                     else
                                     {
                                         OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
                                     }
-                                    if (CollectRemark.Checked && Remark.Text != "")
+                                }
+                                else if (comboBox1.Text == "BARTENDER")
+                                {
+                                    if (Print.SinglePrint(Tag.ToString(), engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), oMakeCode, pr_code.Text, "彩盒标", "0", out ErrorMessage))
+                                    {
+                                        OperateResult.AppendText(">>序列号:" + sncode.Text + "打印结束\n", Color.Green);
+                                    }
+                                    else
+                                    {
+                                        OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
+                                    }
+                                }
+                                else if (comboBox1.Text == "")
+                                {
+                                    OperateResult.AppendText("未选择打印方式\n", Color.Red);
+                                    return;
+                                }
+
+
+                                if (CollectRemark.Checked && Remark.Text != "")
                                     {
                                         LogicHandler.CollectRemarkInf(sncode.Text, "", "", oMakeCode, pr_code.Text, Remark.Text);
                                     }
@@ -263,7 +299,7 @@ namespace UAS_MES_NEW.Make
                             }
                             else
                                 OperateResult.AppendText(">>请输入SN\n", Color.Black);
-                        }
+                        //}
                     }
                     else
                     {
@@ -309,6 +345,9 @@ namespace UAS_MES_NEW.Make
         private void Make_ColorBoxLabelPrint_FormClosing(object sender, FormClosingEventArgs e)
         {
             BaseUtil.ClosePrint(lbl);
+            if (engine != null)
+                engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
+            dh.Dispose();
         }
 
         private void Make_ColorBoxLabelPrint_SizeChanged(object sender, EventArgs e)

+ 45 - 43
UAS_MES_NEW/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -20,7 +20,7 @@ namespace UAS_MES_NEW.Make
     {
         AutoSizeFormClass asc = new AutoSizeFormClass();
 
-        public Seagull.BarTender.Print.Engine engine;
+        public BarTender.Application engine;
         ApplicationClass lbl;
         Document doc;
         DataHelper dh;
@@ -106,7 +106,7 @@ namespace UAS_MES_NEW.Make
         {
             try
             {
-                engine = new Seagull.BarTender.Print.Engine();
+                engine = new BarTender.Application();
                 lbl = new ApplicationClass();
                 BaseUtil.WriteLbl();
             }
@@ -122,48 +122,48 @@ namespace UAS_MES_NEW.Make
             {
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
-                   string oMakeCode = "";
-                   string oMsID = "";
-                   if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
-                   {
-                      //string nextstepcode = dh.getFieldDataByCondition("makeserial", "ms_nextstepcode", "ms_id='" + oMsID + "'").ToString();
-                      //if (nextstepcode != User.CurrentStepCode)
-                      //{
-                      //    OperateResult.AppendText("<<序列号:" + sncode.Text + "下一工序是" + nextstepcode + ",不是当前岗位的工序\n", Color.Red, sncode);
-                      //    return;
-                      //}
-                    sql.Clear();
-                    sql.Append("select ms_makecode ma_code,ma_qty,ma_salecode,pr_spec,pr_colorboxunit,pr_code,pr_colorboxgw,");
-                    sql.Append("pr_colorboxunit,pr_colorboxmaxw,pr_colorboxminw,nvl(PR_CHECKCOLORBOXW,'0') PR_CHECKCOLORBOXW,nvl(pr_sendchecktype,'LineCode')");
-                    sql.Append("pr_sendchecktype from makeserial left join make on ms_makecode=ma_code left join product on ");
-                    sql.Append("ms_prodcode=pr_code where ms_sncode='" + sncode.Text + "' order by ms_id desc");
-                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                    if (dt.Rows.Count > 0)
+                    string oMakeCode = "";
+                    string oMsID = "";
+                    if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
                     {
-                        //重量的临时变量
-                        pr_code.Text = dt.Rows[0]["pr_code"].ToString();
-                        string _weight = dt.Rows[0]["pr_colorboxgw"].ToString();
-                        string _maxweight = dt.Rows[0]["pr_colorboxmaxw"].ToString();
-                        string _minweight = dt.Rows[0]["pr_colorboxminw"].ToString();
-                        string pr_colorunit = dt.Rows[0]["pr_colorboxunit"].ToString();
-                        string ma_salecode_text = dt.Rows[0]["ma_salecode"].ToString();
-                        string PR_CHECKCOLORBOXW = dt.Rows[0]["PR_CHECKCOLORBOXW"].ToString();
-                        //赋值重量单位
-                        Weight = double.Parse(_weight == "" ? "0" : _weight);
-                        MaxWeight = double.Parse(_maxweight == "" ? "0" : _maxweight);
-                        MinWeight = double.Parse(_minweight == "" ? "0" : _minweight);
-                        if (locksalecode.Checked && ma_salecode.Text != "" && ma_salecode.Text != ma_salecode_text)
+                        //string nextstepcode = dh.getFieldDataByCondition("makeserial", "ms_nextstepcode", "ms_id='" + oMsID + "'").ToString();
+                        //if (nextstepcode != User.CurrentStepCode)
+                        //{
+                        //    OperateResult.AppendText("<<序列号:" + sncode.Text + "下一工序是" + nextstepcode + ",不是当前岗位的工序\n", Color.Red, sncode);
+                        //    return;
+                        //}
+                        sql.Clear();
+                        sql.Append("select ms_makecode ma_code,ma_qty,ma_salecode,pr_spec,pr_colorboxunit,pr_code,pr_colorboxgw,");
+                        sql.Append("pr_colorboxunit,pr_colorboxmaxw,pr_colorboxminw,nvl(PR_CHECKCOLORBOXW,'0') PR_CHECKCOLORBOXW,nvl(pr_sendchecktype,'LineCode')");
+                        sql.Append("pr_sendchecktype from makeserial left join make on ms_makecode=ma_code left join product on ");
+                        sql.Append("ms_prodcode=pr_code where ms_sncode='" + sncode.Text + "' order by ms_id desc");
+                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                        if (dt.Rows.Count > 0)
                         {
-                            OperateResult.AppendText(">>序列号" + sncode.Text + "所属订单号" + ma_salecode_text + "与界面订单号" + ma_salecode.Text + "不同,无法采集\n", Color.Red, sncode);
-                            return;
-                        }
-                        ma_salecode.Text = dt.Rows[0]["ma_salecode"].ToString();
-                        BaseUtil.SetFormValue(this.Controls, dt);
-                        if (Weight - MinWeight == MaxWeight - Weight)
-                            pr_colorboxgw.Text = Weight + "±" + (MaxWeight - Weight) + dt.Rows[0]["pr_colorboxunit"].ToString();
-                        else
-                            pr_colorboxgw.Text = MinWeight + "-" + MaxWeight + dt.Rows[0]["pr_colorboxunit"].ToString();
-                    
+                            //重量的临时变量
+                            pr_code.Text = dt.Rows[0]["pr_code"].ToString();
+                            string _weight = dt.Rows[0]["pr_colorboxgw"].ToString();
+                            string _maxweight = dt.Rows[0]["pr_colorboxmaxw"].ToString();
+                            string _minweight = dt.Rows[0]["pr_colorboxminw"].ToString();
+                            string pr_colorunit = dt.Rows[0]["pr_colorboxunit"].ToString();
+                            string ma_salecode_text = dt.Rows[0]["ma_salecode"].ToString();
+                            string PR_CHECKCOLORBOXW = dt.Rows[0]["PR_CHECKCOLORBOXW"].ToString();
+                            //赋值重量单位
+                            Weight = double.Parse(_weight == "" ? "0" : _weight);
+                            MaxWeight = double.Parse(_maxweight == "" ? "0" : _maxweight);
+                            MinWeight = double.Parse(_minweight == "" ? "0" : _minweight);
+                            if (locksalecode.Checked && ma_salecode.Text != "" && ma_salecode.Text != ma_salecode_text)
+                            {
+                                OperateResult.AppendText(">>序列号" + sncode.Text + "所属订单号" + ma_salecode_text + "与界面订单号" + ma_salecode.Text + "不同,无法采集\n", Color.Red, sncode);
+                                return;
+                            }
+                            ma_salecode.Text = dt.Rows[0]["ma_salecode"].ToString();
+                            BaseUtil.SetFormValue(this.Controls, dt);
+                            if (Weight - MinWeight == MaxWeight - Weight)
+                                pr_colorboxgw.Text = Weight + "±" + (MaxWeight - Weight) + dt.Rows[0]["pr_colorboxunit"].ToString();
+                            else
+                                pr_colorboxgw.Text = MinWeight + "-" + MaxWeight + dt.Rows[0]["pr_colorboxunit"].ToString();
+
                             //如果未打开串口设置为0
                             //if (pr_colorboxunit.Text == "kg" && !WeightChange)
                             //{
@@ -230,7 +230,7 @@ namespace UAS_MES_NEW.Make
                         }
                         else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
                     }
-                    else OperateResult.AppendText(">>"+ErrorMessage+"\n", Color.Red, sncode);
+                    else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
                 }
                 else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
             }
@@ -286,6 +286,8 @@ namespace UAS_MES_NEW.Make
         //关闭窗口的时候停止进程读取串口数据
         private void 彩盒称重_FormClosing(object sender, FormClosingEventArgs e)
         {
+            if (engine != null)
+                engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
             BaseUtil.ClosePrint(lbl);
             StopWeight.PerformClick();
             InitPrint.Abort();

+ 59 - 58
UAS_MES_NEW/FunctionCode/Make/Make_FeedingCollection.Designer.cs

@@ -50,6 +50,12 @@
             this.sir_remark_label = new System.Windows.Forms.CheckBox();
             this.NoteForChange = new System.Windows.Forms.CheckBox();
             this.LabelDataGridView = new System.Windows.Forms.DataGridView();
+            this.序号 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.cm_makecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_detail_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.cm_soncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.cm_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.BarCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -72,12 +78,6 @@
             this.Confirm = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.sn_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.序号 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.cm_makecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_detail_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.cm_soncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.cm_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.BarCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.LabelDataGridView)).BeginInit();
             this.SuspendLayout();
@@ -167,6 +167,7 @@
             this.UnLoading.TabIndex = 63;
             this.UnLoading.Text = "下料";
             this.UnLoading.UseVisualStyleBackColor = true;
+            this.UnLoading.Visible = false;
             // 
             // sn_code_label
             // 
@@ -322,6 +323,58 @@
             this.LabelDataGridView.Size = new System.Drawing.Size(641, 227);
             this.LabelDataGridView.TabIndex = 193;
             // 
+            // 序号
+            // 
+            this.序号.DataPropertyName = "sp_detno";
+            this.序号.HeaderText = "序号";
+            this.序号.Name = "序号";
+            this.序号.ReadOnly = true;
+            this.序号.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.序号.Width = 50;
+            // 
+            // cm_makecode
+            // 
+            this.cm_makecode.DataPropertyName = "sp_fsoncode";
+            this.cm_makecode.HeaderText = "上料料号";
+            this.cm_makecode.Name = "cm_makecode";
+            this.cm_makecode.ReadOnly = true;
+            this.cm_makecode.Width = 80;
+            // 
+            // pr_detail_
+            // 
+            this.pr_detail_.DataPropertyName = "pr_detail";
+            this.pr_detail_.HeaderText = "上料名称";
+            this.pr_detail_.Name = "pr_detail_";
+            this.pr_detail_.ReadOnly = true;
+            this.pr_detail_.Width = 130;
+            // 
+            // cm_soncode
+            // 
+            this.cm_soncode.DataPropertyName = "sp_prefix";
+            this.cm_soncode.HeaderText = "前缀";
+            this.cm_soncode.Name = "cm_soncode";
+            this.cm_soncode.ReadOnly = true;
+            this.cm_soncode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.cm_soncode.Width = 60;
+            // 
+            // cm_barcode
+            // 
+            this.cm_barcode.DataPropertyName = "sp_length";
+            this.cm_barcode.HeaderText = "长度";
+            this.cm_barcode.Name = "cm_barcode";
+            this.cm_barcode.ReadOnly = true;
+            this.cm_barcode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.cm_barcode.Width = 60;
+            // 
+            // BarCode
+            // 
+            this.BarCode.HeaderText = "条码号";
+            this.BarCode.MinimumWidth = 300;
+            this.BarCode.Name = "BarCode";
+            this.BarCode.ReadOnly = true;
+            this.BarCode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.BarCode.Width = 300;
+            // 
             // dataGridViewTextBoxColumn1
             // 
             this.dataGridViewTextBoxColumn1.DataPropertyName = "cm_makecode";
@@ -600,58 +653,6 @@
             this.sn_code.Str2 = null;
             this.sn_code.TabIndex = 65;
             // 
-            // 序号
-            // 
-            this.序号.DataPropertyName = "sp_detno";
-            this.序号.HeaderText = "序号";
-            this.序号.Name = "序号";
-            this.序号.ReadOnly = true;
-            this.序号.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.序号.Width = 50;
-            // 
-            // cm_makecode
-            // 
-            this.cm_makecode.DataPropertyName = "sp_fsoncode";
-            this.cm_makecode.HeaderText = "上料料号";
-            this.cm_makecode.Name = "cm_makecode";
-            this.cm_makecode.ReadOnly = true;
-            this.cm_makecode.Width = 80;
-            // 
-            // pr_detail_
-            // 
-            this.pr_detail_.DataPropertyName = "pr_detail";
-            this.pr_detail_.HeaderText = "上料名称";
-            this.pr_detail_.Name = "pr_detail_";
-            this.pr_detail_.ReadOnly = true;
-            this.pr_detail_.Width = 130;
-            // 
-            // cm_soncode
-            // 
-            this.cm_soncode.DataPropertyName = "sp_prefix";
-            this.cm_soncode.HeaderText = "前缀";
-            this.cm_soncode.Name = "cm_soncode";
-            this.cm_soncode.ReadOnly = true;
-            this.cm_soncode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.cm_soncode.Width = 60;
-            // 
-            // cm_barcode
-            // 
-            this.cm_barcode.DataPropertyName = "sp_length";
-            this.cm_barcode.HeaderText = "长度";
-            this.cm_barcode.Name = "cm_barcode";
-            this.cm_barcode.ReadOnly = true;
-            this.cm_barcode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.cm_barcode.Width = 60;
-            // 
-            // BarCode
-            // 
-            this.BarCode.HeaderText = "条码号";
-            this.BarCode.MinimumWidth = 300;
-            this.BarCode.Name = "BarCode";
-            this.BarCode.ReadOnly = true;
-            this.BarCode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.BarCode.Width = 300;
-            // 
             // Make_FeedingCollection
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);

+ 7 - 7
UAS_MES_NEW/FunctionCode/Make/Make_FeedingCollection.cs

@@ -182,7 +182,7 @@ namespace UAS_MES_NEW.Make
                                         return;
                                     }
                                 }
-                                TSN.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+                                TSN.Add(code.Text.Substring(0, code.Text.Length > 150 ? 150 : code.Text.Length));
                                 if (sp_barcoderule == "BARCODE")
                                 {
                                     sp_soncode = ErrorMessage;
@@ -316,7 +316,7 @@ namespace UAS_MES_NEW.Make
                                     {
                                         CollectDataSonCode.Add(sp_soncode);
                                         SPID.Add(sp_id);
-                                        CollectData.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+                                        CollectData.Add(code.Text.Substring(0, code.Text.Length > 150 ? 150 : code.Text.Length));
                                         sn_code.Text = code.Text;
                                         OperateResult.AppendText(">>序列号" + code.Text + ",物料" + sp_soncode + "上料成功\n", Color.Green);
                                         RemainIndex = RemainIndex + 1;
@@ -421,16 +421,16 @@ namespace UAS_MES_NEW.Make
             CollectDataSonCode.Add(sp_soncode);
             //采集成功提示
          
-            CollectData.Add(code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+            CollectData.Add(code.Text.Substring(0, code.Text.Length > 150 ? 150 : code.Text.Length));
             if (!CheckBarcode.ContainsKey(sp_fsoncode))
             {
-                CheckBarcode.Add(sp_fsoncode, code.Text.Substring(0, code.Text.Length > 80 ? 80 : code.Text.Length));
+                CheckBarcode.Add(sp_fsoncode, code.Text.Substring(0, code.Text.Length > 150 ? 150 : code.Text.Length));
             }
             SPID.Add(sp_id);
             OperateResult.AppendText(">>物料" + sp_soncode + "采集成功,条码" + code.Text + "\n", Color.Green);
             LabelDataGridView.Rows[RemainIndex].Cells["BarCode"].Value = code.Text;
-            if (code.Text.Length > 80)
-                OperateResult.AppendText(">>采集条码" + code.Text + "程度超过长度限制80,内容截取前80位进行采集\n", Color.Red);
+            if (code.Text.Length > 150)
+                OperateResult.AppendText(">>采集条码" + code.Text + "程度超过长度限制150,内容截取前150位进行采集\n", Color.Red);
             code.Clear();
             RemainIndex = RemainIndex + 1;
             //如果+1后不小于B序列的长度,则已采集完成,不需要进行提示了
@@ -463,7 +463,7 @@ namespace UAS_MES_NEW.Make
 
                 }
                 //更新序列号半成品已被使用
-                dh.BatchInsert("update makeserial set ms_nextmacode='" + ma_code + "' where ms_id=(select max(ms_id) from makeserial where ms_sncode=:sncode and ms_nextmacode is null and ms_makecode<>'" + ma_code + "')", new string[] { "sncode" }, TSN.ToArray());
+                //dh.BatchInsert("update makeserial set ms_nextmacode='" + ma_code + "' where ms_id=(select max(ms_id) from makeserial where ms_sncode=:sncode and ms_nextmacode is null and ms_makecode<>'" + ma_code + "')", new string[] { "sncode" }, TSN.ToArray());
                 if (ma_ecncode_label.Checked || ma_softversion_label.Checked)
                 {
                     string ecnText = ma_ecncode_label.Checked ? ma_ecncode.Text : "";

+ 8 - 8
UAS_MES_NEW/FunctionCode/Make/Make_SeqTransform.cs

@@ -87,18 +87,18 @@ namespace UAS_MES_NEW.Make
                                         OperateResult.AppendText("<<当前TSN号处于下地状态不允许操作\n", Color.Red, sncode);
                                         return;
                                     }
-                                    if (dt.Rows[0]["ms_stepcode"].ToString() == User.CurrentStepCode)
-                                    {
+                                    //if (dt.Rows[0]["ms_stepcode"].ToString() == User.CurrentStepCode)
+                                    //{
                                         bsncode = sncode.Text;
                                         //显示序列号
                                         show_sncode.Text = bsncode;
                                         ChangeResult.Enabled = false;
-                                    }
-                                    else
-                                    {
-                                        OperateResult.AppendText("<<当前工序不允许重新转号\n", Color.Red, sncode);
-                                        return;
-                                    }
+                                    //}
+                                    //else
+                                    //{
+                                    //    OperateResult.AppendText("<<当前工序不允许重新转号\n", Color.Red, sncode);
+                                    //    return;
+                                    //}
                                 }
                                 else
                                 {

+ 90 - 91
UAS_MES_NEW/FunctionCode/Make/Make_TestCollection.Designer.cs

@@ -59,10 +59,16 @@
             this.mcd_inqty_label = new System.Windows.Forms.Label();
             this.mc_restqty_label = new System.Windows.Forms.Label();
             this.panel1 = new System.Windows.Forms.Panel();
+            this.ob_sendqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.label7 = new System.Windows.Forms.Label();
             this.ob_checkno = new System.Windows.Forms.Label();
+            this.SendCheck = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.ob_batchqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.ob_batchqty_label = new System.Windows.Forms.Label();
+            this.ob_nowcheckqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.ob_nowcheckqty_label = new System.Windows.Forms.Label();
+            this.mcd_remainqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
+            this.mcd_inqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.pr_detail_label = new System.Windows.Forms.Label();
             this.ma_softversion_label = new System.Windows.Forms.Label();
             this.BadInfSource = new System.Windows.Forms.BindingSource(this.components);
@@ -75,12 +81,6 @@
             this.StepCount = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SourceStepCount();
             this.Filter = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.TextBoxWithPlaceHolder();
             this.ma_softversion = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
-            this.ob_sendqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
-            this.SendCheck = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
-            this.ob_batchqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
-            this.ob_nowcheckqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
-            this.mcd_remainqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
-            this.mcd_inqty = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.Save = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.bc_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
@@ -383,6 +383,19 @@
             this.panel1.Size = new System.Drawing.Size(315, 127);
             this.panel1.TabIndex = 71;
             // 
+            // ob_sendqty
+            // 
+            this.ob_sendqty.AutoSize = true;
+            this.ob_sendqty.CutLength = null;
+            this.ob_sendqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_sendqty.ForeColor = System.Drawing.Color.Black;
+            this.ob_sendqty.Location = new System.Drawing.Point(109, 91);
+            this.ob_sendqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.ob_sendqty.Name = "ob_sendqty";
+            this.ob_sendqty.Size = new System.Drawing.Size(0, 21);
+            this.ob_sendqty.TabIndex = 78;
+            this.ob_sendqty.Tag = "ob_batchqty";
+            // 
             // label7
             // 
             this.label7.AutoSize = true;
@@ -407,6 +420,39 @@
             this.ob_checkno.Visible = false;
             this.ob_checkno.TextChanged += new System.EventHandler(this.ob_checkno_TextChanged);
             // 
+            // SendCheck
+            // 
+            this.SendCheck.AllPower = null;
+            this.SendCheck.BackColor = System.Drawing.Color.Transparent;
+            this.SendCheck.DownImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.DownImage")));
+            this.SendCheck.Enabled = false;
+            this.SendCheck.Image = null;
+            this.SendCheck.IsShowBorder = true;
+            this.SendCheck.Location = new System.Drawing.Point(229, 90);
+            this.SendCheck.Margin = new System.Windows.Forms.Padding(2);
+            this.SendCheck.MoveImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.MoveImage")));
+            this.SendCheck.Name = "SendCheck";
+            this.SendCheck.NormalImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.NormalImage")));
+            this.SendCheck.Power = null;
+            this.SendCheck.Size = new System.Drawing.Size(65, 26);
+            this.SendCheck.TabIndex = 72;
+            this.SendCheck.Text = "送检";
+            this.SendCheck.UseVisualStyleBackColor = false;
+            this.SendCheck.Click += new System.EventHandler(this.SendCheck_Click);
+            // 
+            // ob_batchqty
+            // 
+            this.ob_batchqty.AutoSize = true;
+            this.ob_batchqty.CutLength = null;
+            this.ob_batchqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_batchqty.ForeColor = System.Drawing.Color.Black;
+            this.ob_batchqty.Location = new System.Drawing.Point(109, 51);
+            this.ob_batchqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.ob_batchqty.Name = "ob_batchqty";
+            this.ob_batchqty.Size = new System.Drawing.Size(0, 21);
+            this.ob_batchqty.TabIndex = 75;
+            this.ob_batchqty.Tag = "ob_batchqty";
+            // 
             // ob_batchqty_label
             // 
             this.ob_batchqty_label.AutoSize = true;
@@ -418,6 +464,19 @@
             this.ob_batchqty_label.TabIndex = 74;
             this.ob_batchqty_label.Text = "抽检批数";
             // 
+            // ob_nowcheckqty
+            // 
+            this.ob_nowcheckqty.AutoSize = true;
+            this.ob_nowcheckqty.CutLength = null;
+            this.ob_nowcheckqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_nowcheckqty.ForeColor = System.Drawing.Color.Black;
+            this.ob_nowcheckqty.Location = new System.Drawing.Point(248, 51);
+            this.ob_nowcheckqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.ob_nowcheckqty.Name = "ob_nowcheckqty";
+            this.ob_nowcheckqty.Size = new System.Drawing.Size(0, 21);
+            this.ob_nowcheckqty.TabIndex = 73;
+            this.ob_nowcheckqty.Tag = "ob_nowcheckqty";
+            // 
             // ob_nowcheckqty_label
             // 
             this.ob_nowcheckqty_label.AutoSize = true;
@@ -429,6 +488,30 @@
             this.ob_nowcheckqty_label.TabIndex = 72;
             this.ob_nowcheckqty_label.Text = "当前批数";
             // 
+            // mcd_remainqty
+            // 
+            this.mcd_remainqty.AutoSize = true;
+            this.mcd_remainqty.CutLength = null;
+            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(109, 12);
+            this.mcd_remainqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.mcd_remainqty.Name = "mcd_remainqty";
+            this.mcd_remainqty.Size = new System.Drawing.Size(0, 21);
+            this.mcd_remainqty.TabIndex = 57;
+            this.mcd_remainqty.Tag = "mcd_remainqty";
+            // 
+            // mcd_inqty
+            // 
+            this.mcd_inqty.AutoSize = true;
+            this.mcd_inqty.CutLength = null;
+            this.mcd_inqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mcd_inqty.Location = new System.Drawing.Point(248, 12);
+            this.mcd_inqty.MaximumSize = new System.Drawing.Size(150, 0);
+            this.mcd_inqty.Name = "mcd_inqty";
+            this.mcd_inqty.Size = new System.Drawing.Size(0, 21);
+            this.mcd_inqty.TabIndex = 54;
+            this.mcd_inqty.Tag = "mcd_inqty";
+            // 
             // pr_detail_label
             // 
             this.pr_detail_label.AutoSize = true;
@@ -496,8 +579,6 @@
             // SMTBind
             // 
             this.SMTBind.AutoSize = true;
-            this.SMTBind.Checked = true;
-            this.SMTBind.CheckState = System.Windows.Forms.CheckState.Checked;
             this.SMTBind.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.SMTBind.Location = new System.Drawing.Point(558, 500);
             this.SMTBind.Margin = new System.Windows.Forms.Padding(2);
@@ -506,6 +587,7 @@
             this.SMTBind.TabIndex = 195;
             this.SMTBind.Text = "SMT分板过站";
             this.SMTBind.UseVisualStyleBackColor = true;
+            this.SMTBind.Visible = false;
             // 
             // StepCount
             // 
@@ -541,89 +623,6 @@
             this.ma_softversion.Size = new System.Drawing.Size(0, 21);
             this.ma_softversion.TabIndex = 73;
             // 
-            // ob_sendqty
-            // 
-            this.ob_sendqty.AutoSize = true;
-            this.ob_sendqty.CutLength = null;
-            this.ob_sendqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_sendqty.ForeColor = System.Drawing.Color.Black;
-            this.ob_sendqty.Location = new System.Drawing.Point(109, 91);
-            this.ob_sendqty.MaximumSize = new System.Drawing.Size(150, 0);
-            this.ob_sendqty.Name = "ob_sendqty";
-            this.ob_sendqty.Size = new System.Drawing.Size(0, 21);
-            this.ob_sendqty.TabIndex = 78;
-            this.ob_sendqty.Tag = "ob_batchqty";
-            // 
-            // SendCheck
-            // 
-            this.SendCheck.AllPower = null;
-            this.SendCheck.BackColor = System.Drawing.Color.Transparent;
-            this.SendCheck.DownImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.DownImage")));
-            this.SendCheck.Enabled = false;
-            this.SendCheck.Image = null;
-            this.SendCheck.IsShowBorder = true;
-            this.SendCheck.Location = new System.Drawing.Point(229, 90);
-            this.SendCheck.Margin = new System.Windows.Forms.Padding(2);
-            this.SendCheck.MoveImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.MoveImage")));
-            this.SendCheck.Name = "SendCheck";
-            this.SendCheck.NormalImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.NormalImage")));
-            this.SendCheck.Power = null;
-            this.SendCheck.Size = new System.Drawing.Size(65, 26);
-            this.SendCheck.TabIndex = 72;
-            this.SendCheck.Text = "送检";
-            this.SendCheck.UseVisualStyleBackColor = false;
-            this.SendCheck.Click += new System.EventHandler(this.SendCheck_Click);
-            // 
-            // ob_batchqty
-            // 
-            this.ob_batchqty.AutoSize = true;
-            this.ob_batchqty.CutLength = null;
-            this.ob_batchqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_batchqty.ForeColor = System.Drawing.Color.Black;
-            this.ob_batchqty.Location = new System.Drawing.Point(109, 51);
-            this.ob_batchqty.MaximumSize = new System.Drawing.Size(150, 0);
-            this.ob_batchqty.Name = "ob_batchqty";
-            this.ob_batchqty.Size = new System.Drawing.Size(0, 21);
-            this.ob_batchqty.TabIndex = 75;
-            this.ob_batchqty.Tag = "ob_batchqty";
-            // 
-            // ob_nowcheckqty
-            // 
-            this.ob_nowcheckqty.AutoSize = true;
-            this.ob_nowcheckqty.CutLength = null;
-            this.ob_nowcheckqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_nowcheckqty.ForeColor = System.Drawing.Color.Black;
-            this.ob_nowcheckqty.Location = new System.Drawing.Point(248, 51);
-            this.ob_nowcheckqty.MaximumSize = new System.Drawing.Size(150, 0);
-            this.ob_nowcheckqty.Name = "ob_nowcheckqty";
-            this.ob_nowcheckqty.Size = new System.Drawing.Size(0, 21);
-            this.ob_nowcheckqty.TabIndex = 73;
-            this.ob_nowcheckqty.Tag = "ob_nowcheckqty";
-            // 
-            // mcd_remainqty
-            // 
-            this.mcd_remainqty.AutoSize = true;
-            this.mcd_remainqty.CutLength = null;
-            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(109, 12);
-            this.mcd_remainqty.MaximumSize = new System.Drawing.Size(150, 0);
-            this.mcd_remainqty.Name = "mcd_remainqty";
-            this.mcd_remainqty.Size = new System.Drawing.Size(0, 21);
-            this.mcd_remainqty.TabIndex = 57;
-            this.mcd_remainqty.Tag = "mcd_remainqty";
-            // 
-            // mcd_inqty
-            // 
-            this.mcd_inqty.AutoSize = true;
-            this.mcd_inqty.CutLength = null;
-            this.mcd_inqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_inqty.Location = new System.Drawing.Point(248, 12);
-            this.mcd_inqty.MaximumSize = new System.Drawing.Size(150, 0);
-            this.mcd_inqty.Name = "mcd_inqty";
-            this.mcd_inqty.Size = new System.Drawing.Size(0, 21);
-            this.mcd_inqty.TabIndex = 54;
-            this.mcd_inqty.Tag = "mcd_inqty";
-            // 
             // Save
             // 
             this.Save.AllPower = null;

+ 6 - 4
UAS_MES_NEW/FunctionCode/Packing/Packing_PackageCollection.cs

@@ -15,7 +15,7 @@ namespace UAS_MES_NEW.Packing
 {
     public partial class Packing_PackageCollection : Form
     {
-        public Seagull.BarTender.Print.Engine engine;
+        public BarTender.Application engine;
         DataHelper dh;
         DataTable dt;
         LogStringBuilder sql = new LogStringBuilder();
@@ -46,7 +46,7 @@ namespace UAS_MES_NEW.Packing
         {
             try
             {
-                engine = new Seagull.BarTender.Print.Engine();
+                engine = new BarTender.Application();
                 lbl = new ApplicationClass();
                 BaseUtil.WriteLbl();
             }
@@ -58,7 +58,7 @@ namespace UAS_MES_NEW.Packing
 
         private void PackCollection_Load(object sender, EventArgs e)
         {
-           // 杀死之前全部未关闭的进程
+            // 杀死之前全部未关闭的进程
             Process[] processes = System.Diagnostics.Process.GetProcessesByName("lppa");
             Process[] processes1 = System.Diagnostics.Process.GetProcessesByName("bartend");
             for (int i = 0; i < processes1.Length; i++)
@@ -586,7 +586,9 @@ namespace UAS_MES_NEW.Packing
 
         private void PackCollection_FormClosing(object sender, FormClosingEventArgs e)
         {
-              BaseUtil.ClosePrint(lbl);
+            BaseUtil.ClosePrint(lbl);
+            if (engine != null)
+                engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
             dh.Dispose();
         }
 

+ 5 - 3
UAS_MES_NEW/FunctionCode/Packing/Packing_PalletCollection.cs

@@ -25,7 +25,7 @@ namespace UAS_MES_NEW.Packing
 
         Packing_NewPallet NewPallet;
 
-        public Seagull.BarTender.Print.Engine engine;
+        public BarTender.Application engine;
 
         string pa_nextstep = "";
         //箱类型
@@ -53,7 +53,7 @@ namespace UAS_MES_NEW.Packing
         {
             try
             {
-                engine = new Seagull.BarTender.Print.Engine();
+                engine = new BarTender.Application();
                 lbl = new ApplicationClass();
                 BaseUtil.WriteLbl();
             }
@@ -442,7 +442,7 @@ namespace UAS_MES_NEW.Packing
                     }
                     else if (comboBox1.Text == "BARTENDER")
                     {
-                        if (Print.SinglePrint(Tag.ToString(),  engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "栈板标", "0", out ErrorMessage))
+                        if (Print.SinglePrint(Tag.ToString(), engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "栈板标", "0", out ErrorMessage))
                         {
                             OperateResult.AppendText(">>打印栈板" + pa_outboxcode.Text + "\n", Color.Black);
                         }
@@ -507,6 +507,8 @@ namespace UAS_MES_NEW.Packing
 
         private void Make_PalletCollection_FormClosing(object sender, FormClosingEventArgs e)
         {
+            if (engine != null)
+                engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
             BaseUtil.ClosePrint(lbl);
         }
 

+ 0 - 2
UAS_MES_NEW/Properties/licenses.licx

@@ -1,2 +0,0 @@
-DevExpress.XtraBars.BarManager, DevExpress.XtraBars.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraEditors.Repository.RepositoryItemTextEdit, DevExpress.XtraEditors.v15.2, Version=15.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

+ 1 - 1
UAS_MES_NEW/PublicMethod/LogicHandler.cs

@@ -783,7 +783,7 @@ namespace UAS_MES_NEW.PublicMethod
                 dh.ExecuteSql("delete from oqcbatchdetail where obd_sncode='" + iSnCode + "'", "delete");
             }
             //删除SMT版绑定关系
-            dh.ExecuteSql("delete from smtbind where sb_barcode = '"+iSnCode+"' and sb_makecode = '"+ iMakeCode + "'", "delete");
+          //  dh.ExecuteSql("delete from smtbind where sb_barcode = '"+iSnCode+"' and sb_makecode = '"+ iMakeCode + "'", "delete");
             //之前保存的不良就不再调用
             DataTable dt = dh.getFieldsDataByCondition("makeserial", new string[] { "ms_stepcode", "nvl(ms_ifrework,0)ms_ifrework", "ms_status" }, "ms_sncode='" + iSnCode + "' and ms_makecode='" + iMakeCode + "'");
             if (dt.Rows.Count > 0)

+ 17 - 15
UAS_MES_NEW/PublicMethod/Print.cs

@@ -6,7 +6,6 @@ using System.IO;
 using UAS_MES_NEW.Entity;
 using System.Text.RegularExpressions;
 using System.Windows.Forms;
-using Seagull.BarTender.Print;
 
 namespace UAS_MES_NEW.PublicMethod
 {
@@ -15,7 +14,7 @@ namespace UAS_MES_NEW.PublicMethod
         static DataHelper dh = SystemInf.dh;
         //CodeSoft打印的驱动和文件
         static Document doc;
-        static LabelFormatDocument doc2;
+        static BarTender.Format doc2;
         ////CodeSoft的打印机
         //string CodeSpft_Printer;
         static FileInfo info;
@@ -89,7 +88,7 @@ namespace UAS_MES_NEW.PublicMethod
                         }
                     }
                 }
-                catch (System.Exception)
+                catch (System.Exception ex)
                 {
                     MessageBox.Show("SQL维护不正确");
                 }
@@ -192,7 +191,7 @@ namespace UAS_MES_NEW.PublicMethod
                         }
                     }
                 }
-                catch (System.Exception)
+                catch (System.Exception ex)
                 {
                     MessageBox.Show("SQL维护不正确");
                 }
@@ -212,7 +211,7 @@ namespace UAS_MES_NEW.PublicMethod
 
 
 
-        public static bool SinglePrint(string iCaller, Seagull.BarTender.Print.Engine lbl, string LabelName, string LaID, string PrinterName, string SnCode, int PrintNum, string MakeCode, string ProdCode, string LabelType, string IfRePrint, out string ErrorMessage)
+        public static bool SinglePrint(string iCaller, BarTender.Application lbl, string LabelName, string LaID, string PrinterName, string SnCode, int PrintNum, string MakeCode, string ProdCode, string LabelType, string IfRePrint, out string ErrorMessage)
         {
             ErrorMessage = "";
             DataTable dt = new DataTable();
@@ -254,7 +253,7 @@ namespace UAS_MES_NEW.PublicMethod
             //    string update = "la_lastwritetime = to_date((regexp_substr('" + filechangetime + "','\\d+.+\\d+')),'yyyy-mm-dd hh24:mi:ss')";
             //    dh.UpdateByCondition("label", update, "la_id = '" + LaID + "'");
             //}
-            doc2 = lbl.Documents.Open(LabelName);
+            doc2 = lbl.Formats.Open(LabelName);
             if (doc2 == null)
             {
                 MessageBox.Show("标签文件打开失败");
@@ -281,16 +280,16 @@ namespace UAS_MES_NEW.PublicMethod
                         int LoopTime = Param.Rows.Count > 100 ? 100 : Param.Rows.Count;
                         for (int j = 0; j < LoopTime; j++)
                         {
-                            for (int k = 0; k < doc2.SubStrings.Count; k++)
+                            for (int k = 0; k < doc2.NamedSubStrings.Count; k++)
                             {
-                                if (j == 0 & doc2.SubStrings[k + 1].Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper())
+                                if (j == 0 & doc2.NamedSubStrings.Item(k + 1).Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper())
                                 {
-                                    doc2.SubStrings[k + 1].Value = (Param.Rows[0][0].ToString());
+                                    doc2.SetNamedSubStringValue(doc2.NamedSubStrings.Item(k + 1).Name, Param.Rows[0][0].ToString());
                                 }
                                 //使用SN开头的参数赋值SN1,SN2,SN3等参数
-                                if (j != 0 & doc2.SubStrings[k + 1].Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper() + (j))
+                                if (j != 0 & doc2.NamedSubStrings.Item(k + 1).Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper() + (j))
                                 {
-                                    doc2.SubStrings[k + 1].Value = (Param.Rows[j][0].ToString());
+                                    doc2.SetNamedSubStringValue(doc2.NamedSubStrings.Item(k + 1).Name, Param.Rows[j][0].ToString());
                                 }
                             }
                         }
@@ -308,14 +307,17 @@ namespace UAS_MES_NEW.PublicMethod
             // 同样标签的份数 
             doc2.PrintSetup.IdenticalCopiesOfLabel = PrintNum;
             // 序列标签数 
-            doc2.PrintSetup.NumberOfSerializedLabels = 1;
-            doc2.PrintSetup.PrinterName = PrinterName;
-            doc2.Print();
-            doc2.Close(Seagull.BarTender.Print.SaveOptions.DoNotSaveChanges);
+            doc2.PrintSetup.NumberSerializedLabels = 1;
+            doc2.PrintSetup.Printer = PrinterName;
+            doc2.PrintOut(false, false);
+            doc2.Close(BarTender.BtSaveOptions.btDoNotSaveChanges);
             LogicHandler.DoCommandLog(iCaller, User.UserCode, "", User.UserLineCode, User.UserSourceCode, "打印", "成功打印", SnCode, "");
             LogicHandler.doLabelPrintLog(SnCode, LabelType, MakeCode, ProdCode, User.UserSourceCode, User.CurrentStepCode, IfRePrint, User.UserCode);
             //打印完毕 
+            lbl.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
             return true;
         }
+
+
     }
 }

+ 184 - 0
UAS_MES_NEW/PublicMethod/SystemInfo.cs

@@ -0,0 +1,184 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Management;
+using System.Runtime.InteropServices;
+using System.Text;
+
+namespace UAS_MES_NEW.PublicMethod
+{
+    class SystemInfo
+    {
+        private int m_ProcessorCount = 0;   //CPU个数
+        private PerformanceCounter pcCpuLoad;   //CPU计数器
+        private long m_PhysicalMemory = 0;   //物理内存
+
+        private const int GW_HWNDFIRST = 0;
+        private const int GW_HWNDNEXT = 2;
+        private const int GWL_STYLE = (-16);
+        private const int WS_VISIBLE = 268435456;
+        private const int WS_BORDER = 8388608;
+
+        #region AIP声明
+        [DllImport("IpHlpApi.dll")]
+        extern static public uint GetIfTable(byte[] pIfTable, ref uint pdwSize, bool bOrder);
+
+        [DllImport("User32")]
+        private extern static int GetWindow(int hWnd, int wCmd);
+
+        [DllImport("User32")]
+        private extern static int GetWindowLongA(int hWnd, int wIndx);
+
+        [DllImport("user32.dll")]
+        private static extern bool GetWindowText(int hWnd, StringBuilder title, int maxBufSize);
+
+        [DllImport("user32", CharSet = CharSet.Auto)]
+        private extern static int GetWindowTextLength(IntPtr hWnd);
+        #endregion
+
+        #region 构造函数
+        /// <summary>
+        /// 构造函数,初始化计数器等
+        /// </summary>
+        public SystemInfo()
+        {
+            //初始化CPU计数器
+            pcCpuLoad = new PerformanceCounter("Processor", "% Processor Time", "_Total");
+            pcCpuLoad.MachineName = ".";
+            pcCpuLoad.NextValue();
+
+            //CPU个数
+            m_ProcessorCount = Environment.ProcessorCount;
+
+            //获得物理内存
+            ManagementClass mc = new ManagementClass("Win32_ComputerSystem");
+            ManagementObjectCollection moc = mc.GetInstances();
+            foreach (ManagementObject mo in moc)
+            {
+                if (mo["TotalPhysicalMemory"] != null)
+                {
+                    m_PhysicalMemory = long.Parse(mo["TotalPhysicalMemory"].ToString());
+                }
+            }
+        }
+        #endregion
+
+        #region CPU个数
+        /// <summary>
+        /// 获取CPU个数
+        /// </summary>
+        public int ProcessorCount
+        {
+            get
+            {
+                return m_ProcessorCount;
+            }
+        }
+        #endregion
+
+        #region CPU占用率
+        /// <summary>
+        /// 获取CPU占用率
+        /// </summary>
+        public float CpuLoad
+        {
+            get
+            {
+                return pcCpuLoad.NextValue();
+            }
+        }
+        #endregion
+
+        #region 可用内存
+        /// <summary>
+        /// 获取可用内存
+        /// </summary>
+        public long MemoryAvailable
+        {
+            get
+            {
+                long availablebytes = 0;
+                //ManagementObjectSearcher mos = new ManagementObjectSearcher("SELECT * FROM Win32_PerfRawData_PerfOS_Memory");
+                //foreach (ManagementObject mo in mos.Get())
+                //{
+                //    availablebytes = long.Parse(mo["Availablebytes"].ToString());
+                //}
+                ManagementClass mos = new ManagementClass("Win32_OperatingSystem");
+                foreach (ManagementObject mo in mos.GetInstances())
+                {
+                    if (mo["FreePhysicalMemory"] != null)
+                    {
+                        availablebytes = 1024 * long.Parse(mo["FreePhysicalMemory"].ToString());
+                    }
+                }
+                return availablebytes;
+            }
+        }
+        #endregion
+
+        #region 物理内存
+        /// <summary>
+        /// 获取物理内存
+        /// </summary>
+        public long PhysicalMemory
+        {
+            get
+            {
+                return m_PhysicalMemory;
+            }
+        }
+        #endregion
+
+        #region 结束指定进程
+        /// <summary>
+        /// 结束指定进程
+        /// </summary>
+        /// <param name="pid">进程的 Process ID</param>
+        public static void EndProcess(int pid)
+        {
+            try
+            {
+                Process process = Process.GetProcessById(pid);
+                process.Kill();
+            }
+            catch { }
+        }
+        #endregion
+
+
+        #region 查找所有应用程序标题
+        /// <summary>
+        /// 查找所有应用程序标题
+        /// </summary>
+        /// <returns>应用程序标题范型</returns>
+        public static List<string> FindAllApps(int Handle)
+        {
+            List<string> Apps = new List<string>();
+
+            int hwCurr;
+            hwCurr = GetWindow(Handle, GW_HWNDFIRST);
+
+            while (hwCurr > 0)
+            {
+                int IsTask = (WS_VISIBLE | WS_BORDER);
+                int lngStyle = GetWindowLongA(hwCurr, GWL_STYLE);
+                bool TaskWindow = ((lngStyle & IsTask) == IsTask);
+                if (TaskWindow)
+                {
+                    int length = GetWindowTextLength(new IntPtr(hwCurr));
+                    StringBuilder sb = new StringBuilder(2 * length + 1);
+                    GetWindowText(hwCurr, sb, sb.Capacity);
+                    string strTitle = sb.ToString();
+                    if (!string.IsNullOrEmpty(strTitle))
+                    {
+                        Apps.Add(strTitle);
+                    }
+                }
+                hwCurr = GetWindow(hwCurr, GW_HWNDNEXT);
+            }
+
+            return Apps;
+        }
+        #endregion     
+    }
+}

+ 14 - 10
UAS_MES_NEW/UAS_MES_NEW.csproj

@@ -4,7 +4,7 @@
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{8F7287BF-B2F0-4C72-9060-C5CB290F8938}</ProjectGuid>
+    <ProjectGuid>{A51914AE-791A-4385-8A17-2394C51F18B8}</ProjectGuid>
     <OutputType>WinExe</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>UAS_MES_NEW</RootNamespace>
@@ -138,6 +138,10 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>Tool\Oracle.ManagedDataAccess.dll</HintPath>
     </Reference>
+    <Reference Include="Seagull.BarTender.Print, Version=11.0.5.1, Culture=neutral, PublicKeyToken=109ff779a1b4cbc7, processorArchitecture=x86">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\UAS-出货标签管理(贸易版)\tool\Seagull.BarTender.Print.dll</HintPath>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Configuration" />
     <Reference Include="System.Core" />
@@ -478,12 +482,6 @@
     <Compile Include="Entity\SystemInf.cs" />
     <Compile Include="Entity\User.cs" />
     <Compile Include="Enum\EMouseState.cs" />
-    <Compile Include="Form1.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="Form1.Designer.cs">
-      <DependentUpon>Form1.cs</DependentUpon>
-    </Compile>
     <Compile Include="FunctionCode\Employee\Employee_ChooseUserToGroup.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -898,6 +896,12 @@
     <Compile Include="FunctionCode\Special\Special_CancelProdinout.Designer.cs">
       <DependentUpon>Special_CancelProdinout.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Special\Special_GetBad.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Special\Special_GetBad.Designer.cs">
+      <DependentUpon>Special_GetBad.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Special\Special_MendLabel.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1196,9 +1200,6 @@
     <EmbeddedResource Include="DbFind.resx">
       <DependentUpon>DbFind.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="Form1.resx">
-      <DependentUpon>Form1.cs</DependentUpon>
-    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Employee\Employee_ChooseUserToGroup.resx">
       <DependentUpon>Employee_ChooseUserToGroup.cs</DependentUpon>
     </EmbeddedResource>
@@ -1406,6 +1407,9 @@
     <EmbeddedResource Include="FunctionCode\Special\Special_CancelProdinout.resx">
       <DependentUpon>Special_CancelProdinout.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Special\Special_GetBad.resx">
+      <DependentUpon>Special_GetBad.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Special\Special_MendLabel.resx">
       <DependentUpon>Special_MendLabel.cs</DependentUpon>
     </EmbeddedResource>

+ 12 - 12
UAS_PRINT/PrintHandler.cs

@@ -240,18 +240,18 @@ namespace UAS_PRINT
                     byte[] buffer = Encoding.GetEncoding("GB2312").GetBytes(chooseprintername);
                     chooseprintername = Encoding.UTF8.GetString(buffer);
                     Report.PrintSettings.Printer = chooseprintername.Replace("\\\\", "\\");
-                    //foreach (DataRow dr in dt.Rows)
-                    //{
-                    //    DataTable dta = dt.Clone();
-                    //    dta.Rows.Add(dr.ItemArray);
-                    //    Report.RegisterData(dta, label_type);
-                    //    Report.GetDataSource(label_type).Enabled = true;
-                    //    Report.Print();
-                    //}
-                    Report.RegisterData(dt, label_type);
-                    Report.GetDataSource(label_type).Enabled = true;
-                    Report.Print();
-               }
+                    foreach (DataRow dr in dt.Rows)
+                    {
+                        DataTable dta = dt.Clone();
+                        dta.Rows.Add(dr.ItemArray);
+                        Report.RegisterData(dta, label_type);
+                        Report.GetDataSource(label_type).Enabled = true;
+                        Report.Print();
+                    }
+                    //Report.RegisterData(dt, label_type);
+                    //Report.GetDataSource(label_type).Enabled = true;
+                    //Report.Print();
+                }
                
             }
             catch(Exception ex)