basemainform.text = "检测管理系统" '命名系统标题
If Syscmd.Project.Update(False,False) = False Then '如果没有升级
'用于自定义用户权限设置方面
Forms("用户登录").Open()
If _UserName = "" Then
Syscmd.Project.Exit()
Return
End If '关闭登录窗口
Forms("导航栏").Open
'快速访问栏处于选中状态,隐藏功能区
QAT("显示/隐藏菜单").Pressed = True
'隐藏表标题
If _username <> "管理员" Then
TableCaptionVisible = False
QAT("显示/隐藏菜单").Visible = False
Else
TableCaptionVisible = True
QAT("显示/隐藏菜单").Visible = True
End If
'导航栏节点数据导入授权表
Dim dhc As WinForm.TopicBar = Forms("导航栏").Controls("TopicBar1")
'导航页面目录树
For Each page As WinForm.TopicPage In dhc.Pages
Dim dr As DataRow = DataTables("用户_授权").Find("父节点 = '"& page.Name &"'")
If dr Is Nothing Then
dr = DataTables("用户_授权").AddNew
dr("父节点") = page.Name
End If
For Each link As WinForm.TopicLink In page.Links
Dim dr1 As DataRow = DataTables("用户_授权").Find("父节点 = '"& page.Name &"' And 子节点 = '"& link.Text &"'")
If dr1 Is Nothing Then
dr1 = DataTables("用户_授权").AddNew
dr1("父节点") = page.Name
dr1("子节点") = link.Text
End If
Next
Next
'删除空节点
For Each dr As DataRow In DataTables("用户_授权").Select("父节点 is null")
dr.Delete
Next
'导航栏授权
Dim dh As WinForm.TopicBar = Forms("导航栏").Controls("TopicBar1")
'隐藏导航目录树内容
For Each page2 As WinForm.TopicPage In dhc.Pages
page2.Visible = False
For Each link As WinForm.TopicLink In page2.Links
link.Visible = False
Next
Next
Dim jh1 As new List(of String)
For Each fz As DataRow In DataTables("用户_分组").Select("用户 like '*"& _UserName &"*'")
For Each fz1 As DataRow In DataTables("用户_授权").Select("分组 like '*"& fz("分组") &"*'")
For Each page1 As WinForm.TopicPage In dhc.Pages
If page1.Name = fz1("父节点") Then
page1.Visible = True
End If
For Each link1 As WinForm.TopicLink In page1.Links
If page1.Name = fz1("父节点") And link1.Name = fz1("子节点")
link1.Visible = True
End If
Next
Next
Next
Next
'隐藏功能区,程序菜单,状态栏
For Each r As RibbonMenu.Tab In RibbonTabs
r.Visible = False
Next
ApplicationMenu.visible = False
ConfigBar.Visible = False
'打开无损录入主界面
MainTable = Tables("主页")
Forms("背景").Open
'将表名汇总到表名称表里
For Each b As DataTable In DataTables
Dim dr As DataRow = DataTables("表名称").Find("表名= '"& b.Name &"'")
If dr Is Nothing Then
dr = DataTables("表名称").AddNew
dr("表名") = b.Name
End If
Next
'重置信息
DataTables("人员信息").DataCols("出生日期").RaiseDataColChanged()
DataTables("人员信息").DataCols("进入公司时间_报到日期").RaiseDataColChanged()
End If '升级
[此贴子已经被作者于2019/4/10 20:54:23编辑过]