Dim cmd As New SQLCommand
cmd.ConnectionName = DataSource
cmd.CommandText = "S ELECT * Fro m {用户管理} Where [_Identify] Is Null"
_UserTable = cmd.ExecuteReader(True)
Forms("登录窗口").Open()
If _UserName = "" Then
Syscmd.Project.Exit()
Return '这个要加上,因为既然要退出,就不应该再执行后面的初始化代码了,否则会出错
End If
'开启表关闭按钮
ShowCloseButton = True
'设置字体
Dim f As new Font("微软雅黑",9)
For Each tb As Table In Tables
Tables(tb.Name).Font = f
Next
basemainform.Controls("MainPages").Font = new Font("微软雅黑",9)
'设置顶端标题
BaseMainform.Text = "权限框架"
'加载菜单
Dim dr As DataRow
dr=DataTables("用户管理").SqlFind("用户名称='" & _UserName & "'")
If dr IsNot Nothing
If dr("功能组菜单")=True Then
Syscmd.Project.OpenUserMenu()
Functions.Execute("生成功能菜单")
Forms("首页").open
For Each c As Winform.Control In Forms("首页").Controls
c.Visible=False
Next
End If
If dr("导航栏菜单")=True Then
Forms("Log").open
Forms("导航目录树").OpenTo("首页")
Forms("首页").open
'关闭系统的菜单条
For Each r As Object In RibbonTabs
r.visible = True
Next
For Each c As Winform.Control In Forms("首页").Controls
c.Visible=False
Next
End If
If dr("ListView菜单")=True Then
Forms("Log").open
Forms("首页").open
'关闭系统的菜单条
For Each r As Object In RibbonTabs
r.visible = True
Next
End If
End If
'保证首页一直在第一位
Dim t As C1Command.C1DockingTab = BaseMainForm.Controls("MainPages")
Dim pg As C1Command.C1DockingTabPage = t.TabPages("首页")
If pg IsNot Nothing Then
t.TabPages.Insert(0,pg)
End If