代码放到《监理招标信息表》DataColChanged事件
Select Case e.DataCol.name
Case "审核"
Dim dr As DataRow = DataTables("监理投标资料汇总").Find("项目名称 = '" & e.DataRow("项目名称") & "'")
If e.NewValue <> "通过" Then
dr.Delete
Return
ElseIf dr Is Nothing
dr = DataTables("监理投标资料汇总").AddNew()
dr("项目名称") = e.DataRow("项目名称")
End If
dr("归属部门") = e.DataRow("归属部门")
dr("评标方式") = e.DataRow("评标方式")
dr("开标日期") = e.DataRow("开标日期")
Case "归属部门","评标方式","开标日期","项目名称"
If e.DataRow("审核") = "通过" Then
Dim name As String = iif(e.DataCol.name = "项目名称", e.OldValue ,e.DataRow("项目名称"))
Dim dr As DataRow = DataTables("监理投标资料汇总").Find("项目名称 = '" & name & "'")
If dr IsNot Nothing Then
dr(e.DataCol.Name) = e.NewValue
End If
End If
End Select