If e.DataCol.Name = "赢单" AndAlso e.DataRow("赢单") = True Then
Dim dr As DataRow = DataTables("订单总表").Find("用户ID='" & e.DataRow("用户ID") & "'")
If dr Is Nothing 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表数据接收列
dr = DataTables("订单总表").AddNew
For i As Integer = 0 To nma.Length - 1
dr(nmb(i)) = e.DataRow(nma(i))
Next
dr.Save()
End If
'msgbox("新增成功")
Else
e.DataRow("阶段备注") = Nothing
msgbox("订单已存在")
End If
End If