杨乐
2022-02-07 25849768b45e51a2f5ac0bd4df7bb98b24da9cd7
WarM/²Ö¿â¹ÜÀí/Gy_BarCodeBill_ChaiMa.cs
@@ -8,7 +8,7 @@
using System.Text;
using System.Windows.Forms;
namespace WarM.仓库管理
namespace WarM
{
    public partial class Gy_BarCodeBill_ChaiMa : Form
    {
@@ -61,7 +61,24 @@
            oSumGrid_Pay.NoCol = HSnoCol2;
        }
       #region çª—体处理方法
        #region çª—体处理方法
        //初始化页签1数据
        private void intoDate()
        {
            try
            {
                DataSet Ds;
                SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                Ds = oCn.RunProcReturn("select * from h_v_Gy_BarCodeBill_ChaiMa", "h_v_Gy_BarCodeBill_ChaiMa");
                grdMain.DataSource = Ds.Tables[0].DefaultView;
            }
            catch (Exception ex )
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
        //初始化页签1
        private void initGrid()
@@ -82,10 +99,8 @@
            ////隐藏列
            grdMain.Columns[HTagCol].Visible = false;
            grdMain.Columns[HInterID].Visible = false;
            //设置可编辑列
            string sAllowCol = HNum.ToString();
            //设置合计列
            string sTotalCol = HTagCol.ToString() + "0";
            //intoDate();
            //格式化网格
            //DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol, oSumGrid_Mater);
        }
@@ -134,26 +149,26 @@
            Sub_ClearBill();
        }
        //数据验证
        private bool Sub_AllowSave()
        {
            for (int i = 0; i <= grdMain_Pay.RowCount - 1; i++)
            {
                if (ClsPub.isLong(grdMain_Pay.Rows[i].Cells[HSnoCol2].Value) != 0)
                {
                    if (ClsPub.isStrNull(grdMain_Pay.Rows[i].Cells[HNum2].Value) ==null)
                    {
                        MessageBox.Show("请将表格拆分数量填写完整", "提示");
                        return false;
                    }
                }
                else
                {
                    return true;
                }
            }
            return true;
        }
        ////数据验证
        //private bool Sub_AllowSave()
        //{
        //    for (int i = 0; i <= grdMain_Pay.RowCount - 1; i++)
        //    {
        //        if (ClsPub.isLong(grdMain_Pay.Rows[i].Cells[HSnoCol2].Value) != 0)
        //        {
        //            if (ClsPub.isStrNull(grdMain_Pay.Rows[i].Cells[HNum2].Value) ==null)
        //            {
        //                MessageBox.Show("请将表格拆分数量填写完整", "提示");
        //                return false;
        //            }
        //        }
        //        else
        //        {
        //            return true;
        //        }
        //    }
        //    return true;
        //}
        
        //生成按钮
        private void xz_Click(object sender, EventArgs e)
@@ -170,7 +185,7 @@
                //判断会计期是否合理
                string HBillNo = txtHBillNo.Text;
                DataSet Ds;
                double sum = 0;
                double sum = 0.00000000;
                SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                Ds = oCn.RunProcReturn("select top 1* from Gy_BarCodeBill where HBarCode='" + HBillNo + "'", "h_v_Gy_BarCodeBill_ChaiMa");
                for (i = 0; i <= grdMain_Pay.RowCount - 1; i++)
@@ -223,7 +238,7 @@
                        break;
                    }
                }
                if (sum > DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells[HQty].Value))
                if (sum > DBUtility.ClsPub.isDoule(grdMain.Rows[0].Cells[HQty].Value))
                {
                     MessageBox.Show("页2拆分数量之和必须小于条码数量!");
                    return false;