终于到机房了,让我先哭一会,这个流程图看着简单,画着着实花费了一些时间,经过多次指导终于画出了第一章流程图,别看这一张小小的图也让我学习了不少的东西。
If Trim(txtName.Text = "") Then
MsgBox "没有这个用户, 请重新输入用户名!", vbOKOnly + vbExclamation, "警告"
txtName.SetFocus
Else
txtSQL = "select * from user_Info where userID ='" & txtName.Text & "'"
Set mrc = ExecuteSQL(txtSQL, msgtext)
If mrc.EOF Then
MsgBox "没有这个用户,请重新输入用户名!", vbOKOnly + vbExclamation, "警告"
txtName = ""
txtPassword = ""
txtName.SetFocus
Else
If Trim(mrc.Fields(2)) = Trim("一般用户") Then '一般用户的权限
If Trim(mrc.Fields(1)) = Trim(txtPassword.Text) Then '判断密码是否正确
txtSQL1 = "select * from OnWork_Info" '获取到正在上机表
Set mrc1 = ExecuteSQL(txtSQL1, msgtext1)
Me.Hide '本窗体隐藏
username = Trim(txtName.Text) '将用户名给username
frmmain.Show
frmmain.generaluser.Enabled = True
frmmain.operator.Enabled = False
frmmain.administrators.Enabled = False
mrc1.AddNew '添加更新到正在上机表里
mrc1.Fields(0) = Trim(username)
mrc1.Fields(1) = Trim(mrc.Fields(2))
mrc1.Fields(2) = Trim(Date)
mrc1.Fields(3) = Trim(Time)
'mrc1.Fields(4) = Trim(ComputerName)
mrc1.Update
mrc1.Close '关闭数据连接
frmmain.Show
Else
MsgBox "输入密码不正确,请重新输入!", vbOKOnly + vbExclamation, "警告"
txtPassword.SetFocus
txtPassword.Text = ""
End If
ElseIf Trim(mrc.Fields(2)) = Trim("操作员") Then '操作员的权限
If Trim(mrc.Fields(1)) = Trim(txtPassword.Text) Then '判断密码是否正确
txtSQL1 = "select * from OnWork_Info" '获取正在上机表
Set mrc1 = ExecuteSQL(txtSQL1, msgtext1)
Me.Hide
username = Trim(txtName.Text) '将用户名给username
frmmain.Show
frmmain.generaluser.Enabled = False
frmmain.operator.Enabled = True
frmmain.administrators.Enabled = False
mrc1.AddNew '添加更新到正在上机表离去
mrc1.Fields(0) = Trim(username)
mrc1.Fields(1) = Trim(mrc.Fields(2))
mrc1.Fields(2) = Trim(Date)
mrc1.Fields(3) = Trim(Time)
'mrc1.Fields(4) = Trim(ComputerName)
mrc1.Update
mrc1.Close '关闭数据连接
frmmain.Show
Else
MsgBox "输入密码不正确,请重新输入!", vbOKOnly + vbExclamation, "警告"
txtPassword.SetFocus
txtPassword.Text = ""
End If
ElseIf Trim(mrc.Fields(2)) = Trim("管理员") Then '管理员的权限
If Trim(mrc.Fields(1)) = Trim(txtPassword.Text) Then '判断密码是否正确
txtSQL1 = "select * from OnWork_Info" '获取到正在上机表
Set mrc1 = ExecuteSQL(txtSQL1, msgtext1)
Me.Hide
username = Trim(txtName.Text) '将用户名给username
frmmain.Show
frmmain.generaluser.Enabled = False
frmmain.operator.Enabled = False
frmmain.administrators.Enabled = True
mrc1.AddNew '添加更新到正在上机的表里
mrc1.Fields(0) = Trim(username)
mrc1.Fields(1) = Trim(mrc.Fields(2))
mrc1.Fields(2) = Trim(Date)
mrc1.Fields(3) = Trim(Time)
'mrc1.Fields(4) = Trim(ComputerName)
mrc1.Update
frmmain.Show
Else
MsgBox "输入密码不正确,请重新输入!", vbOKOnly + vbExclamation, "警告"
txtPassword.SetFocus
txtPassword.Text = ""
End If