根据用户Id判断 如果存在就提示已存在,没有就执行复制
If e.DataCol.Name = "赢单" AndAlso e.DataRow("赢单") = True Then
Dim Result As DialogResult
Result = MessageBox.Show("确认生成新的报价订单吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.Yes Then
e.DataRow("阶段备注") = "赢单客户"
e.DataRow("客户等级") = "赢单客户"
Dim nma() As String = {"用户姓名","用户ID","楼盘","单元房号"} 'A表数据来源列
Dim nmb() As String = {"用户姓名","用户ID","楼盘","单元房号"} 'B表数据接收列
Dim dr As DataRow = DataTables("订单总表").AddNew
For i As Integer = 0 To nma.Length - 1
dr(nmb(i)) = e.DataRow(nma(i))
Next
End If
DataTables("订单总表").Save()
'msgbox("新增成功")
Else
e.DataRow("阶段备注") = Nothing
'msgbox("订单已存在")
End If
[此贴子已经被作者于2018/5/11 21:45:50编辑过]