yxj
2021-10-29 18a02e32f0af32b7a1b11ed8843bf0b89a85290d
WarM/ÌõÂë´òÓ¡/Gy_BarCodeBill.cs
@@ -2471,6 +2471,39 @@
            }
        }
        //批次按钮
        private void BatchNo_Click(object sender, EventArgs e)
        {
            bool b = false;
            for (int i = 0; i < grdMain.RowCount; i++)
            {
                long HMaterID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HMaterIDCol].Value);          // ç‰©æ–™å†…码
                string HBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HBatchNoCol].Value);     // æ‰¹å·
                if (HMaterID != 0)
                {
                    DataSet oDs = oCn.RunProcReturn("exec h_p_Gy_BarCodeBill_GetBatchNo " + HMaterID.ToString() + ",'" + HBatchNo + "','" + dtpHDate.Value.ToShortDateString()+ "','" + CampanyName+"'", "h_p_Gy_BarCodeBill_GetBatchNo");
                    //
                    if (oDs == null && oDs.Tables[0].Rows.Count == 0)
                    {
                        MessageBox.Show("生成批次失败!");
                        return;
                    }
                    else if (DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0][0]) == "1")
                    {
                        grdMain.Rows[i].Cells[HBatchNoCol].Value = DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["HBatchNo"]);
                        b = true;
                    }
                }
            }
            //明细表是否为零行
            if (b == false)
            {
                MessageBox.Show("没有需要生成批次的明细行!", "提示");
                return;
            }
        }