From baead5c3807d798141313c62cf6e60d95029f08d Mon Sep 17 00:00:00 2001
From: yxj <1qaz@123>
Date: 星期四, 20 十月 2022 10:50:28 +0800
Subject: [PATCH] 条码档案列表模块增加绑定、解绑托条码功能

---
 WarM/条码打印/Gy_BarCodeBillList.resx        |   24 ++++
 WarM/条码打印/Gy_BarCodeBillList.cs          |  127 +++++++++++++++++++++++++
 WarM/条码打印/Gy_BarCodeBillList.designer.cs |   92 +++++++++++++-----
 3 files changed, 218 insertions(+), 25 deletions(-)

diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBillList.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBillList.cs"
index 28c328d..0d742fb 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBillList.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBillList.cs"
@@ -37,6 +37,7 @@
         public string PrintQtyCtl = "";         //鏉$爜鎵撳嵃娆℃暟鎺у埗
         public string UpdatePrintQtyCtl = "";   //鏉$爜鎵撳嵃娆℃暟鏇存柊
         public string SourceQtyCtl = "";        //瓒呮簮鍗曟暟閲忔帶鍒�
+        public string CampanyName = "";         //瀹㈡埛瀹氬埗鍖栧悕绉�
 
         #region  鍥哄畾浠g爜
 
@@ -70,6 +71,7 @@
                 PrintQtyCtl = oSystemParameter.omodel.BarCode_PrintQtyCtl;
                 UpdatePrintQtyCtl = oSystemParameter.omodel.BarCode_UpdatePrintQtyCtl;
                 SourceQtyCtl = oSystemParameter.omodel.BarCode_SourceQtyCtl;
+                CampanyName = oSystemParameter.omodel.WMS_CampanyName;
             }
         }
 
@@ -598,9 +600,134 @@
 
 
 
+
+
+
         #endregion
 
 
+        #region  缁戝畾鎵樻潯鐮�
+        private void bdBarCode_Pack_Click(object sender, EventArgs e)
+        {
+            if (grdMain.CurrentRow == null)
+            {
+                MessageBox.Show("璇峰厛閫夋嫨闇�瑕佺粦瀹氱殑鏉$爜锛�", "鎻愮ず");
+                return;
+            }
+            else
+            {
+                Int64 hmainid = 0;
+                string HItemID = "";
+                string s = "";
+                string HBarCode_Pack = "";
+                for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++)
+                {
+                    if (s.Length > 4500)
+                    {
+                        HItemID = HItemID + "#" + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("hmainid")].Value.ToString());
+                        s = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("hmainid")].Value.ToString());
+                    }
+                    else
+                    {
+                        HItemID = HItemID + "," + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("hmainid")].Value.ToString());
+                        s = s + "," + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("hmainid")].Value.ToString());
+                    }
+
+                    //鑾峰彇鎵樻潯鐮佸彿锛氭墭鏉$爜=鎵�閫夋潯鐮佷腑娴佹按鍙锋渶澶х殑鏉$爜+鈥�-1鈥�
+                    if (hmainid<DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("hmainid")].Value.ToString()))
+                    {
+                        hmainid = DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("hmainid")].Value.ToString());
+                        HBarCode_Pack = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("鏉$爜缂栧彿")].Value) + "-1";
+                    }
+                }
+
+                try
+                {
+                    oCn.BeginTran();
+                    Int64 HFlag = 0;
+                    HItemID = HItemID.Remove(0, 1);     //鍘绘帀瀛楃涓茬涓�涓瓧绗�
+                    string[] NewHItemID;
+                    NewHItemID = HItemID.Split(Convert.ToChar("#"));
+
+                    for (int i = 0; i <= NewHItemID.Length - 1; i++)
+                    {
+                        if(i == NewHItemID.Length - 1)
+                        {
+                            HFlag = 1;
+                        }
+                        //鎵樻潯鐮佺粦瀹氬墠鍒ゆ柇锛屽洖濉墭鏉$爜淇℃伅锛岀敓鎴愭墭鏉$爜
+                        DataSet DS = oCn.RunProcReturn("exec h_p_Gy_BarCodeBill_BindPack '" + NewHItemID[i] + "','" + HBarCode_Pack + "','" + CampanyName + "'," + HFlag + ",'" + DBUtility.ClsPub.CurUserName + "'", "h_p_Gy_BarCodeBill_BindPack");
+                        if (DS == null || DS.Tables[0].Rows.Count <= 0)
+                        {
+                            oCn.CnClose();
+                            oCn.CnDispose();
+                            MessageBox.Show("缁戝畾骞剁敓鎴愭墭鏉$爜鍒ゆ柇閿欒锛�");
+                            return;
+                        }
+                        else if (DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]) == "1")
+                        {
+                            oCn.CnClose();
+                            oCn.CnDispose();
+                            MessageBox.Show(DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]));
+                            return;
+                        }
+                    }
+
+                    MessageBox.Show("缁戝畾骞剁敓鎴愭墭鏉$爜鎴愬姛锛�", "鎻愮ず");
+                    Display();
+                    oCn.Commit();
+                }
+                catch (Exception e2)
+                {
+                    oCn.RollBack();
+                    throw (e2);
+                }
+            }
+        }
+
+        #endregion
+
+
+        #region  瑙g粦鎵樻潯鐮�
+        private void jbBarCode_Pack_Click(object sender, EventArgs e)
+        {
+            if (grdMain.CurrentRow == null)
+            {
+                MessageBox.Show("璇峰厛閫夋嫨闇�瑕佽В缁戠殑鏉$爜锛�", "鎻愮ず");
+                return;
+            }
+            if (grdMain.SelectedRows.Count != 1)
+            {
+                MessageBox.Show("涓�娆″彧鍏佽閫変腑涓�琛屾潯鐮佽褰曪紝璇烽噸鏂伴�夋嫨闇�瑕佽В缁戠殑鏉$爜锛�");
+                return;
+            }
+            else
+            {
+                Int64 HItemID = 0;
+                HItemID = DBUtility.ClsPub.isLong(grdMain.SelectedRows[0].Cells[Fun_GetCol("hmainid")].Value);
+
+                //鎵樻潯鐮佽В缁戝墠鍒ゆ柇锛屽洖濉墭鏉$爜淇℃伅锛屽垹闄ゆ墭鏉$爜
+                DataSet DS = oCn.RunProcReturn("exec h_p_Gy_BarCodeBill_UnBindPack " + HItemID + ",'" + CampanyName + "'", "h_p_Gy_BarCodeBill_UnBindPack");
+                if (DS == null || DS.Tables[0].Rows.Count <= 0)
+                {
+                    MessageBox.Show("瑙g粦骞跺垹闄ゆ墭鏉$爜鍒ゆ柇閿欒锛�");
+                    return;
+                }
+                else if (DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]) == "1")
+                {
+                    MessageBox.Show(DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]));
+                    return;
+                }
+                else
+                {
+                    MessageBox.Show("瑙g粦骞跺垹闄ゆ墭鏉$爜鎴愬姛锛�", "鎻愮ず");
+                    Display();
+                }
+            }
+        }
+
+        #endregion
+
 
 
     }
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBillList.designer.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBillList.designer.cs"
index 95a0fd1..35a647e 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBillList.designer.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBillList.designer.cs"
@@ -36,6 +36,9 @@
             this.lbldj = new System.Windows.Forms.Label();
             this.lblCaption = new System.Windows.Forms.Label();
             this.Tool = new System.Windows.Forms.ToolStrip();
+            this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton();
+            this.eXCELToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.cSVToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.dy = new System.Windows.Forms.ToolStripButton();
             this.yl = new System.Windows.Forms.ToolStripButton();
             this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
@@ -59,9 +62,9 @@
             this.timer2 = new System.Windows.Forms.Timer(this.components);
             this.grdMain = new System.Windows.Forms.DataGridView();
             this.grdPrint = new System.Windows.Forms.DataGridView();
-            this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton();
-            this.eXCELToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.cSVToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.bdBarCode_Pack = new System.Windows.Forms.ToolStripButton();
+            this.jbBarCode_Pack = new System.Windows.Forms.ToolStripButton();
+            this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
             this.pPic.SuspendLayout();
             this.panel1.SuspendLayout();
             this.Tool.SuspendLayout();
@@ -141,6 +144,9 @@
             this.toolStripSeparator5,
             this.zf,
             this.fzf,
+            this.toolStripSeparator4,
+            this.bdBarCode_Pack,
+            this.jbBarCode_Pack,
             this.toolStripSeparator6,
             this.tc,
             this.toolStripSeparator3,
@@ -156,6 +162,34 @@
             this.Tool.Stretch = true;
             this.Tool.TabIndex = 16;
             this.Tool.Text = "toolStrip1";
+            // 
+            // toolStripDropDownButton1
+            // 
+            this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.eXCELToolStripMenuItem,
+            this.cSVToolStripMenuItem});
+            this.toolStripDropDownButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton1.Image")));
+            this.toolStripDropDownButton1.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
+            this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
+            this.toolStripDropDownButton1.Name = "toolStripDropDownButton1";
+            this.toolStripDropDownButton1.Size = new System.Drawing.Size(45, 47);
+            this.toolStripDropDownButton1.Text = "寮曞嚭";
+            this.toolStripDropDownButton1.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
+            this.toolStripDropDownButton1.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
+            // 
+            // eXCELToolStripMenuItem
+            // 
+            this.eXCELToolStripMenuItem.Name = "eXCELToolStripMenuItem";
+            this.eXCELToolStripMenuItem.Size = new System.Drawing.Size(112, 22);
+            this.eXCELToolStripMenuItem.Text = "EXCEL";
+            this.eXCELToolStripMenuItem.Click += new System.EventHandler(this.eXCELToolStripMenuItem_Click);
+            // 
+            // cSVToolStripMenuItem
+            // 
+            this.cSVToolStripMenuItem.Name = "cSVToolStripMenuItem";
+            this.cSVToolStripMenuItem.Size = new System.Drawing.Size(112, 22);
+            this.cSVToolStripMenuItem.Text = "CSV";
+            this.cSVToolStripMenuItem.Click += new System.EventHandler(this.cSVToolStripMenuItem_Click);
             // 
             // dy
             // 
@@ -388,33 +422,38 @@
             this.grdPrint.TabIndex = 8;
             this.grdPrint.Visible = false;
             // 
-            // toolStripDropDownButton1
+            // bdBarCode_Pack
             // 
-            this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.eXCELToolStripMenuItem,
-            this.cSVToolStripMenuItem});
-            this.toolStripDropDownButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton1.Image")));
-            this.toolStripDropDownButton1.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
-            this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
-            this.toolStripDropDownButton1.Name = "toolStripDropDownButton1";
-            this.toolStripDropDownButton1.Size = new System.Drawing.Size(45, 47);
-            this.toolStripDropDownButton1.Text = "寮曞嚭";
-            this.toolStripDropDownButton1.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
-            this.toolStripDropDownButton1.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
+            this.bdBarCode_Pack.AutoSize = false;
+            this.bdBarCode_Pack.Image = ((System.Drawing.Image)(resources.GetObject("bdBarCode_Pack.Image")));
+            this.bdBarCode_Pack.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
+            this.bdBarCode_Pack.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
+            this.bdBarCode_Pack.ImageTransparentColor = System.Drawing.Color.White;
+            this.bdBarCode_Pack.Name = "bdBarCode_Pack";
+            this.bdBarCode_Pack.Size = new System.Drawing.Size(70, 47);
+            this.bdBarCode_Pack.Text = "缁戝畾鎵樻潯鐮�";
+            this.bdBarCode_Pack.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
+            this.bdBarCode_Pack.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
+            this.bdBarCode_Pack.Click += new System.EventHandler(this.bdBarCode_Pack_Click);
             // 
-            // eXCELToolStripMenuItem
+            // jbBarCode_Pack
             // 
-            this.eXCELToolStripMenuItem.Name = "eXCELToolStripMenuItem";
-            this.eXCELToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
-            this.eXCELToolStripMenuItem.Text = "EXCEL";
-            this.eXCELToolStripMenuItem.Click += new System.EventHandler(this.eXCELToolStripMenuItem_Click);
+            this.jbBarCode_Pack.AutoSize = false;
+            this.jbBarCode_Pack.Image = ((System.Drawing.Image)(resources.GetObject("jbBarCode_Pack.Image")));
+            this.jbBarCode_Pack.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
+            this.jbBarCode_Pack.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
+            this.jbBarCode_Pack.ImageTransparentColor = System.Drawing.Color.Magenta;
+            this.jbBarCode_Pack.Name = "jbBarCode_Pack";
+            this.jbBarCode_Pack.Size = new System.Drawing.Size(70, 47);
+            this.jbBarCode_Pack.Text = "瑙g粦鎵樻潯鐮�";
+            this.jbBarCode_Pack.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
+            this.jbBarCode_Pack.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
+            this.jbBarCode_Pack.Click += new System.EventHandler(this.jbBarCode_Pack_Click);
             // 
-            // cSVToolStripMenuItem
+            // toolStripSeparator4
             // 
-            this.cSVToolStripMenuItem.Name = "cSVToolStripMenuItem";
-            this.cSVToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
-            this.cSVToolStripMenuItem.Text = "CSV";
-            this.cSVToolStripMenuItem.Click += new System.EventHandler(this.cSVToolStripMenuItem_Click);
+            this.toolStripSeparator4.Name = "toolStripSeparator4";
+            this.toolStripSeparator4.Size = new System.Drawing.Size(6, 50);
             // 
             // Gy_BarCodeBillList
             // 
@@ -475,5 +514,8 @@
         private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton1;
         private System.Windows.Forms.ToolStripMenuItem eXCELToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem cSVToolStripMenuItem;
+        private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
+        private System.Windows.Forms.ToolStripButton bdBarCode_Pack;
+        private System.Windows.Forms.ToolStripButton jbBarCode_Pack;
     }
 }
\ No newline at end of file
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBillList.resx" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBillList.resx"
index b4b5f1e..2f86434 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBillList.resx"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBillList.resx"
@@ -4029,6 +4029,30 @@
         8iQ1XvVn58xU1WnxG1zAJmn61pmIPgBiIY95z/CSIgAAAABJRU5ErkJggg==
 </value>
   </data>
+  <data name="bdBarCode_Pack.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAG3SURBVDhPfVLdK0NhHH5LSXGn/QculCsfUbtRLl1JbhQh
+        taxNNPnOolY+yhjjQo12oRQ3bhWiZGULF3Kv5Nucbeacs4/HeX/HnJ289tRT7+/5/Z7nfc+vw+bXgvD4
+        NuFZDojpC2DOvwX/1i6YCDPeDXEjDyu+C5oRhrgX1knMZrMQkfe83vNf45+QydlVEtKZDETkvaWlkMlk
+        Chn3LFOhptIQMQsgsHmElvYetHXYcHB4YgpjIzOLJMhKCiIqagoZLUVKJPEWlWg2UlOKs3KmB7ncC3RI
+        yioKMfc5Zc4IkhUMCAOXVgvY4OQsNeJJBYl/qKYM8/ZtQr9QCwlZtFf0j3lI+PiUIQmoaHvg/RJ7mMzX
+        KlDtv6NXUIBjeJoG3mNfiMbNlFXdXGy/MplZAGB1QeqxPtcUHV4lbUkxg7K2PK4XOW7+N3PYBiaoeI5+
+        4uXDINdWu1hhM0evc5SEx7c4nt4TRL51rvEAXLT+MR+fGn8m67YPUXH/IuH+NUbkNZnVB0C5opD8m3Me
+        QndfXpGHXECnlRF/ZILJ09zWhaqGJlTVG+R6ZW0jeAgNadjZ29f72iz36Cpj3yFNGCz1c9N0AAAAAElF
+        TkSuQmCC
+</value>
+  </data>
+  <data name="jbBarCode_Pack.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADSSURBVDhPlZPRDYQgEERpxgaswlCGv/ZBSXwbC6AAC7AA
+        G9hj1huCuMS7SUYi8l4IqhvHUf5tHRWc59ntcRy3dgXrusq2baUppUf3fe8L3mD0J0EPZLsCC0Sdcw8B
+        5hgV4HBaEIt14bIUCYUyTUViCmpYhqFICLM61wq41YcEbeDbDmqwbpEYMKICC0QhRhUwYMQUEGxhS6KC
+        EIJ472We51dYm8+DEr1Cgm8BkhijCeNe575vhZJLk8OdQMCvkhKM+FfwjBIdc4oAgaQtFlpzV0Q+Xg/P
+        E8pc2+4AAAAASUVORK5CYII=
+</value>
+  </data>
   <data name="tc.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8

--
Gitblit v1.9.1