vb winform限制button添加判断的问题

图片说明![图片说明](https://img-ask.csdn.net/upload/201![![![图片说明](https://img-ask.csdn.net/upload/201612/16/1481857663_724563.png)图片说明](https://img-ask.csdn.net/upload/201612/16/1481857646_543160.jpg)图片说明](https://img-ask.csdn.net/upload/201612/16/1481857630_511961.png)612/16/1481857614_688698.png)图片说明
需求描述如下:对有单无货货单设置限制,使其在库存件数为0时候无法A添加和全部添加(即DataGrideView第3列库存件数为0)
邮件提货处理A添加button控件代码如下:
Private Sub Button_tj_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_tj.Click
Dim drow As Integer
drow = DataGrid1.CurrentRow.Index
If drow = -1 Then
Exit Sub
End If
datasave(drow)
End Sub
邮件提货处理全部添加按钮控件代码如下:
Private Sub Button_qbtj_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_qbtj.Click
Dim dxh, drow As Integer
drow = DataGrid1.CurrentRow.Index
If drow = -1 Then
Exit Sub
End If
For dxh = 0 To ds_kc.Tables(0).Rows.Count - 1
drow = DataGrid1.CurrentRow.Index
datasave(drow)
Next
End Sub
航班成批提货处理A添加按钮控件代码如下:
Private Sub Button_tj_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_tj.Click
Dim drow As Integer
drow = DataGrid1.CurrentRow.Index
If drow = -1 Then
Exit Sub

    End If



    '检查一张提货单是否超过6票,因为一张发票只能开六票单
    If DataGrid2.Rows.Count <> 0 Then
        If ds_th.Tables(0).Rows.Count = 10 Then
            MsgBox("该出仓证已经有10票货物,请使用另一张!", MsgBoxStyle.Information, "信息窗口")
            Exit Sub
        End If
    End If
    datasave(drow)
End Sub
    航班成批提货处理全部添加按钮控件代码如下:
    Private Sub Button_qbtj_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_qbtj.Click
    Dim dxh, drow,  As Integer

    drow = DataGrid1.CurrentRow.Index

    If drow = -1 Then
        Exit Sub
    End If
    For dxh = 0 To ds_kc.Tables(0).Rows.Count - 1
        '检查一张提货单是否超过6票,因为一张发票只能开六票单
        If DataGrid2.Rows.Count <> 0 Then
            If ds_th.Tables(0).Rows.Count = 6 Then
                MsgBox("该提货单已经有6票货物,请使用另一张出仓证,因为一张发票开6票货单!", MsgBoxStyle.Information, "信息窗口")
                Exit Sub
            End If






        End If
        drow = DataGrid1.CurrentRow.Index
        datasave(drow)
    Next
End Sub

utton_tj_Click被定义了2次,将其中一个函数换名