-- 作者:even0898
-- 发布时间:2012/12/10 16:58:00
--
那应该不是这里的问题,下面的代码是我自定义登录窗口“确定”的代码
我中途要切换用户无法完成是怎么回事?我查了下系统命令里没有重新载入的命令呀。。
Dim UserName As String = e.Form.Controls("用户名").Value Dim cmd As New SQLCommand Dim dt As DataTable Dim dr As DataRow cmd.C If UserName = "" Then Messagebox.show("请选择用户!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information) Return End If cmd.CommandText = "Select * From {用户管理} Where [用户名] = \'" & UserName & "\'" 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("密码").Value = dr("密码") Then _UserName = UserName _UserGroup = dr("用户分组") _UserDep = dr("部门") e.Form.Close Else Messagebox.show("密码错误!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information) End If
Dim xt As RibbonMenu.Button xt = ConfigBar.Items("设计系统登录") If _UserGroup <> "开发者" TableCaptionVisible = False xt.Visible = False End If Forms("系统主窗口").Open() Dim tl1 As WinForm.TopicLink tl1 = Forms("系统主窗口").Controls("TopicBar1").pages("用户管理").links("用户设置") If _UserGroup <> "开发者" AndAlso _UserGroup <> "系统管理员" tl1.Visible = False End If
|