If e.Path = "logon.htm" '如果是通过登录页面访问,从PostValues即可中提取用户名和密码
If e.PostValues.ContainsKey("username") AndAlso e.PostValues.ContainsKey("password") AndAlso e.PostValues.ContainsKey("jigou") Then
UserName = e.PostValues("username")
Password = e.PostValues("password")
jigou = e.PostValues("jigou")
Dim cmdt As New SQLCommand
cmdt.C
Dim dttt As DataTable
CMDt.CommandText ="S el ect * Fro m 医院管理 Where 分院名称='" & jigou & "' And 链接 is not null"
dttt= cmdt.ExecuteReader
If dttt.DataRows.Count > 0 Then
If Connections.TryConnect(dttt.DataRows(0)("链接")) = True Then
DataTables.Unload("客户预约|客户管理|卡券销售")
Connections.Delete("服务器")
Connections.Add("服务器",dttt.DataRows(0)("链接"))
DataTables.load("客户预约|客户管理|卡券销售")
End If
Dim cmd3 As New SQLCommand
cmd3.C
Dim dt3 As DataTable
CMD3.CommandText ="S ele ct * Fro m 员工管理 Where 姓名 = '" & UserName.trim() & "' And 密码 ='" & Password & "' And 分院='" & jigou.trim() & "'"
dt3= cmd3.ExecuteReader
If dt3.DataRows.Count > 0 Then
MessageBox.Show(dt3.DataRows.Count)
Group = dt3.DataRows(0)("部门")
zy = dt3.DataRows(0)("总院")
fy = dt3.DataRows(0)("分院")
jigou = dt3.DataRows(0)("分院")
Verified = True
End If
Else
Return
End If
End If
End If
Verified = True 先为 true 然后又变回 false