上机
判断为空、数字、注册、使用状态、上机、余额(不足弹出充值)
更新在线表、上机人数,桌面内容。
上机成功!
下机
判断为空、数字、注册、在线
定义存储时间消费余额单价。
计算余额。
更新界面、清空界面、更新line、上机人数。
重要代码
判断余额:(上机)
If mrc.Fields(7) < mrc3.Fields(0) Then
MsgBox "卡内余额不足,请充值后上机!", vbOKOnly + vbExclamation, "提示"
cardNO.Text = ""
Recharge.Show
SetParent Recharge.hWnd, Picture1.hWnd
Exit Sub
mrc3.Close
计算余额:
If intLineTime <= Val(Trim(mrc3.Fields(4))) Then '是否小于准备时间
Discash.Text = 0
ElseIf intLineTime <= FreeTime Then '是否小于免费时间
Discash.Text = 0
ElseIf intLineTime > FreeTime And Trim(mrc.Fields(14)) = "固定用户" Then '固定用户消费
Discash.Text = fixedRate * Int(((curConsume / unitTime) + 1))
ElseIf intLineTime > FreeTime And Trim(mrc.Fields(14)) = "临时用户" Then '临时用户消费
Discash.Text = tempRate * Int(((curConsume / unitTime) + 1))
'余额:
mrc.Fields(7) = Trim(mrc!cash) - Discash.Text
End If