代码清单.docx

上传人:b****3 文档编号:2916962 上传时间:2022-11-16 格式:DOCX 页数:11 大小:16.96KB
下载 相关 举报
代码清单.docx_第1页
第1页 / 共11页
代码清单.docx_第2页
第2页 / 共11页
代码清单.docx_第3页
第3页 / 共11页
代码清单.docx_第4页
第4页 / 共11页
代码清单.docx_第5页
第5页 / 共11页
点击查看更多>>
下载资源
资源描述

代码清单.docx

《代码清单.docx》由会员分享,可在线阅读,更多相关《代码清单.docx(11页珍藏版)》请在冰豆网上搜索。

代码清单.docx

代码清单

代码清单

1.借书业务

PrivateSubcmdissue_Click()

Iftrim(txtmemid)=""orTrim(txtbookid)=""Then

Msgbox"缺少会员编号或书本编号!

"、binformation、"注意"

Else

检测是否超出最大允许帐户欠款数额

Ifval(lblfinebal.caption)>M.maxfinebalThen

Msgbox"您的帐户欠款超额,借书前请付清罚款。

",vbinformation,"注意"

txtbookid.text=""

txtmemid.stfocus

exitsub

Endif

检测是否超出最大允许借书数量

Ifval(lbooks.caption)>=M.totalissuebookthen

Msgbox"您的借书数量已超出最大允许值。

"、vbinformantion、"注意"

Txtbookid.text=""

Txtmemid.setfocus

Exitsub

Endif

IfUcase(lblisin.caption)="FALSE"then

Msgbox"图书馆中没这本书。

"、vbinformation、"注意"

Txtbookid.text=""

Txtmemid.setfocus

Exitsub

Endif

IfUcase(lblisin.caption)="MISSING"then

Msgbox"书籍已丢失"、vbinformation、"注意"

Txtmemid.setfocus

Exitsub

Endif

Ifnotlblres.caption="0"AndTrim(lbres.caption)_

<>Trim(txtmemid.text)then

msgbox"这本书已破损"&lbres.caption&"预定"、_

vbinformation、"注意"

Txtbookid.text=""

Txtmemid.setfocus

Exitsub

Endif

获取当前书本所属主题

dimadoprimaryrslAsrecordset

setadoprimaryrsl=newrecordset

adoprimaryrsl.open"slectsubjectfromtitleswhere"&_

"titleid=`"&lbltitle.caption&"`"、_

db、adopenstatic、adlockoptimistic

subj=adoprimarysl.fields(0)

获取此主题的最大出借天数

dimadoprimaryrs2Asrecordset

setadoprimaryrs2=newrecordset

adoprimaryrs2.open"slectissuedays、nooks、finecharge,"&_

"resecharge、issuedaysfromsbjects"&_

"wheresubject=`"&sbj&"`"、_

db、adopenstatic、adlockoptimistic

nootfdaysx=adoprimaryrs2.fidldset(4)

dimadoprimaryrs3Asrecordset

setadoprimaryrs3=newrecordset

adoprimaryrs4.open"slecttitleidfrombookswhere"&_

"memberid=`"&trim(txtmend.text)&"`"、_

db、adopenstatic、adlockoptimistic

dimadoprimaryrs4Asrecordset

setadoprimaryrs4=newrecordset

获取用户借阅当前主题的册书

whilenotadoprimaryrs3.EOF

adoprimaryrs4.open"slectsubjectfromtitleswhere"&_

"titleid=`"&adoprimaryrs3.fields(0)&_

"`"、db、adopenstatic、adlockoptimistic

ifsubj=adoprimaryrs4.fields(0)then

counter=counter+1

Endif

adoprimaryrs3.movenext

adoprimaryrs4.close

Wend

Ifcounter>=adoprimaryrs2.fields

(1)then

Msgbox"用户已在当前主题借阅的图书超出最大允许值。

"、_

vbinformation、"注意"

Txtbookid.text=""

Txtmemid.setfocus

Exitsub

Endif

可以借书

更新所借书本的信息

dimadoprimaryrs5Asrecordset

setadoprimaryrs5=newrecordset

adoprimaryrs5.open"slectmemberd、bookidISIN、returndate"&_

"frombooks"、db、adopenstatic、adlockoptimistic

adoprimaryrs5.find("bookid=`"&txtbookid.text&"`")

adoprimaryrs5.finds(0)=trim(textmid)

adoprimaryrs5.finds

(2)=False

计算归还日期

adoprimaryrs5.finds(3)=dataadd("d"、noofdaysx、data)

adoprimaryrs5.update

计算归还日期

lbreturn.caption=dataadd("d"、noofdaysx、data)

更新会员的借阅信息

dimadoprimaryrs6Asrecordset

setadoprimaryrs6=newrecordset

adoprimaryrs6.open"slectmembeid、booksinhand、finebal"&_

"frommemberswherememberd=`"&_

trim(textmid.Text)&"`"、ab、_

adopenstatic、adlockoptimistic

Iflblres.caption=Trim(txtmemid.text)then

adoprimaryrs6.finds

(2)=adoprimaryrs6.finds

(1)+_

adoprimaryrs2.finds(4)

Endif

adoprimaryrs6.finds

(1)=adoprimaryrs6.finds

(1)+_

adoprimaryrs6.update

txtbookid_lostfocus

txtbookid.setfocus

Endif

Endsub

 

2.还书业务

PrivateSubcmdreturnClick()

dimadoprimaryrslAsrecordset

dimadoprimaryrs11Asrecordset

dimadoprimaryrs12Asrecordset

dimadoprimaryrsl3Asrecordset

setadoprimaryrsl=newrecordset

adoprimaryrs1.open"slectmemberid、bookidISIN、returndate"&_

"issuecounterfrombookswherememberd=`"&_

trim(textmid.Text)&"`andbookid=`"&_

trim(textmid.Text)&"`"、ab、_

adopenstatic、adlockoptimistic

Ifadoprimaryrsl.recount=0then

Msgbox"会员":

"&textmid&"并没有借这本书:

"&_

Txtbookid、vbinformation

Exitsub

Endif

Ifadoprimaryrsl.finds

(2)=trunthen

Msgbox"书":

"&txtbookid&"已经归还图书馆."vbinformation

Exitsub

Endif

获取书籍原定归还日期

returndate=adoprimaryrs1.finds(3)

Ifreturndate

借书超期

获取超期天数

Finedays=datadiff("d"、returndate、data)

获取当前书籍的主题

setadoprimaryrsl1=newrecordset

adoprimaryrs11.open"slectsubjectformtileswhere"&_

"tileid=`"&lbitle.caption&"`"、_

db、adopenstatic、adlockoptimistic

subj=adoprimaryrs11.finds(0)

adoprimaryrs12.open"slectissuedays、subject、finecharge"&_

"formsubjectwheresubject=`"&subj&_

"`"、db、adopenstatic、adlockoptimistic

获取超期单位罚款数额

Finecharge=adoprimaryrs12.finds

(2)

Msgbox"当前会员持有书籍:

"&txtbookid&"超过"&_

"天、需要支付:

"&Finedays*finecharge&"`"_

vbinformation、"超期"

setadoprimaryrsl3=newrecordset

adoprimaryrsl3open"slectmembeid、booksinhand、finebal"&_

"frommemberswherememberd=`"&_

trim(textmid.Text)&"`"、ab、_

adopenstatic、adlockoptimistic

借书数_1

adoprimaryrs13.finds

(1)=adoprimaryrs13.finds

(1)–1

罚款数额计算

adoprimaryrs13.finds

(2)=adoprimaryrs13.finds

(2)+_

(Finedays*finecharge)

书籍存在于图书馆中

adoprimaryrs1.finds

(2)="turn"

adoprimaryrs1.finds(0)="0"

adoprimaryrs13.update

adoprimaryrs1.update

Else

书籍按时归还

setadoprimaryrs13=newrecordset

adoprimaryrsl3open"slectmembei

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 法律文书 > 调解书

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1