Foxtable(狐表)用户栏目专家坐堂 → [求助]菜单中项目已经删除干净如何把功能组也删除?


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

主题:[求助]菜单中项目已经删除干净如何把功能组也删除?

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


加好友 发短信
等级:八尾狐 帖子:1964 积分:15604 威望:0 精华:0 注册:2011/7/16 20:59:00
[求助]菜单中项目已经删除干净如何把功能组也删除?  发帖心情 Post By:2018/5/24 19:39:00 [只看该作者]


此主题相关图片如下:qq截图20180524193226.jpg
按此在新窗口浏览图片

 

问题如标题。

 

 

在主菜单的系统事件的Load事件

Dim zc As String=Nothing

If _username="超级用户" Then
    zc="" 'Else
    Dim js() As String=_userrule.split(",")
   
   
    For Each  x As String In js
        If zc=Nothing Then
            zc="角色名称='" & x & "'"
        Else
            zc=zc & " Or 角色名称='" & x & "'"
        End If
    Next
End If

Dim r  As DataRow
Dim rt As  RibbonMenu.Tab
Dim rt1 As  RibbonMenu.Tab
'---------------------------------------------------------
For Each a1 As RibbonMenu.Tab In RibbonTabs
    For Each a2 As RibbonMenu.group In a1.Groups
        For Each a3 As  RibbonMenu.RibbonItem  In  a2.Items '  ToolBars
            'If a3.name.Contains("退出")=True Or a3.name.Contains("标准按钮")=True Then  Continue For
            If zc="" Then
                r=DataTables("角色").sqlfind("功能区='" & a1.name & "' And 菜单分类='" & a2.name & "' And 模块名称='" & a3.name & "'")
               
            Else
                r=DataTables("角色").sqlfind("功能区='" & a1.name & "' And 菜单分类='" & a2.name & "' And 模块名称='" & a3.name & "' And " & zc)
            End If
            If r Is Nothing Then
                a3.Visible=False
            End If
        Next
        '  If a2.Items.Count =0 Then a2.Visible =False
        '''
    Next
Next


 


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


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


For Each a1 As RibbonMenu.Tab In RibbonTabs
    Dim count1 As Integer = 0
    For Each a2 As RibbonMenu.group In a1.Groups
        Dim count2 As Integer = 0
        For Each a3 As  RibbonMenu.RibbonItem  In  a2.Items '  ToolBars
            'If a3.name.Contains("退出")=True Or a3.name.Contains("标准按钮")=True Then  Continue For
            If zc="" Then
                r=DataTables("角色").sqlfind("功能区='" & a1.name & "' And 菜单分类='" & a2.name & "' And 模块名称='" & a3.name & "'")
               
            Else
                r=DataTables("角色").sqlfind("功能区='" & a1.name & "' And 菜单分类='" & a2.name & "' And 模块名称='" & a3.name & "' And " & zc)
            End If
            If r Is Nothing Then
                a3.Visible=False
            Else
                a3.Visible=True
                count2 += 1
            End If
        Next
        If count2 = 0 Then
            a2.Visible = False
        Else
            a2.Visible=True
            count1 += 1
        End If
    Next
    If count1 = 0 Then
        a1.Visible = False
    else
        a1.Visible=true
    End If
Next

 回到顶部