【机房管理】上下机
来源:互联网 发布:数据库的定义及特点 编辑:程序博客网 时间:2024/05/21 14:09
上机
'判断是否为空 '判断卡号是否注册,是否退卡 '查BasicData_Info,判断余额是否小于最小金额 txtSQL = "select*from BasicData_Info" Set mrcBasicData = ExecuteSQL(txtSQL, MsgText) mrcBasicData.MoveFirst If Val(mrc.Fields(7)) < Val(mrcBasicData.Fields(5)) Then MsgBox "余额不足,请充值后上机", vbOKOnly + vbExclamation, "提示" txtCardNo.Text = "" txtCardNo.SetFocus Else '查OnLine_Info,看该卡是否在上机 txtSQL = "select*from OnLine_Info where cardno='" & Trim(txtCardNo.Text) & "'" Set mrc = ExecuteSQL(txtSQL, MsgText) If mrc.EOF = False Then MsgBox "该卡正在上机,不能重复上机!" txtCardNo.Text = mrc.Fields(0) ... txtOnTime.Text = mrc.Fields(7) txtSQL = "select*from student_Info where cardno='" & Trim(txtCardNo.Text) & "'" Set mrccash = ExecuteSQL(txtSQL, MsgText) txtBalance.Text = mrccash!cash Else '正常上机,显示卡号信息 '更新Line_Info数据 '更新OnLine_Info数据
下机
Dim intLineTime As Integer '用于存储实际在线时间 Dim curConsume As Single '用于存储真正花费钱的时间 Dim remaincash As Single '用于存储用户的余额 Dim fixedunit As Single '用于固定用户存储单位金额 Dim temunit As Single '用于临时用户存储单位金额 Dim a As Integer '判断卡号是否为空,判断是否为数字 '判断卡号是否注册,是否退卡 '判断该卡号是否在上机,没有上机不能下机 '计算所消费的时间 intLineTime = (Date - DateValue(mrc!onDate)) * 1440 + (Hour(Time) - Hour(TimeValue(mrc!OnTime))) * 60 + (Minute(Time) - Minute(TimeValue(mrc!OnTime))) '时间单位为分钟 txtSQL = "select * from student_Info where cardno='" & Trim(txtCardNo.Text) & "'" Set mrc = ExecuteSQL(txtSQL, MsgText) '获得基本表的数据 txtSQL = "select * from BasicData_Info" Set mrcBasicData = ExecuteSQL(txtSQL, MsgText) mrcBasicData.MoveFirst '单位时间的费用 (把固定用户,临时用户单位时间的费用分别赋值给费用) fixedunit = Val(mrcBasicData.Fields(0)) '把固定用户的金额赋值给变量 temunit = Val(mrcBasicData.Fields(1)) '把临时用户的金额赋值给变量 '判断在线时间是否小于准备时间,若小于则 消费金额0元 If intLineTime <= Val(Trim(mrcBasicData.Fields(4))) Then txtExpenseCash.Text = "0" Else '判断在线时间是否小于最低消费时间,若小于则消费金额为0元 If intLineTime < Val(Trim(mrcBasicData.Fields(3))) Then txtExpenseCash.Text = "0" End If End If '在线时间大于单位时间,就按有几个单位时间算,固定用户、临时用户 If intLineTime >= Val(Trim(mrcBasicData!leastTime)) And intLineTime And Trim(mrc.Fields(14)) = "固定用户" Then a = Int(intLineTime / Val(Trim(mrcBasicData!unitTime))) If a = intLineTime / Trim(mrcBasicData!unitTime) Then curConsume = a Else curConsume = a + 1 End If txtExpenseCash.Text = Val(curConsume) * Val(fixedunit) Else If intLineTime >= Val(Trim(mrcBasicData!leastTime)) And intLineTime And Trim(mrc.Fields(14)) = "临时用户" Then a = Int(intLineTime / Val(Trim(mrcBasicData!unitTime))) If a = intLineTime / Trim(mrcBasicData!unitTime) Then curConsume = a Else curConsume = a + 1 End If txtExpenseCash.Text = Val(curConsume) * Val(temunit) End If End If '更新学生表 '下机显示,更新在线表的信息显示 '更新上机记录表 End Sub
再看一遍,发现还是挺简单的,以后要继续加油!
阅读全文
0 0
- 【机房管理】上下机
- 【机房收费】上下机
- 【机房】-上下机
- 机房-上下机
- 【机房收费系统】上下机
- 【机房收费系统】上下机
- 机房收费系统-上下机
- 【机房收费】--上下机流程
- 机房收费系统--上下机
- 上下机---机房收费系统
- 【机房收费系统】上下机
- 机房收费系统---上、下机
- 机房收费系统-上下机
- 机房收费系统-上下机
- 机房收费系统——上下机
- 机房收费系统的上下机
- 机房收费系统——上下机
- 机房收费系统的上下机
- 最新vue-cli 2.9.1的webpack存在问题
- 自动化测试
- HDU4825 01trie+二进制
- OPENCV 2. 数据结构
- 远程连接MYSQL提示Host is not allowed to connect to this MySQL server
- 【机房管理】上下机
- HDU 2141-Can you find it?
- mysql函数扩展之UDF开发
- 阿里云服务器外部访问8080端口方法-阿里云安全规则
- 浅谈M、V、VM
- How to configure MailEnable to send emails on Google Cloud Platform instance?
- linux环境tcpdump使用时提示无法只好打该用户命令。
- CAP定理
- 【励志好文】老爸推荐的好文,受益良多!