dim txtsql as string
dim msgtext as string
dim mrcst as adodb.recordset '連線student_info表
dim mrcca as adodb.recordset '連線cancelcard_info表
dim mrcli as adodb.recordset '連線line_info表
dim mrcre as adodb.recordset '連線recharge_info表
dim mrcch as adodb.recordset '連線checkday_info表
dim consumecash as integer '定義消費金額
dim sumcash as integer
dim mrccch as adodb.recordset
rem:判斷操作員是否為空
if trim(combouserid.text = "") then
msgbox "請選擇操作員使用者名稱!", vbokonly + vbexclamation, "警告"
combouserid.setfocus
exit sub
end if
rem:計算上期消費餘額
txtsql = "select sum(cash) from student_info where userid='" & trim(combouserid.text) & "'and ischeck='" & "未結賬" & "'"
set mrcst = executesql(txtsql, msgtext)
if isnull(mrcst.fields(0)) then
sumcash = 0
else
sumcash = mrcst.fields(0)
end if
rem:計算當日消費金額
txtsql = "select sum(consume) from line_info "
set mrcli = executesql(txtsql, msgtext)
if isnull(mrcli.fields(0)) then
consumecash = 0
else
consumecash = mrcli.fields(0)
end if
rem:更新student表
txtsql = "select * from student_info where userid='" & trim(combouserid.text) & "'and ischeck='" & "未結賬" & "'"
set mrcst = executesql(txtsql, msgtext)
do while not mrcst.eof
mrcst!ischeck = "已結賬"
mrcst.update
mrcst.movenext
loop
mrcst.close
rem:更新canclecard表
txtsql = "select * from cancelcard_info where userid='" & trim(combouserid.text) & "' and status='" & "未結賬" & "'"
set mrcca = executesql(txtsql, msgtext)
do while not mrcca.eof
mrcca!status = "已結賬"
mrcca.update
mrcca.movenext
loop
mrcca.close
rem:更新recharge表
txtsql = "select * from recharge_info where userid='" & trim(combouserid.text) & "' and status='" & "未結賬" & "'"
set mrcre = executesql(txtsql, msgtext)
do while not mrcre.eof
mrcre!status = "已結賬"
mrcre.update
mrcre.movenext
loop
mrcre.close
msgbox "結賬成功!", vbokonly, "提示"
dim ctrl as control
for each ctrl in me.controls
if typeof ctrl is textbox then
ctrl.text = ""
end if
next ctrl
unload me
end sub
機房收費系統 結賬
結賬是對這一段時間裡支出的乙個彙總,能清晰的知道自己今天賺了多少錢。但這裡的結賬不是我們單純的認為的那種收費結賬,裡面有很多個環節步驟,就比如說操作員和管理原之間的區別是什麼 操作員 相當於收銀員的型別,錢並不是到他那裡,而是個打工的。管理員 真正的老闆,錢最後彙總到的地方。再就是我們需要對各個表裡...
機房收費系統 之 結賬
結賬,顧名思義就是把錢算一下。這的結賬不是給每乙個卡號結賬,而是給乙個操作員結賬,算一下這個操作員一共賣卡張數,退卡張數,實收金額,應收金額等等。結賬的介面是這個樣子的,其中用到乙個選項卡 這個窗體相比較而言還有有點難度的。別看乙個小小的操作員使用者名稱,它不是一般的combo控制項,對於一般的co...
機房收費系統 之結賬
通過使用者名稱顯示真實姓名 txtsql select from user info where userid comboopuserid.text set mrc executesql txtsql,msgtext combooprealname.text mrc username mrc.clo...