Select Case e.DataCol.Name
Case "收入","支出"
Dim ddbh As String = e.DataRow("订单编号")
Dim sr As Double
Dim zc As Double
Dim ye As Double
sr = e.DataTable.SQLCompute("sum(收入)","[订单编号] = '" & ddbh & "'")
zc = e.DataTable.SQLCompute("sum(支出)","[订单编号] = '" & ddbh & "'")
ye = sr - zc
Dim ddlr As DataRow = DataTables("订单").Find("[订单编号] = '" & ddbh & "'")
If ddlr IsNot Nothing Then ddlr = DataTables("订单").SqlFind("[订单编号] = '" & ddbh & "'")
ddlr("利润") = ye
ddlr.Save
End Select