Foxtable(狐表)用户栏目专家坐堂 → [求助] 两表集合数据同步问题


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

主题:[求助] 两表集合数据同步问题

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


加好友 发短信
等级:狐神 帖子:5015 积分:25363 威望:0 精华:0 注册:2015/8/18 9:21:00
  发帖心情 Post By:2016/8/30 9:11:00 [显示全部帖子]

'角色表click事件
If   e.Row.IsNull("加载范围集合") = False Then
    Dim s1arr() As String = e.Row("加载范围集合").Split(",")
    
    For Each s1 As String In s1arr
        Dim s2arr() As String = s1.Split("|")
        If s2arr.Length = 2 Then
            Dim dr As DataRow = DataTables("表A").Find("权限='" & s2arr(0) & "'")
            If dr IsNot Nothing Then
                dr("授权") = True
                dr("加载范围") = s2arr(1)
            End If
        End If
    Next
End If

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


加好友 发短信
等级:狐神 帖子:5015 积分:25363 威望:0 精华:0 注册:2015/8/18 9:21:00
  发帖心情 Post By:2016/8/30 11:56:00 [显示全部帖子]

保存按钮


Dim dr As Row = Tables("角色管理").Current
If dr Is Nothing Then Return

Dim drs As List(Of DataRow) = DataTables("授权").Select("权限 is not null and 加载范围 is not null")
If drs.Count > 0 Then
    Dim sqjh As String
    Dim fwjh As String
    For Each r As DataRow In drs
        sqjh &= "," & r("权限")
        fwjh &= "," & r("权限") & "|" & r("加载范围")
    Next
    dr("授权集合") = sqjh.TrimStart(",")
    dr("加载范围集合") = fwjh.TrimStart(",")
    Tables("角色管理").Current.Save() '保存当前行
    
End If
e.Form.Close()

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


加好友 发短信
等级:狐神 帖子:5015 积分:25363 威望:0 精华:0 注册:2015/8/18 9:21:00
  发帖心情 Post By:2016/8/30 11:59:00 [显示全部帖子]

清空列参考:http://www.foxtable.com/webhelp/scr/1532.htm

e.Table.DataTable.ReplaceFor("加载范围",Nothing)

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


加好友 发短信
等级:狐神 帖子:5015 积分:25363 威望:0 精华:0 注册:2015/8/18 9:21:00
  发帖心情 Post By:2016/8/30 14:40:00 [显示全部帖子]

Dim drs1 As List(Of DataRow) = DataTables("授权").Select("权限 = true")

 回到顶部