Foxtable(狐表)用户栏目专家坐堂 → 编号


  共有2337人关注过本帖树形打印复制链接

主题:编号

帅哥哟,离线,有人找我吗?
有点甜
  11楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/8/16 14:29:00 [只看该作者]


 回到顶部
帅哥哟,离线,有人找我吗?
yetle
  12楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:858 积分:6381 威望:0 精华:0 注册:2017/2/13 9:04:00
  发帖心情 Post By:2018/8/16 14:44:00 [只看该作者]

必须要同步更新才可以的,那我做这个表就失去意义了,有没有别的方式?

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  13楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/8/16 15:00:00 [只看该作者]

Dim Result As DialogResult


Result = MessageBox.Show("确认要新增版本吗?","提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.Yes  Then
    Dim r As Row = Tables("报价单").Current
    Dim dnew As Row = Tables("报价单").AddNew
    Dim name As String = r("订单编号")
    Dim max As String
    Dim idx As Integer
   
    max = Tables("报价单").Compute("Max(订单编号)","订单编号 like '" & name.replace("*", "[*]") & "%' and [_Identify] <> " & r("_Identify"))
    If max > "" AndAlso max.Contains("*") Then '如果存在最大编号
        Dim ary = max.split("*")
        idx = CInt(ary(ary.length-1)) + 1 '获得最大编号的后三位顺序号,并加1
    Else
        idx = 1 '否则顺序号等于1
    End If
    For Each c As Col In Tables("报价单").Cols
        If c.Name = "订单编号" Then
           
        ElseIf c.Name <> "_Identify" AndAlso c.name <> "业务跟单"  Then
            dnew(c.Name) = r(c.Name)
        End If
       
    Next
    Dim drs As List(Of DataRow)
    drs = r.DataRow.GetChildRows("报价明细")
    dnew("订单编号") = name & "*" & Format(idx,"000")
    For Each dr As DataRow In drs
        Dim rc = dr.Clone
        rc("订单编号") = dnew("订单编号")
        'Dim ndr As DataRow = DataTables("报价明细").addnew
        'For Each c As Col In Tables("报价明细").Cols
        'If c.Name = "订单编号" Then
        'ndr("订单编号") = dnew("订单编号")
        'ElseIf c.Name <> "_Identify" AndAlso c.name <> "业务跟单"  Then
        'ndr(c.Name) = dr(c.Name)
        'End If
        'Next
    Next
End If


 回到顶部
总数 13 上一页 1 2