【机房收费系统】——登录

终于到机房了,让我先哭一会,这个流程图看着简单,画着着实花费了一些时间,经过多次指导终于画出了第一章流程图,别看这一张小小的图也让我学习了不少的东西。

 

​
​
    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

​

​

 

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值