第一次機房收費系統 選擇下機

2021-09-25 15:54:33 字數 2221 閱讀 1348

選擇機房的思路是先將表控制項中的檔案進行的標記,對選擇的卡號做標記,進行選擇下機操作後,要判斷是否存在做標記的卡號,將卡號一次賦值與變數,當前卡號下機完成後,將表中本條記錄刪除,判斷表中是否還存在做標記的卡號,有,則繼續進行下機操作,直到無記錄,顯示下機成功。

機房選擇下機順序

msgbox "沒有學生上機", , "提示"

exit sub

else

do while not msflexgrid1.rows = 1

otxtsql = "select * from online_info where cardno='" & msflexgrid1.textmatrix(1, 0) & "'"

set omrc = executesql(otxtsql, omsgtext)

stxtsql = "select * from student_info where cardno='" & msflexgrid1.textmatrix(1, 0) & "'"

set smrc = executesql(stxtsql, smsgtext)

consumetime = datediff("n", omrc.fields(7), time)

'判斷使用者

if trim(smrc.fields(14)) = "固定使用者" then

consume = consumetime / 2

else

consume = consumetime / 3

end if

i = trim(trim(smrc.fields(7))) - consume

if val(i) < 0 then

msgbox "餘額不足,不能下機,請充值後下機", , "提示"

exit sub

end if

'更新 stuednt表中的餘額

updatestxtsql = "update student_info set cash=" & i & " where cardno='" & msflexgrid1.textmatrix(1, 0) & "'"

set updatesmrc = executesql(updatestxtsql, updatesmsgtext)

'更新line 表中的資料

ltxtsql = "select * from line_info where cardno='" & msflexgrid1.textmatrix(1, 0) & "'" & "and ontime='" & omrc.fields(7) & "'"

set lmrc = executesql(ltxtsql, lmsgtext)

lmrc.fields(8) = format(now(), "yyyy-mm-dd")

lmrc.fields(9) = format(now(), "hh:mm:ss")

lmrc.fields(10) = trim(consumetime)

lmrc.fields(11) = trim(consume)

lmrc.fields(12) = i

lmrc.fields(13) = "正常下機"

lmrc.fields(14) = "guo"

lmrc.update

'刪除online 表中的資料

deleotxtsql = "delete from online_info where cardno='" & msflexgrid1.textmatrix(1, 0) & "'"

set deleomrc = executesql(deleotxtsql, deleomsgtext)

msflexgrid1.removeitem 1

loop

omrc.close

smrc.close

lmrc.close

msgbox "全部下機成功", vbokonly + vbexclamation, "提示"

end if

機房收費系統 選擇下機

rem 對 控制項進行修改 private sub msflexgrid1 mousedown button as integer,shift as integer,x as single,y as single 獲取選中不連續行的許可權,及實現多行選中 dim col as integer if ...

第一次機房收費系統 幽夢

經過了分析需求 基本配置。終於開始敲機房了。第一步就是敲模組,我只能按照學生資訊管理系統的模組照葫蘆畫瓢。稍微改改,雖然當時整學生時把模組的 一句一句的查了一遍,但到現在還是不懂。不管怎樣,接著進行吧。於是,正式開始了!0.0 登入 在敲登入窗體時,還是要參考學生資訊管理系統。這第一句 就讓我一頭霧...

第一次機房收費系統總結

1.sub與function的區別 1 sub 過程,不需要返回值 function 函式,可以帶返回值 2 語法 sub subname 引數1,引數2,end sub function functionname 引數1,引數2,functionname 返回值 end function 2.如何...