If e.DataCol.Name = "赢单" Then
If e.DataRow("赢单") = True
----------------------------------------------
Dim Result As DialogResult
Result = MessageBox.Show("确认生成新的报价订单吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.Yes Then
e.DataRow("阶段备注") = "赢单客户"
e.DataRow("客户等级") = "赢单客户"
Dim fdr As DataRow = DataTables("订单总表").find("用户ID = '" & Tables("终端用户").current("用户ID") & "'")
If fdr Is Nothing Then
Dim dt1 As DataTable = DataTables("终端用户") '指定数据来源
Dim dt2 As DataTable = DataTables("订单总表")
Dim dr As DataRow = dt2.AddNew
dr("用户ID") = drs(0)("用户ID")
dr("用户姓名") = drs(0)("用户姓名")
dr("楼盘") = drs(0)("楼盘")
dr("单元房号") = drs(0)("单元房号")
systemready = False
For i As Integer = 1 To drs.Count - 1
Dim ndr As DataRow = dt2.AddNew
ndr("用户ID") = drs(i)("用户ID")
ndr("用户姓名") = drs(i)("用户姓名")
ndr("楼盘") = drs(i)("楼盘")
ndr("单元房号") = drs(i)("单元房号")
Next
systemready = True
'DataTables("终端用户").DeleteFor("选择 = true")
End If
DataTables("报价总表").Save()
msgbox("新增成功")
Else
msgbox("订单已存在")
End If
End If
---------------------------
Else
e.DataRow("阶段备注") = Nothing
End If
End If