在“>”按钮的Click事件中添加以下代码:
if eof()
messagebox('已经是最后一条记录',48,'管理窗口')
skip-1 &&记录指针向上移一条记录
thisform.resize &&执行表单的Resize事件
this.parent.command1.enabled=.f.
this.parent.command2.enabled=.f.
this.parent.command3.enabled=.f.
this.parent.command4.enabled=.f.
thisform.commandgroup1.cmodify.enabled=.f.
thisform.commandgroup1.cdel.enabled=.f.
else
skip &&将把记录指针向下移一条记录
thisform.resize &&执行表单的Resize事件
if eof()
messagebox('已经是最后一条记录',48,'管理窗口')
skip-1 &&记录指针向上移一条记录
thisform.resize &&执行表单的Resize事件
this.parent.command3.enabled=.f.
this.parent.command4.enabled=.f.
else
this.parent.command3.enabled=.t.
this.parent.command4.enabled=.t.
endif
this.parent.command1.enabled=.t.
this.parent.command2.enabled=.t.
endif
thisform.refresh
在“>|”按钮的Click事件中添加以下代码:
this.parent.command3.enabled=.f.
this.parent.command4.enabled=.f.
go bottom &&记录指针移动到最后一条记录
if cx=1
this.parent.command1.enabled=.f.
this.parent.command2.enabled=.f.
thisform.commandgroup1.cmodify.enabled=.f.
thisform.commandgroup1.cdel.enabled=.f.
else
this.parent.command1.enabled=.t.
this.parent.command2.enabled=.t.
endif
thisform.resize &&执行表单的Resize事件
thisform.refresh
在“添加”按钮的Click事件中添加以下代码:
thisform.pageframe1.page1.text1.enabled=.t. &&设置控件有效
thisform.pageframe1.page1.text3.enabled=.f.
l=.t.
thisform.init &&执行表单的Init事件
*清空各文本框
thisform.pageframe1.page1.combo1.value=''
thisform.pageframe1.page1.text3.value=0
thisform.pageframe1.page1.combo2.value=''
thisform.pageframe1.page1.text5.value={//::}
thisform.pageframe1.page1.text6.value=''
thisform.pageframe1.page1.text7.value=''
thisform.pageframe1.page1.edit1.value=''
thisform.pageframe1.page1.text1.value=''
thisform.pageframe1.page1.text1.setfocus &&Text1获得焦点
thisform.commandgroup1.cmodify.enabled=.f.
thisform.commandgroup1.cdel.enabled=.f.
thisform.commandgroup1.cexit.enabled=.t.
thisform.commandgroup1.ccancel.enabled=.t.
thisform.commandgroup1.csave.enabled=.t.
thisform.commandgroup1.cadd.enabled=.f.
thisform.pageframe1.page2.enabled=.f.
thisform.commandgroup2.enabled=.f.
thisform.command1.enabled=.f.
单击“保存”按钮,在客房信息表“Tabkfinfo”中查找该房间号,如果没有找到则将用户输入的信息保存到客房信息表“Tabkfinfo”中;如果找到则修改“Tabkfinfo”中的相应信息。具体代码如下:
在“保存”按钮的Click事件中添加以下代码:
*获得输入信息
kfnumber=alltrim(thisform.pageframe1.page1.text1.value)
fjlx=alltrim(thisform.pageframe1.page1.combo1.value)
price=thisform.pageframe1.page1.text3.value
ft=alltrim(thisform.pageframe1.page1.combo2.value)
yytime=thisform.pageframe1.page1.text5.value
cmemo=alltrim(thisform.pageframe1.page1.text6.value)
sysz=alltrim(thisform.pageframe1.page1.text7.value)
pz=alltrim(thisform.pageframe1.page1.edit1.value)
cmessagetitle='客房管理系统'
cmessagetext='确定要保存吗?'
ndialogtype=4+32
nAnswer=messagebox(cmessagetext,ndialogtype,cmessagetitle)
do case
se nAnswer=6
if empty(kfnumber)=.t. &&判断房间号是否为空
messagebox('房间号不能为空',48,'操作失败!')
thisform.resize &&执行表单的Resize事件
else
select tabkfinfo
set order to 房间号
seek kfnumber
if!found()
insert into tabkfinfo values(kfnumber,fjlx,price,ft,pz,sysz,yytime,cmemo)
messagebox('数据保存完毕',48,'操作成功!')
else
cmessagetitle='客房管理系统'
cmessagetext='客房已经存在,要修改吗?'
ndialogtype=4+32
nAnswer=messagebox(cmessagetext,ndialogtype,cmessagetitle)
do case
case nAnswer=6
update tabkfinfo set 价格=price,房间类型=fjlx,房态=ft,营业时间=yytime,;
使用设置=sysz,备注=cmemo,配置=pz where 房间号=kfnumber
messagebox('数据修改完毕',48,'操作成功!')
case nanswer=7
thisform.resize &&执行表单的Resize事件
endcase
endif
endif
thisform.pageframe1.page1.text1.enabled=.f.
thisform.pageframe1.page1.text3.enabled=.f.
l=.f.
thisform.init &&执行表单的Init事件
endcase
thisform.commandgroup1.cmodify.enabled=.t.
thisform.commandgroup1.cdel.enabled=.t.
thisform.commandgroup1.cexit.enabled=.t.
thisform.commandgroup1.ccancel.enabled=.f.
thisform.commandgroup1.csave.enabled=.f.
thisform.commandgroup1.cadd.enabled=.t.
thisform.pageframe1.page2.enabled=.t.
thisform.commandgroup2.enabled=.t.
thisform.command1.enabled=.t.
thisform.refresh
在“取消”按钮的Click事件中添加以下代码:
thisform.resize &&执行表单的Resize事件
thisform.pageframe1.page1.text1.enabled=.f. &&设置控件无效
thisform.pageframe1.page1.text3.enabled=.f.
l=.f.
thisform.init &&执行表单的Init事件
thisform.commandgroup1.cmodify.enabled=.t.
thisform.commandgroup1.cdel.enabled=.t.
thisform.commandgroup1.cexit.enabled=.t.
thisform.commandgroup1.ccancel.enabled=.f.
thisform.commandgroup1.csave.enabled=.f.
thisform.commandgroup1.cadd.enabled=.t.
thisform.pageframe1.page2.enabled=.t.
thisform.commandgroup2.enabled=.t.
thisform.command1.enabled=.t.
在“修改”按钮的Click事件中添加以下代码:
thisform.pageframe1.page1.text1.enabled=.f.
thisform.pageframe1.page1.text3.enabled=.t.
l=.t.
thisform.Init &&执行表单的Init事件
thisform.refresh
thisform.commandgroup1.cmodify.enabled=.f.
thisform.commandgroup1.cdel.enabled=.f.
thisform.commandgroup1.cexit.enabled=.t.
thisform.commandgroup1.ccancel.enabled=.t.
thisform.commandgroup1.csave.enabled=.t.
thisform.commandgroup1.cadd.enabled=.f.
thisform.pageframe1.page2.enabled=.f.
thisform.commandgroup2.enabled=.t.
thisform.command1.enabled=.f.
在“删除”按钮的Click事件中添加以下代码:
kfnumber=alltrim(thisform.pageframe1.page1.text1.value)
cmessagetitle='客房管理系统'
cmessagetext='确定要删除吗?'
ndialogtype=4+32
nAnswer=messagebox(cmessagetext,ndialogtype,cmessagetitle)
do case
case nAnswer=6
use kfgl/database/tabkfinfo exclusive &&以独占方式打开数据表
dele from tabkfinfo where 房间号=kfnumber &&逻辑删除记录
dele from tabkfinfo where empty(房间号)
pack &&物理删除
thisform.resize &&执行表单的Resize事件
thisform.pageframe1.page2.grid1.recordsource='tabkfinfo'
messagebox('删除完毕',48,'操作成功!')
thisform.refresh
endcase
用户单击主菜单前台管理下的退宿结帐子菜单选项,进入退宿结帐界面。退宿结帐界面主要实现显示公司名称、网址、显示退宿帐号、住宿时间、操作员姓名以及完成客人退宿结帐的操作。退宿结帐表单运行结果如图5所示。
上一页 [1] [2] [3] [4] [5] [6] [7] 下一页