调试跟踪每一行代码执行的结果
msgbox("付款金额=" & e.DataRow("付款金额") )
If e.DataRow("付款金额") >= "30000" Then
msgbox("触发的列名=" & e.DataCol.Name )
If e.DataCol.Name = "供货方名称" OrElse e.DataCol.Name = "付款金额" Then
Dim nms()As String = {"供货方账号","供货方开户银行"}
msgbox("触发的列数据=" & e.NewValue )
If e.NewValue Is Nothing Then
For Each nm As String In nms
e.DataRow(nm)= Nothing
Next
Else
msgbox(其它调试自行写.....)
If e.DataRow("供货方名称") <> Nothing Then
Dim c md As New SQLCommand
msgbox(其它调试自行写....)
……
Else
Dim nmw()As String = {"供货方账号","供货方开户银行"}
Dim c md As New SQLCommand
Dim dt As DataTable
cmd.C
'cmd.C ommandText = "S ELECT DISTINCT 供货方名称,供货方账号,供货方开户银行 From {采购合同管理} where [供货方名称]= '" & e.NewValue & "'"
cmd.C ommandText = "S ELECT DISTINCT 项目名称,供货方名称,供货方账号,供货方开户银行 From {采购合同管理} where [供货方名称]= '" & e.NewValue & "' and [项目名称] = '" & e.DataRow("项目名称") & "'"
dt = cmd.ExecuteReader()
msgbox("dt.datarows.count=" & dt.datarows.count )
If dt.datarows.count > 0 Then
Dim dr As DataRow = dt.datarows(0)
For Each nm As String In nmw
msgbox("nm=" & nm & “,赋值=” & dr(nm))
e.DataRow(nm)= dr(nm)
Next
e.DataRow("是否签订采购合同") = True
End If
End If