機房收費系統 下機

2021-08-15 01:24:50 字數 2737 閱讀 4116

有了上機的思路,下機當然也就很簡單了,不過總是要比別人多想一步,這樣你就能夠比別人更加的優秀。

下機的流程圖

下機的注意事項:

txtontime.text = trim(mrc3.fields(7))

txtdowndate.text = format(now(), "yyyy-mm-dd")

txtdowntime.text = format(now, "hh:mm:ss")

time = datediff("n", trim(txtontime.text), trim(txtdowntime.text))

(1)計算消費餘額:消費時間*單位費用(分級別區別收費)

'判斷消費金額是多少

dim all as single '消費時間

dim money as integer '最終金額

dim rate as single ' 固定使用者單位時間的金額

all = txtspendtime.text '消費時間

rate = trim(mrc1.fields(0)) '一小時多少錢

rate1 = trim(mrc1.fields(1))

if trim(txtspendtime.text) < nomoneytime then

txtspendtime.text = "0"

money = 0

else

txtsql = "select * from student_info where cardno='" & (txtcardno.text) & "'"

set mrc = executesql(txtsql, msgtext) '消費金額=消費時間*單位費用(不同使用者型別分別計算)

'利用round函式進行四捨五入取整

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

money = round(((money - mrc1.fields(4)) / 60) * mrc1.fields(0), 0)

else

money = round(((money - mrc1.fields(4)) / 60) * mrc1.fields(1), 0)

end if

txtreatmoney.text = int(money)

end if

txtreatmoney.text = money

(2)計算餘額:

'餘額減去消費金額等於新的餘額

txtsql = "select * from student_info where cardno = '" & txtcardno.text & "'"

set mrc = executesql(txtsql, msgtext)

txtreatmoney.text = trim(mrc.fields(7)) - money

(3)更新

'將資料更新到line表中

txtsql3 = "select * from line_info"

set mrc = executesql(txtsql3, msgtext3)

while (mrc3.eof = false)

mrc3.movenext

wend

mrc.addnew

mrc.fields(1) = trim(txtcardno.text)

mrc.fields(2) = trim(txtstuno.text)

mrc.fields(3) = trim(txtname.text)

mrc.fields(4) = trim(txtmajor.text)

mrc.fields(5) = trim(txt***.text)

mrc.fields(6) = trim(txtondate.text)

mrc.fields(7) = trim(txtontime.text)

mrc.fields(8) = trim(txtdowndate.text)

mrc.fields(9) = trim(txtdowntime.text)

mrc.fields(10) = trim(txtspendtime.text)

mrc.fields(11) = trim(txtspendtime.text)

mrc.fields(12) = trim(txtreatmoney.text)

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

mrc.fields(14) = trim(labelpename.caption)

mrc.update

mrc.close

'刪除記錄

txtsql2 = "delete from online_info where cardno = '" & txtcardno.text & "'"

set mrc2 = executesql(txtsql2, msgtext2)

txtsql2 = "select count(*) from online_info"

set mrc2 = executesql(txtsql2, msgtext2)

label15.caption = trim(mrc2.fields(0))

機房收費系統 下機

上下機是機房收費系統中比較重要的一部分,所以我們一定要把上下機的思路理清楚才可以,不然會很亂,一會兒就把自己繞進去了,現在我們一起分析一下下機的思路吧!片段 判斷上下機的情況 private sub cmdoffline click dim mrconline as adodb.recordset ...

機房收費系統 下機

計算消費時間 計算上機時間 intlinetime date datevalue onw ondate 1440 hour time hour timevalue onw ontime 60 minute time minute timevalue onw ontime 計算機上機時間 txtcti...

機房收費系統 上下機

最近大家都在進行機房收費系統,看大家的部落格,基本上都是先理清思路再實現功能,回想自己當時做的時候就不夠好,只是盲目的敲 卻忽略了方向比努力更重要這個道理,導致最後出現了很多漏洞,於是又重新畫了一遍上下機的流程圖,希望能對以後機房的學習有幫助。上機 只要思路清晰,具體的 實現很簡單。下機 下機需要計...