zzr99
2022-01-20 44d8a4fbe4abfbf82376a49ae7d07eda5c9cd374
WarM/²Ö¿â¹ÜÀí/Gy_BarCodeBill_ChaiMa.cs
@@ -149,7 +149,7 @@
                }
                else
                {
                    return false;
                    return true;
                }
            }
            return true;
@@ -170,13 +170,13 @@
                //判断会计期是否合理
                string HBillNo = txtHBillNo.Text;
                DataSet Ds;
                double sum = 0;
                SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                Ds = oCn.RunProcReturn("select top 1* from h_v_Gy_BarCodeBill_ChaiMa where æ¡ç ç¼–号='" + HBillNo + "'", "h_v_Gy_BarCodeBill_ChaiMa");
                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++)
                {
                    if (ClsPub.isLong(grdMain_Pay.Rows[i].Cells[HSnoCol2].Value) != 0)
                    {
                        Model.ClsGy_BarCodeEdit_Model model = new Model.ClsGy_BarCodeEdit_Model();
                        //固定赋值========================================
                        model.HEntryID = i + 1;
@@ -198,7 +198,6 @@
                        model.HSourceBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceBillNo"].ToString());
                        model.HSourceBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceBillType"].ToString());
                        model.HUseFlag = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HUseFlag"].ToString());
                        model.HStopflag = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HStopflag"].ToString());
                        model.HInitQty = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HInitQty"].ToString());
                        model.HSourceID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInitQty"].ToString());
                        model.HCusID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCusID"].ToString());
@@ -211,17 +210,28 @@
                        model.HMakeDate = DateTime.Now;
                        model.HMaker = ClsPub.CurUserName;
                        if (model.HPieceQty <= 0 || model.HPieceQty.ToString() == "")
                        if (model.HQty <= 0 || model.HQty.ToString() == "")
                        {
                            MessageBox.Show("第" + ClsPub.isStrNull(i + 1) + "行,拆分数量必须大于0!");
                            MessageBox.Show("页2第" + ClsPub.isStrNull(i + 1) + "行,拆分数量必须大于0!");
                            return false;
                        }
                        sum += model.HQty;
                        BillNew.DetailColl_Mater.Add(model);
                    }
                    else
                    {
                        break;
                }
                }
                if (sum > DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells[HQty].Value))
                {
                     MessageBox.Show("页2拆分数量之和必须小于条码数量!");
                    return false;
                }
                else
                {
                //保存
                bResult = BillNew.AddBill(ref ClsPub.sExeReturnInfo);
                    bResult = BillNew.AddBill(ref ClsPub.sExeReturnInfo, HBillNo);
                //提示
                if (bResult == true)
                {
@@ -233,11 +243,7 @@
                    MessageBox.Show("保存失败!原因:" + ClsPub.sExeReturnInfo, "提示");
                    return false;
                }
            //}
            //else
            //{
            //    return false;
            //}
                }
        }
        //确定按钮
        private void button1_Click(object sender, EventArgs e)