以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 每次点击一次按钮往“排单状态”表中插入一行记录 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=119303) |
-- 作者:yetle -- 发布时间:2018/5/22 14:36:00 -- 每次点击一次按钮往“排单状态”表中插入一行记录 每次点击一次按钮往“排单状态”表中插入一行记录,那么,当“排单状态”表中存在相同的订单号或物供号的时候,不插入一行新的,就在相同订单号或物供号的行的某列中写入新值,要怎么写? Dim Result As DialogResult Result = MessageBox.Show("确定要将选定的行所对应的款资料添加到已下单甘特图?","提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If Result = DialogResult.Yes Then Dim nma() As String = {"物供号","系列名","客款号","颜色"} \'A表数据来源列 Dim t As Table = Tables("dbscmx") Dim zt As Table = Tables("排单状态") For i As Integer = t.TopPosition To t.BottomPosition Dim dr As Row = t.rows(i) Dim r As Row = Tables("生产计划").addnew() Dim dz As Row = t.rows(i) Dim zj As Row = Tables("排单状态").addnew() Dim str As String = "" For n As Integer = 0 To nma.length -1 str &= dr(nma(n)) & "-" Next str &= t.Compute("sum(订单合计)", "厂号 = \'" & dr("厂号") & "\'") r("排产内容")= str zj("物供号")=dz("物供号") zj("订单号")=dz("订单号") zj("排产甘特图")="已排单" Next End If Tables("排单状态").Save() Tables("生产计划").Save() Forms("排产").show()
|
-- 作者:有点甜 -- 发布时间:2018/5/22 16:26:00 -- Dim zj As Row = Tables("排单状态").addnew()
改成
Dim zj As dataRow = DataTables("排单状态").Find("物供号=\'" & dz("物供号") & "\' and 订单号=\'" & dz("订单号") & "\'") If zj Is Nothing then zj = DataTables("排单状态").AddNew |