Foxtable(狐表)用户栏目专家坐堂 → [求助]跨表引用


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

主题:[求助]跨表引用

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/6/7 17:15:00 [显示全部帖子]

'''
Dim str As String = "(2018)鲁01行初330、333、356-358、赔初10-12号"
Dim mc = System.Text.RegularExpressions.Regex.Matches(str, "(\([0-9]+\)[鲁0-9]+)|(行初[0-9\-]+)|(赔初[0-9\-]+)|([0-9\-]+)")
Dim qz As String = ""
Dim lx As String = ""
For i As Integer = 0 To mc.count-1
    Dim s As String = mc(i).value
    msgbox(s)
    If i = 0 Then
        qz = s
    Else
        If s.StartsWith("行初") Then
            lx = "行初"
            s = s.replace("行初", "")
        ElseIf s.StartsWith("赔初") Then
            lx = "赔初"
            s = s.replace("赔初", "")
        End If
        Dim ii = 0
        Dim jj = 0
        If s.Indexof("-") >= 0 Then
            ii = s.split("-")(0)
            jj = s.split("-")(1)
        Else
            ii = s
            jj = s
        End If
        For k As Integer = ii To jj
            msgbox(qz & lx & k & "号")
        Next
    End If
Next

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/6/7 22:12:00 [显示全部帖子]

不明白你的意思。

 

你要做什么操作以后,得到什么效果?


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/6/7 22:52:00 [显示全部帖子]


If e.DataCol.Name = "邮寄" Then '如果内容发生变动的是品名列
    '’If e.NewValue Is Nothing Then '如果新值是空白,也就是品名列的内容为空
    'e.DataRow("邮寄清单") = Nothing '那么清空此行单价列的内容
    'Else
    Dim str As String = e.DataRow("案号")
    Dim drs = e.DataTable.Select("案号='" & str & "' and 邮寄 = true", "收寄日期")
    Dim mc = System.Text.RegularExpressions.Regex.Matches(str, "(\([0-9]+\)[鲁0-9]+)|(行初[0-9\-]+)|(赔初[0-9\-]+)|(行终[0-9\-]+)|([0-9\-]+)")
    Dim qz As String = ""
    Dim lx As String = ""
    For i As Integer = 0 To mc.count-1
        Dim s As String = mc(i).value
        'msgbox(s)
        If i = 0 Then
            qz = s
        Else
            If s.StartsWith("行初") Then
                lx = "行初"
                s = s.replace("行初", "")
            ElseIf s.StartsWith("赔初") Then
                lx = "行赔初"
                s = s.replace("赔初", "")
            ElseIf s.StartsWith("行终") Then
                lx = "行终"
                s = s.replace("行终", "")
            End If
            Dim ii = 0
            Dim jj = 0
            If s.Indexof("-") >= 0 Then
                ii = s.split("-")(0)
                jj = s.split("-")(1)
            Else
                ii = s
                jj = s
            End If
            For k As Integer = ii To jj
                'msgbox(qz & lx & k & "号")
                Dim dr1 As DataRow
                dr1 = DataTables("数据表").Find("[案号] = '" & qz & lx & k & "号" & "'")
                If dr1 IsNot Nothing Then '如果找到了同名的产品行,也就是dr不是Nothing
                    Dim ls As new List(of String)
                    For Each cdr As DataRow In drs
                        For Each l As String In cdr.lines("邮寄清单")
                            If ls.Contains(l) = False Then
                                ls.Add(l)
                            End If
                        Next
                    Next
                    dr1.lines("邮寄清单") = ls
                End If
            Next
        End If
    Next
End If

 回到顶部