If e.DataRow("款项类别") <> "代理费" And e.DataRow("款项类别") <> "保险费" Then
If e.DataRow("付款金额") >= "30000" Then
If e.DataCol.Name = "供货方名称" OrElse e.DataCol.Name = "付款金额" Then
Dim nms()As String = {"供货方账号","供货方开户银行"}
If e.DataRow.isnull("供货方名称") Then
For Each nm As String In nms
e.DataRow(nm)= Nothing
Next
Else
Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.C
cmd.CommandText = "S ELECT DISTINCT 供货方名称,供货方账号,供货方开户银行 From {采购合同管理} where [供货方名称]= '" & e.DataRow("供货方名称") & "'"
dt = cmd.ExecuteReader()
If dt.datarows.count > 0 Then
Dim dr As DataRow = dt.datarows(0)
For Each nm As String In nms
e.DataRow(nm)= dr(nm)
Next
e.DataRow("是否签订采购合同") = True
Else
e.DataRow("供货方名称") = Nothing
e.DataRow("是否签订采购合同") = False
MessageBox.Show("该供应商还未签订供应合同,不能办理委托支付事宜!","提示",MessageBoxButtons.OK,MessageBoxIcon.None)
Return
End If
End If
End If
Else
Dim nmw()As String = {"供货方账号","供货方开户银行"}
Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.C
cmd.CommandText = "S ELECT DISTINCT 供货方名称,供货方账号,供货方开户银行 From {采购合同管理} where [供货方名称]= '" & e.DataRow("供货方名称") & "'"
dt = cmd.ExecuteReader()
If dt.datarows.count > 0 Then
Dim dr As DataRow = dt.datarows(0)
For Each nm As String In nmw
e.DataRow(nm)= dr(nm)
Next
e.DataRow("是否签订采购合同") = True
End If
End If
End If