瀏覽代碼

添加合并内容

章政 7 年之前
父節點
當前提交
25f6d0005b

+ 13 - 0
UAS-出货标签管理(泽天)/CustomControl/EnterTextBox.cs

@@ -64,6 +64,19 @@ namespace UAS_LabelMachine.CustomControl
             }
         }
 
+        public override string Text
+        {
+            get
+            {
+                return base.Text.ToUpper();
+            }
+
+            set
+            {
+                base.Text = value;
+            }
+        }
+
         public EnterTextBox()
         {
             InitializeComponent();

+ 49 - 22
UAS-出货标签管理(泽天)/UAS_出货标签管理.Designer.cs

@@ -152,6 +152,8 @@
             this.Combindetail = new System.Windows.Forms.CheckBox();
             this.label8 = new System.Windows.Forms.Label();
             this.pi_title = new System.Windows.Forms.Label();
+            this.label9 = new System.Windows.Forms.Label();
+            this.ProcessCount = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridPrcode)).BeginInit();
@@ -252,7 +254,7 @@
             // 
             this.GetGridOnly.AutoSize = true;
             this.GetGridOnly.Font = new System.Drawing.Font("微软雅黑", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.GetGridOnly.Location = new System.Drawing.Point(517, 245);
+            this.GetGridOnly.Location = new System.Drawing.Point(133, 221);
             this.GetGridOnly.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
             this.GetGridOnly.Name = "GetGridOnly";
             this.GetGridOnly.Size = new System.Drawing.Size(96, 23);
@@ -598,7 +600,7 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(309, 194);
+            this.label3.Location = new System.Drawing.Point(309, 185);
             this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(64, 24);
@@ -609,7 +611,7 @@
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(309, 231);
+            this.label4.Location = new System.Drawing.Point(309, 222);
             this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(64, 24);
@@ -620,7 +622,7 @@
             // 
             this.bi_inman.AutoSize = true;
             this.bi_inman.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.bi_inman.Location = new System.Drawing.Point(396, 194);
+            this.bi_inman.Location = new System.Drawing.Point(396, 185);
             this.bi_inman.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.bi_inman.Name = "bi_inman";
             this.bi_inman.Size = new System.Drawing.Size(0, 24);
@@ -630,7 +632,7 @@
             // 
             this.pib_inman.AutoSize = true;
             this.pib_inman.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pib_inman.Location = new System.Drawing.Point(396, 231);
+            this.pib_inman.Location = new System.Drawing.Point(396, 222);
             this.pib_inman.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pib_inman.Name = "pib_inman";
             this.pib_inman.Size = new System.Drawing.Size(0, 24);
@@ -796,7 +798,7 @@
             // 
             this.label18.AutoSize = true;
             this.label18.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label18.Location = new System.Drawing.Point(85, 126);
+            this.label18.Location = new System.Drawing.Point(85, 175);
             this.label18.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label18.Name = "label18";
             this.label18.Size = new System.Drawing.Size(15, 20);
@@ -806,7 +808,7 @@
             // MidBoxEnd
             // 
             this.MidBoxEnd.ID = null;
-            this.MidBoxEnd.Location = new System.Drawing.Point(111, 135);
+            this.MidBoxEnd.Location = new System.Drawing.Point(111, 171);
             this.MidBoxEnd.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
             this.MidBoxEnd.Name = "MidBoxEnd";
             this.MidBoxEnd.Size = new System.Drawing.Size(65, 25);
@@ -818,7 +820,7 @@
             // MidBoxBegin
             // 
             this.MidBoxBegin.ID = null;
-            this.MidBoxBegin.Location = new System.Drawing.Point(11, 135);
+            this.MidBoxBegin.Location = new System.Drawing.Point(11, 171);
             this.MidBoxBegin.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
             this.MidBoxBegin.Name = "MidBoxBegin";
             this.MidBoxBegin.Size = new System.Drawing.Size(65, 25);
@@ -831,7 +833,7 @@
             // 
             this.label16.AutoSize = true;
             this.label16.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label16.Location = new System.Drawing.Point(84, 47);
+            this.label16.Location = new System.Drawing.Point(84, 96);
             this.label16.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label16.Name = "label16";
             this.label16.Size = new System.Drawing.Size(15, 20);
@@ -841,7 +843,7 @@
             // SingleBoxEnd
             // 
             this.SingleBoxEnd.ID = null;
-            this.SingleBoxEnd.Location = new System.Drawing.Point(109, 58);
+            this.SingleBoxEnd.Location = new System.Drawing.Point(109, 94);
             this.SingleBoxEnd.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
             this.SingleBoxEnd.Name = "SingleBoxEnd";
             this.SingleBoxEnd.Size = new System.Drawing.Size(65, 25);
@@ -853,7 +855,7 @@
             // SingleBoxBegin
             // 
             this.SingleBoxBegin.ID = null;
-            this.SingleBoxBegin.Location = new System.Drawing.Point(9, 56);
+            this.SingleBoxBegin.Location = new System.Drawing.Point(9, 92);
             this.SingleBoxBegin.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
             this.SingleBoxBegin.Name = "SingleBoxBegin";
             this.SingleBoxBegin.Size = new System.Drawing.Size(65, 25);
@@ -866,7 +868,7 @@
             // 
             this.label12.AutoSize = true;
             this.label12.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label12.Location = new System.Drawing.Point(9, 79);
+            this.label12.Location = new System.Drawing.Point(9, 140);
             this.label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label12.Name = "label12";
             this.label12.Size = new System.Drawing.Size(69, 20);
@@ -877,7 +879,7 @@
             // 
             this.label7.AutoSize = true;
             this.label7.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label7.Location = new System.Drawing.Point(9, 8);
+            this.label7.Location = new System.Drawing.Point(9, 42);
             this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(69, 20);
@@ -1133,7 +1135,7 @@
             // 
             this.SingleLabelPrint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.SingleLabelPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelPrint.Location = new System.Drawing.Point(130, 214);
+            this.SingleLabelPrint.Location = new System.Drawing.Point(67, 222);
             this.SingleLabelPrint.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
             this.SingleLabelPrint.Name = "SingleLabelPrint";
             this.SingleLabelPrint.Size = new System.Drawing.Size(91, 32);
@@ -1148,7 +1150,7 @@
             this.SingleLabelAutoPrint.Checked = true;
             this.SingleLabelAutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
             this.SingleLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(8, 117);
+            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(8, 115);
             this.SingleLabelAutoPrint.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
             this.SingleLabelAutoPrint.Name = "SingleLabelAutoPrint";
             this.SingleLabelAutoPrint.Size = new System.Drawing.Size(91, 24);
@@ -1201,7 +1203,7 @@
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(8, 153);
+            this.label2.Location = new System.Drawing.Point(8, 151);
             this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(39, 20);
@@ -1225,7 +1227,7 @@
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(10, 193);
+            this.label5.Location = new System.Drawing.Point(10, 191);
             this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(39, 20);
@@ -1259,7 +1261,7 @@
             this.MidLabelAutoPrint.Checked = true;
             this.MidLabelAutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
             this.MidLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MidLabelAutoPrint.Location = new System.Drawing.Point(12, 118);
+            this.MidLabelAutoPrint.Location = new System.Drawing.Point(12, 116);
             this.MidLabelAutoPrint.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
             this.MidLabelAutoPrint.Name = "MidLabelAutoPrint";
             this.MidLabelAutoPrint.Size = new System.Drawing.Size(91, 24);
@@ -1302,7 +1304,7 @@
             // LogingOut
             // 
             this.LogingOut.AutoSize = true;
-            this.LogingOut.Location = new System.Drawing.Point(145, -4);
+            this.LogingOut.Location = new System.Drawing.Point(145, -6);
             this.LogingOut.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.LogingOut.Name = "LogingOut";
             this.LogingOut.Size = new System.Drawing.Size(52, 27);
@@ -1329,7 +1331,7 @@
             // 
             this.label10.AutoSize = true;
             this.label10.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label10.Location = new System.Drawing.Point(9, 184);
+            this.label10.Location = new System.Drawing.Point(9, 182);
             this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(39, 20);
@@ -1340,7 +1342,7 @@
             // 
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label6.Location = new System.Drawing.Point(9, 137);
+            this.label6.Location = new System.Drawing.Point(9, 135);
             this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(39, 20);
@@ -1394,7 +1396,7 @@
             // 
             this.Combindetail.AutoSize = true;
             this.Combindetail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Combindetail.Location = new System.Drawing.Point(395, 146);
+            this.Combindetail.Location = new System.Drawing.Point(395, 142);
             this.Combindetail.Name = "Combindetail";
             this.Combindetail.Size = new System.Drawing.Size(114, 31);
             this.Combindetail.TabIndex = 104;
@@ -1423,12 +1425,35 @@
             this.pi_title.Size = new System.Drawing.Size(0, 24);
             this.pi_title.TabIndex = 105;
             // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label9.Location = new System.Drawing.Point(309, 250);
+            this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(108, 24);
+            this.label9.TabIndex = 107;
+            this.label9.Text = "已装箱/总数";
+            // 
+            // ProcessCount
+            // 
+            this.ProcessCount.AutoSize = true;
+            this.ProcessCount.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ProcessCount.Location = new System.Drawing.Point(436, 250);
+            this.ProcessCount.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ProcessCount.Name = "ProcessCount";
+            this.ProcessCount.Size = new System.Drawing.Size(0, 24);
+            this.ProcessCount.TabIndex = 108;
+            // 
             // UAS_出货标签打印
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(233)))), ((int)(((byte)(206)))));
             this.ClientSize = new System.Drawing.Size(1676, 911);
+            this.Controls.Add(this.ProcessCount);
+            this.Controls.Add(this.label9);
             this.Controls.Add(this.label8);
             this.Controls.Add(this.pi_title);
             this.Controls.Add(this.Combindetail);
@@ -1617,5 +1642,7 @@
         private System.Windows.Forms.CheckBox Combindetail;
         private System.Windows.Forms.Label label8;
         private System.Windows.Forms.Label pi_title;
+        private System.Windows.Forms.Label label9;
+        private System.Windows.Forms.Label ProcessCount;
     }
 }

+ 60 - 32
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -10,9 +10,9 @@ using UAS_LabelMachine.PublicMethod;
 using UAS_LabelMachine.Entity;
 using UAS_LabelMachine.PublicForm;
 using System.Threading;
-using System.IO;
 using System.Globalization;
 using FastReport;
+using System.Linq;
 
 namespace UAS_LabelMachine
 {
@@ -806,26 +806,23 @@ namespace UAS_LabelMachine
                         return;
                     }
                 }
-                ////如果有选中行
-                //string SelectProdcode = "";
-                //if (LabelInf.SelectedRows.Count > 0)
-                //{
-                //    DataGridViewSelectedRowCollection selectedrow = LabelInf.SelectedRows;
-                //    SelectProdcode = selectedrow[0].Cells["pib_prodcode"].Value.ToString();
-                //    MidOutBoxCode.Clear();
-                //    MidOutBoxCodeIndex.Clear();
-                //}
-                //for (int i = 0; i < LabelInf.Rows.Count; i++)
-                //{
-                //    if (LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() == SelectProdcode)
-                //    {
-                //        if (!MidOutBoxCode.Contains(int.Parse(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())))
-                //        {
-                //            MidOutBoxCode.Add(int.Parse(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString()));
-                //            MidOutBoxCodeIndex.Add(i);
-                //        }
-                //    }
-                //}
+                //如果有选中行
+                if (SelectProdcode != "")
+                {
+                    MidOutBoxCode.Clear();
+                    MidOutBoxCodeIndex.Clear();
+                }
+                for (int i = 0; i < LabelInf.Rows.Count; i++)
+                {
+                    if (LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() == SelectProdcode)
+                    {
+                        if (!MidOutBoxCode.Contains(int.Parse(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())))
+                        {
+                            MidOutBoxCode.Add(int.Parse(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString()));
+                            MidOutBoxCodeIndex.Add(i);
+                        }
+                    }
+                }
                 for (int i = 0; i < MidOutBoxCodeIndex.Count; i++)
                 {
                     try
@@ -1089,14 +1086,20 @@ namespace UAS_LabelMachine
             if (LabelInf.Rows.Count > 0)
                 LabelInf.FirstDisplayedScrollingRowIndex = LabelInf.Rows.Count - 1;
             //计算所有的采集数量
+            double CollectNum = 0;
+            double OutNum = 0;
             for (int i = 0; i < GridPrcode.Rows.Count; i++)
             {
                 string CurrentPrCode = GridPrcode.Rows[i].Cells["pd_prodcode"].Value.ToString();
                 string CurrentPDNO = GridPrcode.Rows[i].Cells["pd_pdno"].Value.ToString();
+                string CurrentOutQTY = GridPrcode.Rows[i].Cells["pd_outqty"].Value.ToString();
                 string collectqty = (LabelInfDataTable.Compute("sum(pib_qty)", "pib_prodcode='" + CurrentPrCode + "' and pib_pdno='" + CurrentPDNO + "'").ToString());
+                CollectNum += double.Parse(collectqty == "" ? "0" : collectqty);
+                OutNum += double.Parse(CurrentOutQTY);
                 GridPrcode.Rows[i].Cells["CollectedNum"].Value = collectqty;
                 GridPrcode.Rows[i].Cells["UnCollectedNum"].Value = Convert.ToDouble(double.Parse(GridPrcode.Rows[i].Cells["pd_outqty"].Value.ToString()) - double.Parse(collectqty == "" ? "0" : collectqty)).ToString("0.00");
             }
+            ProcessCount.Text = CollectNum + "/" + OutNum;
         }
 
         private void Refresh_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
@@ -1297,27 +1300,51 @@ namespace UAS_LabelMachine
 
         private void LoadPrcodeData()
         {
+            GridPrcode.DataSource = (DataTable)dh.ExecuteSql("select pd_pdno,pd_prodcode,'0' CollectedNum,'0' UnCollectedNum,pd_outqty,pr_unit,pd_brand,pjd_zxbzs_user,pjd_id from prodiodetail left join prodinout on pi_id=pd_piid left join PRODJOINVENDDETAIL on pjd_brand =pd_brand and pjd_prodcode=pd_prodcode left join product on pd_prodcode=pr_code where pi_id='" + PI_ID + "' order by pd_pdno", "select");
+            List<int> RemoveIndex = new List<int>();
             if (Combindetail.Checked)
             {
-                sql.Clear();
-                sql.Append("select min(pd_pdno)pd_pdno,pd_prodcode,'0' CollectedNum,'0' UnCollectedNum,sum(pd_outqty)pd_outqty,pr_unit,pd_brand,pjd_zxbzs_user,pjd_id ");
-                sql.Append("from  prodiodetail left join prodinout on pi_id=pd_piid left join PRODJOINVENDDETAIL on ");
-                sql.Append("pjd_brand =pd_brand and pjd_prodcode=pd_prodcode left join product on pd_prodcode=pr_code where pi_id='" + PI_ID + "'");
-                sql.Append("group by pd_prodcode,pd_brand,pr_unit ,pjd_zxbzs_user,pjd_id  order by pd_pdno");
-                GridPrcode.DataSource = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-            }
-            else
-            {
-                GridPrcode.DataSource = (DataTable)dh.ExecuteSql("select pd_pdno,pd_prodcode,'0' CollectedNum,'0' UnCollectedNum,pd_outqty,pr_unit,pd_brand,pjd_zxbzs_user,pjd_id from prodiodetail left join prodinout on pi_id=pd_piid left join PRODJOINVENDDETAIL on pjd_brand =pd_brand and pjd_prodcode=pd_prodcode left join product on pd_prodcode=pr_code where pi_id='" + PI_ID + "' order by pd_pdno", "select");
+                int CurrentIndex = 0;
+                for (int i = 0; i < GridPrcode.Rows.Count; i++)
+                {
+                    if (i + 1 < GridPrcode.Rows.Count)
+                    {
+                        string BProdCode = GridPrcode.Rows[i].Cells["pd_prodcode"].Value.ToString();
+                        string BPrUnit = GridPrcode.Rows[i].Cells["pr_unit"].Value.ToString();
+                        string BPrBrand = GridPrcode.Rows[i].Cells["pd_brand"].Value.ToString();
+                        string FProdCode = GridPrcode.Rows[i + 1].Cells["pd_prodcode"].Value.ToString();
+                        string FPrUnit = GridPrcode.Rows[i + 1].Cells["pr_unit"].Value.ToString();
+                        string FrBrand = GridPrcode.Rows[i + 1].Cells["pd_brand"].Value.ToString();
+                        if (BProdCode == FProdCode && BPrUnit == FPrUnit && BPrBrand == FrBrand)
+                        {
+                            GridPrcode.Rows[CurrentIndex].Cells["pd_outqty"].Value = double.Parse(GridPrcode.Rows[CurrentIndex].Cells["pd_outqty"].Value.ToString()) + double.Parse(GridPrcode.Rows[i + 1].Cells["pd_outqty"].Value.ToString());
+                            RemoveIndex.Add(i + 1);
+                        }
+                        else
+                        {
+                            CurrentIndex = i + 1;
+                        }
+                    }
+                }
+                foreach (int item in RemoveIndex.OrderByDescending(x => x))
+                {
+                    GridPrcode.Rows.RemoveAt(item);
+                }
             }
+            double CollectNum = 0;
+            double OutNum = 0;
             for (int i = 0; i < GridPrcode.Rows.Count; i++)
             {
                 string CurrentPrCode = GridPrcode.Rows[i].Cells["pd_prodcode"].Value.ToString();
                 string CurrentPDNO = GridPrcode.Rows[i].Cells["pd_pdno"].Value.ToString();
+                string CurrentOutQTY = GridPrcode.Rows[i].Cells["pd_outqty"].Value.ToString();
                 string collectqty = (LabelInfDataTable.Compute("sum(pib_qty)", "pib_prodcode='" + CurrentPrCode + "' and pib_pdno='" + CurrentPDNO + "'").ToString());
+                CollectNum += double.Parse(collectqty == "" ? "0" : collectqty);
+                OutNum += double.Parse(CurrentOutQTY);
                 GridPrcode.Rows[i].Cells["CollectedNum"].Value = collectqty;
                 GridPrcode.Rows[i].Cells["UnCollectedNum"].Value = Convert.ToDouble(double.Parse(GridPrcode.Rows[i].Cells["pd_outqty"].Value.ToString()) - double.Parse(collectqty == "" ? "0" : collectqty)).ToString("0.00");
             }
+            ProcessCount.Text = CollectNum + "/" + OutNum;
             if (GridPrcode.Rows.Count > 0)
             {
                 CurrentPrCode = GridPrcode.Rows[0].Cells["pd_prodcode"].Value.ToString();
@@ -1706,7 +1733,8 @@ namespace UAS_LabelMachine
         string SelectProdcode = "";
         private void LabelInf_CellClick(object sender, DataGridViewCellEventArgs e)
         {
-            //LabelInf.Rows[e.RowIndex].Selected = true;
+            LabelInf.Rows[e.RowIndex].Selected = true;
+            SelectProdcode = LabelInf.Rows[e.RowIndex].Cells["pib_prodcode"].Value.ToString();
         }
     }
 }