VF课程设计.docx

上传人:b****5 文档编号:7709444 上传时间:2023-01-25 格式:DOCX 页数:21 大小:18.70KB
下载 相关 举报
VF课程设计.docx_第1页
第1页 / 共21页
VF课程设计.docx_第2页
第2页 / 共21页
VF课程设计.docx_第3页
第3页 / 共21页
VF课程设计.docx_第4页
第4页 / 共21页
VF课程设计.docx_第5页
第5页 / 共21页
点击查看更多>>
下载资源
资源描述

VF课程设计.docx

《VF课程设计.docx》由会员分享,可在线阅读,更多相关《VF课程设计.docx(21页珍藏版)》请在冰豆网上搜索。

VF课程设计.docx

VF课程设计

LOGO.SCX表单:

时钟Timer1的代码:

ifthisform.label1.left<-220&&控制label1的左边与界面的边距

thisform.label1.left=thisform.width

thisform.label1.left=thisform.label1.left-5

else

thisform.label1.left=thisform.label1.left-5

endif

“确定”按钮的代码:

selepasswordinfo

ifallt(thisform.text1.value)==""

thisform.text1.setfocus

else

ifallt(thisform.text2.value)==""

thisform.text2.setfocus

else

locateforallt(用户名)=allt(thisform.text1.value);

.and.allt(密码)=allt(thisform.text2.value)

ifeof()

messagebox("用户名或密码错误,请重新输入!

",64,"提示")

thisform.text1.value=""

thisform.text2.value=""

thisform.text1.setfocus()

else

cyonghu=allt(thisform.text1.value)

cmima=allt(thisform.text2.value)

domenu.mpr

thisform.release

endif

endif

endif

“退出”按钮的代码:

thisform.release

cleaevent

quit

DZLR.SCX表单:

“读者编号”文本的代码:

thisform.text1.setfocus

“性别”文本的代码:

this.displayvalue="男"

this.additem("男")

this.additem("女")

“确定”按钮的代码:

usereaderinfo

ifallt(thisform.text1.value)==""

messagebox("请输入完整的必要信息!

",64,"提示")

thisform.text1.setfocus

else

ifallt(thisform.text2.value)==""

messagebox("请输入完整的必要信息!

",64,"提示")

thisform.text2.setfocus

else

ifallt(thisform.text4.value)==""

messagebox("请输入完整的必要信息!

",64,"提示")

thisform.text3.setfocus

else

ifallt(thisform.text5.value)==""

messagebox("请输入完整的必要信息!

",64,"提示")

thisform.text4.setfocus

else

appendblank

repl读者编号withallt(thisform.text1.value)

repl姓名withallt(thisform.text2.value)

repl年龄withallt(thisform.text3.value)

repl联系电话withallt(thisform.text4.value)

repl详细住址withallt(thisform.text5.value)

repl压金withval(allt(thisform.text6.value))

repl备注withallt(thisform.edit1.value)

repl注册日期withdate()

ifallt(bo1.value)==""

repl性别withallt(bo1.displayvalue)

else

repl性别withallt(bo1.value)

endif

mand2.click

endif

endif

endif

endif

use

“重填”按钮的代码:

thisform.text1.value=""

thisform.text2.value=""

thisform.text3.value=""

thisform.text4.value=""

thisform.text5.value=""

bo1.value=""

bo1.displayvalue="男"

thisform.edit1.value=""

thisform.text1.setfocus

“返回”按钮的代码:

thisform.release

DZXG.SCX表单:

“性别”文本的代码:

this.displayvalue="男"

this.additem("男")

this.additem("女")

“快速定位”按钮的代码:

selereaderinfo

ifallt(thisform.text6.value)==""

messagebox("请输入姓名或编号!

",64,"提示")

thisform.text6.setfocus

else

locateforallt(姓名)=allt(thisform.text6.value);

.or.allt(读者编号)=allt(thisform.text6.value)

ifeof()

messagebox("没有此记录,请重新输入!

",64,"提示")

thisform.text6.setfocus

gonhere

else

thisform.init

endif

nhere=recno()

endif

“第一条”按钮的代码:

gotop

nhere=recno()

mand4.enabled=.t.

mand6.enabled=.t.

thisform.init

“最后一条”按钮的代码:

gobottom

nhere=recno()

mand3.enabled=.t.

mand5.enabled=.t.

thisform.init

“上一条”按钮的代码:

skip-1

mand4.enabled=.t.

mand6.enabled=.t.

ifbof()

gotop

this.enabled=.f.

mand3.enabled=.f.

messagebox("已经到第一条记录了!

",64,"提示")

nhere=recno()

else

nhere=recno()

thisform.init

endif

“下一条”按钮的代码:

skip1

mand3.enabled=.t.

mand5.enabled=.t.

ifeof()

gobottom

this.enabled=.f.

mand4.enabled=.f.

messagebox("已经到最后一条记录了!

",64,"提示")

nhere=recno()

else

nhere=recno()

thisform.init

endif

“修改”按钮的代码:

thisform.text1.readonly=.f.

thisform.text2.readonly=.f.

thisform.text3.readonly=.f.

thisform.text4.readonly=.f.

thisform.text5.readonly=.f.

bo1.readonly=.f.

thisform.edit1.readonly=.f.

“删除”按钮的代码:

usereaderinfoexclusive

gonhere

mb=messagebox("确定要删除吗?

",1+64,"提示")

ifmb==1

delete

pack

countalltonum

ifnhere>num

gobottom

thisform.init

else

gonhere

thisform.init

endif

endif

“返回”按钮的代码:

thisform.release

JHCX.SCX表单:

“查询”按钮的代码:

ifallt(thisform.text1.value)==""

messagebox("请输入读者编号!

",64,"提示")

thisform.text1.setfocus

else

selereaderinfo

locatefor读者编号=allt(thisform.text1.value)

ifeof()

messagebox("编号错误,请重新输入!

",64,"提示")

thisform.text1.value=""

thisform.text1.setfocus

else

thisform.label9.caption=allt(thisform.text1.value)

thisform.label11.caption=allt(姓名)

sele书号,借阅日期,归还日期fromlendinfointocursorlendls;

whereallt(读者编号)=allt(thisform.text1.value);

.and.(allt(借阅情况)="借阅".or.allt(借阅情况)="已还")

thisform.grid1.init

endif

endif

日期标识label12的代码:

this.caption="今天是:

"+allt(str(year(date())))+"年";

+allt(str(month(date())))+"月";

+allt(str(day(date())))+"日"

表格Grid1按钮的代码:

this.columncount=4

this.column1.header1.caption="书号"

this.column2.header1.caption="借阅日期"

this.column3.header1.caption="归还日期"

this.column4.header1.caption="是否延期"

if!

allt(thisform.text1.value)==""

this.recordsource="lendls"

this.recordsourcetype=1

this.column1.controlsource="书号"

this.column2.controlsource="借阅日期"

this.column3.controlsource="归还日期"

endif

*thisform.text1.value=day(归还日期)

*dd=day(date())-day(借阅日期)

*daycount=dd

*mm=month(date())-month(借阅日期)

*mon=month(借阅日期)

*forn=0tomm

*docase

*casemon=1,3,5,7,8,10,12

*daycount=daycount+31

*casemon=4,6,9,11

*daycount=daycount+30

*casemon=2

*daycount=daycount+28

*endcase

*endfor

“归还”按钮的代码:

selelendinfo

ifallt(thisform.text5.value)==""

messagebox("请选择要归还的图书!

",64,"提示")

else

locateforallt(读者编号)=allt(thisform.text1.value);

.and.allt(书号)=allt(thisform.text5.value);

.and.allt(借阅情况)="借阅"

if!

eof()

repl归还日期withdate()

repl借阅情况with"已还"

sele书号,借阅日期,归还日期fromlendinfointocursorlendls;

whereallt(读者编号)=allt(thisform.label9.caption);

.and.allt(借阅情况)="借阅".or.allt(借阅情况)="已还"

thisform.grid1.init

endif

endif

“返回”按钮的代码:

thisform.release

TSCX.SCX表单:

查询选择框Optiongroup1的代码:

ifthis.option1.value==1

thisform.label2.caption="请输入要查询的书名:

"

endif

ifthis.option2.value==1

thisform.label2.caption="请输入要查询的作者:

"

endif

ifthis.option3.value==1

thisform.label2.caption="请输入要查询的出版社:

"

endif

借书选择框Optiongroup2的代码:

LPARAMETERScName,cClass

表格grid1的代码:

LPARAMETERSnColIndex

shuhao=allt(thisform.grid1.column1.text1.value)

thisform.text2.value=shuhao

selelendinfo

locateforallt(书号)=shuhao.and.allt(借阅情况)=="预约"

if!

eof()

thisform.check1.value=1

thisform.optiongroup2.option2.value=1

thisform.optiongroup2.option1.value=0

else

thisform.check1.value=0

thisform.optiongroup2.option1.value=1

thisform.optiongroup2.option2.value=0

endif

“查询”按钮的代码:

selebooksinfo

ifallt(thisform.text1.value)==""

messagebox("请输入要查询的内容!

",64,"提示")

thisform.text1.setfocus

else

ifthisform.optiongroup1.option1.value==1

sele书号,书名,作者,出版社frombooksinfointocursorbooksls;

whereallt(书名)=allt(thisform.text1.value)

endif

ifthisform.optiongroup1.option2.value==1

sele书号,书名,作者,出版社frombooksinfointocursorbooksls;

whereallt(作者)=allt(thisform.text1.value)

endif

ifthisform.optiongroup1.option3.value==1

sele书号,书名,作者,出版社frombooksinfointocursorbooksls;

whereallt(出版社)=allt(thisform.text1.value)

endif

thisform.init

endif

“第一条”按钮的代码:

ifallt(thisform.text1.value)==""

selebooksinfo

else

selebooksls

endif

gotop

thisform.init

mand4.enabled=.t.

mand6.enabled=.t.

“最后一条”按钮的代码:

ifallt(thisform.text1.value)==""

selebooksinfo

else

selebooksls

endif

gobottom

thisform.init

mand3.enabled=.t.

mand5.enabled=.t.

“上一条”按钮的代码:

ifallt(thisform.text1.value)==""

selebooksinfo

else

selebooksls

endif

skip-1

ifbof()

this.enabled=.f.

mand3.enabled=.f.

messagebox("已经到第一条记录了!

",64,"提示")

gotop

endif

thisform.init

mand4.enabled=.t.

mand6.enabled=.t.

“下一条”按钮的代码:

ifallt(thisform.text1.value)==""

selebooksinfo

else

selebooksls

endif

skip1

ifeof()

this.enabled=.f.

mand4.enabled=.f.

messagebox("已经到最后一条记录了!

",64,"提示")

gobottom

endif

thisform.init

mand3.enabled=.t.

mand5.enabled=.t.

“确定”按钮的代码:

selereaderinfo

ifallt(thisform.text3.value)==""

messagebox("请输入你的编号!

",64,"提示")

thisform.text3.setfocus

else

locateforallt(读者编号)=allt(thisform.text3.value)

ifeof()

messagebox("您还没有注册,请先注册...",48,"警告")

thisform.text3.value=""

else

selelendinfo

ifthisform.optiongroup2.option2.value==1

countforallt(读者编号)=allt(thisform.text3.value);

.and.allt(借阅情况)="预约"tocn

gotop

ifcn<3

locateforallt(读者编号)=allt(thisform.text3.value);

.and.allt(书号)=allt(thisform.text2.value);

.and.allt(借阅情况)="预约"

ifeof()

appendblank

repl书号withallt(thisform.text2.value)

repl读者编号withallt(thisform.text3.value)

repl预约日期withdate()

repl借阅情况with"预约"

else

messagebox("您已经预约此本书!

",64,"提示")

thisform.text2.value=""

endif

else

messagebox("最多只能预约3本图书,您已经预约3本了!

",64,"提示")

endif

endif

ifthisform.optiongroup2.option1.value==1

countforallt(读者编号)=allt(thisform.text3.value);

.and.allt(借阅情况)="借阅"tocn

gotop

ifcn<3

ifthisform.check1.value==0

appendblank

repl书号withallt(thisform.text2.value)

repl读者编号withallt(thisform.text3.value)

repl借阅日期withdate()

repl借阅情况with"借阅"

else

locateforallt(读者编号)=allt(thisform.text3.value);

.and.allt(书号)=allt(thisform.text2.value);

.and.allt(借阅情况)="预约"

ifeof()

messagebox("您没有预约此本图书!

",48,"警告")

else

repl借阅日期withdate()

repl借阅情况with"借阅"

endif

endif

else

messagebox("最多只能借3本图书,您已经借了3本图书!

",64,"提示")

endif

endif

endif

endif

“取消”按钮的代码:

ifallt(thisform.text3.value)==""

messagebox("请输入您的编号!

",64,"提示")

thisform.text3.setfocus

else

selereaderinfo

locateforallt(读者编号)=allt(thisform.text3.value)

ifeof()

messagebox("您还没有注册,请先注册...",48,"警告")

thisform.text3.value=""

else

selelendinfo

locateforallt(读者编号)=allt(thisform.text3.value);

.and.allt(书号)=allt(thisform.text2.value);

.and.allt(借阅情况)="预约"

ifeof()

messagebox("您没有预约此本书!

",64,"提示")

thisform.text2.value=""

else

delete

pack

thisform.ch

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

当前位置:首页 > 高等教育 > 研究生入学考试

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

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