Select Case e.DataCol.Name
Case "姓名","电话","预约消费时间"
Dim dr As DataRow = e.DataRow
Dim pr As DataRow
If dr.IsNull("姓名") OrElse dr.IsNull("电话") Then
dr("预约时间") = Nothing
Else
Dim filter As String
filter = "姓名 = '" & dr("姓名") & "' And 电话 = '" & dr("电话") & "'"
pr = DataTables("表A").Find(filter)
If pr IsNot Nothing Then
dr("预约时间") = pr("最后一次消费")
Else
pr = DataTables("表A").Addnew()
pr("姓名") = dr("姓名")
pr("电话") = dr("电话")
pr("登记时间") = dr("预约时间")
'...
End If
End If
End Select
[此贴子已经被作者于2013-5-3 11:08:57编辑过]