以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  如何让授权表中用户分组与用户名连动?  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=140929)

--  作者:有点蓝
--  发布时间:2019/9/17 17:07:00
--  
If e.IsFocusCell Then \'如果是焦点所在单元格
    If e.Col.Name = "表名" Then \'如果正在编辑的是县市列
        Dim sz() As String = {"动态列表","Code","动态列表","动态列宽列显设置","Users","授权表"}
        Dim Listsz As new List (of String)
        Listsz.AddRange(sz)
        Dim ListTbName As String
        For Each tb  As Table In Tables
            If Listsz.Contains(tb.name) = False Then
                ListTbName = ListTbName & "|" & tb.name
            End If
        Next
        ListTbName = ListTbName.trim("|")
        e.Col.ComboList = ListTbName
    ElseIf e.Col.Name = "分组名" Then
        \'=======生成分组名列表=======
        Dim ListUserGroup As String
        For Each us  As UserInfo  In users
            ListUserGroup = ListUserGroup & "|" & us.Group
        Next
        ListUserGroup = ListUserGroup.trim("|")
        e.Col.ComboList = ListUserGroup
    ElseIf e.Col.Name = "用户名" Then
        If e.Row.IsNull("分组名") Then
            e.Col.ComboList = Nothing
        Else
             e.Col.ComboList = DataTables("Users").GetComboListString("Name","Type=2 and Config like \'%" & chr(11) & e.Row("分组名") & chr(11) & "%\'")
        End If
    End If
End If

--  作者:有点蓝
--  发布时间:2019/9/17 17:50:00
--  
prepareedit事件
--  作者:有点蓝
--  发布时间:2019/9/17 20:32:00
--  
For Each dr As DataRow In DataTables("授权表").Select("分组名 = \'" & User.Group & "\' and 表名 is not null" )