Dim drs As List (of DataRow) = DataTables("机具进货").Select("机具编号 = '" & e.DataRow("机具编号") & "' ")
If drs.Count > 0 Then
Dim result As DialogResult = MessageBox.Show("此机具已被机具进货录入,是否删除对应机具进货明细后再删除本条机具?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question)
If result = dialogresult.no Then
e.Cancel = True
Else
e.Cancel = True
Forms("机具订单").show
Dim filter As String = ""
For Each dr As DataRow In drs
filter &= " 进货批次= '" & dr("进货批次") & "'"
Next
Tables("机具订单").Filter = filter
此主题相关图片如下:4.png
Tables("机具订单").Sort = "进货日期 desc"
End If
ElseIf drs.Count = 0 Then
If MessageBox.Show("是否删除本条机具?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question) = DialogResult.yes Then
Else
e.Cancel = True
End If
End If