我采用自定义登录界面,下面红色代码不起作,如何调整?
LoadUserSetting事件:
'菜单管理
If _UserGroup = "财务部" OrElse User.Type = UserTypeEnum.Developer Then
RibbonTabs("工资社保管理").Visible = True
RibbonTabs("人事管理").Visible = True
RibbonTabs("账务管理").Visible = True
Else
RibbonTabs("工资社保管理").Visible = False
RibbonTabs("人事管理").Visible = False
RibbonTabs("账务管理").Visible = False
End If
登录窗口中“确定”按钮代码:
Dim UserName As String = e.Form.Controls("cmbox_Name").Value
Dim cmd As New SQLCommand
Dim dt As DataTable
Dim dr As DataRow
cmd.ConnectionName = V
If UserName = "" Then
Messagebox.show("请选择用户!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
cmd.CommandText = "Select * Fro m {Users1} Where [Name] = '" & UserName & "' And 启用 = 1"
dt = cmd.ExecuteReader
If dt.DataRows.Count = 0 Then
Messagebox.show("此用户不存在!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
dr = dt.DataRows(0)
If e.Form.Controls("txt_Password").Value = dr("Password") Then
_UserName = UserName
_UserGroup = dr("Group")
SaveConfigValue("Savepsw",IIF(e.Form.Controls("chbox1").Checked,1,0) & "|" & UserName & "|" & dr("Password"))
Forms("默认").Open
e.Form.Close
Else
Messagebox.show("密码错误!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.Form.Controls("txt_Password").Select()
e.Form.Controls("txt_Password").Value = Nothing
End If
[此贴子已经被作者于2019/5/30 15:58:57编辑过]