Dim dt As DataTable=DataTables("表B") Dim dr As DataRow For Each dcs As DataCol In e.DataTable.DataCols dr=dt.find("[tblcolid]='"& dcs.name &"' and [tbltname]='"& e.DataTable.name &"'") If dr IsNot Nothing AndAlso e.DataRow.Isnull(dr("tblcolid"))=False Then '读取规则 MessageBox.Show(e.DataTable.find("[" & dr("tblcolid") & "] like '" & e.DataRow(dr("tblcolid")) & "%'" & " And [_Identify] <> " & e.DataRow("_Identify")) IsNot Nothing ) If e.DataTable.find("[" & dr("tblcolid") & "] like '" & e.DataRow(dr("tblcolid")) & "%'" & " And [_Identify] <> " & e.DataRow("_Identify")) IsNot Nothing Then MessageBox.Show(1) PopMessage("不是末级不能删除!","错误", PopIconEnum.Error, 5) e.Cancel = True 'Return Nothing MessageBox.Show(2) Exit For End If End If Next
|