For Each r As Row In Tables("快速添加组织机构_table1").GetCheckedRows
Dim nr As DataRow = DataTables("年度安全目标").Find("列7='" & r("列7") & "' and 列8='" & r("列8") & "' ") '其它列自行参考补充完整
If nr Is Nothing Then
nr = DataTables("年度安全目标").AddNew
nr("企业名称") = r("企业名称")
nr("部门设置") = r("部门设置")
nr("岗位设置") = r("岗位设置")
nr("第四层机构设置") = r("第四层机构设置")
nr("第五层机构设置") = r("第五层机构设置")
nr("第六层机构设置") = r("第六层机构设置")
End If
r.checked = FalseNext
Dim xz As winform.checkbox = e.Form.controls("checkbox1")
xz.checked = FalseDim tr As WinForm.TreeView = Forms("安全信息化系统主窗口").Controls("TreeView4")
tr.BuildTree("年度安全目标", "企业名称|部门设置|岗位设置|第四层机构设置|第五层机构设置|第六层机构设置")
tr.ExpandAll()
MessageBox.Show("已向《年度安全目标》表中成功添加了公司组织机构!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)