Select Case e.DataCol.Name
Case "姓名"
If e.NewValue > "" Then
Dim dr, dr1 As DataRow
dr1 = DataTables("分摊目录").Find("[百度禁止分摊] = '" & e.DataRow("姓名") & "'")
If dr1 IsNot Nothing Then
e.DataRow("费用") = 1
Else
e.DataRow("费用") = Nothing
End If
If e.DataRow.IsNull("日期") = False Then
dr = DataTables("分摊目录").Find("[姓名] = '" & e.DataRow("姓名") & "' and [日期]=#" & e.DataRow("日期") & "#")
If dr IsNot Nothing Then
e.DataRow("离四") =1
Else
e.DataRow("离四") = Nothing
End If
End If
Else
e.DataRow("费用") = Nothing
End If
Case "日期"
If e.DataRow.IsNull("日期") = False Then
Dim dr, dr1 As DataRow
dr = DataTables("分摊目录").Find("[姓名] = '" & e.DataRow("姓名") & "' and [日期]=#" & e.DataRow("日期") & "#")
If dr IsNot Nothing Then
e.DataRow("离四") =1
Else
e.DataRow("离四") = Nothing
End If
Dim gd,gd1,gd2,gd3,gd4,gd5,gd6 As Double
gd = DataTables("商务通参与邀请").Compute("Sum(费用)","[日期] = '" & e.NewValue & "'" )
gd1 = DataTables("商务通参与邀请").Compute("Sum(离四)","[日期] = '" & e.NewValue & "'" )
gd2 = DataTables("网站消费").Compute("Sum(点击)","[日期] = '" & e.NewValue & "'")
gd3 = DataTables("网站消费").Compute("Sum(消费)","[日期] = '" & e.NewValue & "'")
gd4 = DataTables("离线宝").Compute("Sum(非重复数量)","[开始时间] = '" & e.NewValue & "'")
gd5 = DataTables("四零零").Compute("Sum(非重复数量)","[开始时间] = '" & e.NewValue & "'")
If e.DataRow.Isnull("费用") Then
e.DataRow("点击") = Nothing
e.DataRow("消费") = Nothing
Else
e.DataRow("点击") = gd2/gd
e.DataRow("消费") = gd3/gd
End If
If e.DataRow.Isnull("离四") Then
e.DataRow("离线宝") = Nothing
e.DataRow("电话400") = Nothing
Else
e.DataRow("离线宝") = gd4/gd1
e.DataRow("电话400") = gd5/gd1
End If
Else
e.DataRow("离线宝") =Nothing
e.DataRow("电话400")= Nothing
e.DataRow("点击")= Nothing
e.DataRow("消费")= Nothing
e.DataRow("费用")= Nothing
e.DataRow("离四")= Nothing
End If
End Select
Dim idx As Integer = Tables("商务通参与邀请").FindRow(e.DataRow)
If idx = Tables("商务通参与邀请").rows.count-1 Then
DataTables("商务通参与邀请").addnew
End If
[此贴子已经被作者于2017/2/24 22:29:13编辑过]