老师,怎么这两段代码都只加载第一行而不是找到的符合条件的行?MessageBox.Show 还是执行了,就是后面的加载行没执行,用 loadfilter 也一样。
Dim drs As List(of DataRow) = DataTables("一类疫苗出库单").SQLSelect("出入库类型 = '3'")
For Each dr As DataRow In drs
If dr IsNot Nothing Then
Dim zs As List(of DataRow) = dr.GetChildRows("一类疫苗出库表")
If zs.Count <= 0 Then
MessageBox.Show("有出库单没有出库明细,请及时删除!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
DataTables("一类疫苗出库单").RemoveFor("_Identify = '" & dr("_Identify") & "'")
DataTables("一类疫苗出库单").AppendLoad("_Identify = '" & dr("_Identify") & "'")
return
End If
end if
next
Dim drs As List(of DataRow) = DataTables("一类疫苗出库单").SQLSelect("出入库类型 = '3' and 确认开单 = '" & True & "'")
For Each dr As DataRow In drs
If dr IsNot Nothing Then
For i As Integer = 0 To drs.Count - 1
Dim crs As List(of DataRow) = drs(i).GetChildRows("一类疫苗出库表")
If crs.Count <=0 Then
MessageBox.Show("有出库单没有明细,请删除或添加明细后新增!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
DataTables("一类疫苗出库单").RemoveFor("出库单编号 = '" & drs(i)("出库单编号") & "'")
DataTables("一类疫苗出库单").AppendLoad("出库单编号 = '" & drs(i)("出库单编号") & "'")
Return
End If
Next
End If
Next