Dim dr As DataRow = e.DataRow
Select Case e.DataCol.Name
Case "合同金额","收款金额","收付类别"
If e.DataRow("收付类别") = "付款合同" Then
dr("应收未收") = dr("收款金额") * 0
Else
dr("应收未收") = dr("收款金额")-dr("合同金额")
End If
End Select
Select Case e.DataCol.Name
Case "合同金额","收款金额","付款金额"
dr("收款进度") = dr("收款金额") / dr("合同金额")
dr("付款进度") = dr("付款金额") / dr("合同金额")
End Select
或者
Dim dr As DataRow = e.DataRow
Select Case e.DataCol.Name
Case "合同金额","收款金额","收付类别"
If e.DataRow("收付类别") = "付款合同" Then
dr("应收未收") = dr("收款金额") * 0
Else
dr("应收未收") = dr("收款金额")-dr("合同金额")
End If
dr("收款进度") = dr("收款金额") / dr("合同金额")
dr("付款进度") = dr("付款金额") / dr("合同金额")
End Select