yxj
2022-10-20 baead5c3807d798141313c62cf6e60d95029f08d
条码档案列表模块增加绑定、解绑托条码功能
3个文件已修改
243 ■■■■ 已修改文件
WarM/条码打印/Gy_BarCodeBillList.cs 127 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WarM/条码打印/Gy_BarCodeBillList.designer.cs 92 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WarM/条码打印/Gy_BarCodeBillList.resx 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WarM/ÌõÂë´òÓ¡/Gy_BarCodeBillList.cs
@@ -37,6 +37,7 @@
        public string PrintQtyCtl = "";         //条码打印次数控制
        public string UpdatePrintQtyCtl = "";   //条码打印次数更新
        public string SourceQtyCtl = "";        //超源单数量控制
        public string CampanyName = "";         //客户定制化名称
        #region  å›ºå®šä»£ç 
@@ -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  è§£ç»‘托条码
        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("解绑并删除托条码判断错误!");
                    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("解绑并删除托条码成功!", "提示");
                    Display();
                }
            }
        }
        #endregion
    }
WarM/ÌõÂë´òÓ¡/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 = "解绑托条码";
            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;
    }
}
WarM/ÌõÂë´òÓ¡/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