以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 重复判断 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=118839) |
-- 作者:yifan3429 -- 发布时间:2018/5/11 21:45:00 -- 重复判断 根据用户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编辑过]
|
-- 作者:有点蓝 -- 发布时间:2018/5/11 22:26:00 -- 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
|