下载word2013免费版-psd格式

accepttext
2023年4月4日发(作者:usbcleaner 下载)

1

酒店管理系统

(一)、设计目的

随着餐饮业的发展,酒店业如雨后春笋般蓬勃发展起来,既是社会发展

使然,更是人之常情所至,如此说,酒店业的兴旺正是应势而生,水到渠成

的事。这种社会需求下,人们对酒店业所提供的服务有了更高的要求,所以,

将计算机管理引入酒店业的管理体系当中,无疑对酒店业的服务水平更上一

层楼提供了一种有利的支持。计算机管理可令酒店业的运作更加可靠、快捷

和高效,不但节省了管理人员宝贵的时间,因此,在酒店业竞争越来越激烈

的情况下,必须以管理求生存,向管理要市场。当然,任何一种计算机管理

体系的建立都是对一种管理模式的体现,主要运用的pb软件来实现酒店预

定餐桌、点菜、结账等各方面的管理。

(二)、设计内容及步骤

1.数据库

先建立一个数据库“前台管理系统“如下

U表如下:

房间列表:

桌号列表:

2

2.E-R图

u

unopassword

房间列表

房间

结账表1:

菜品表:

预定表:

3

桌号列表

桌号房间

结账表1

日期

nuo

房间桌号

菜品类别菜品名

单价数量操作员金额

菜品表

菜品名菜品类别

单价数量编码

4

预定表

房间

nuo

桌号预定日期客户

联系电话备注

3.2系统功能实现

一.1.用户登录界面实现

1.菜单建立:

5

建立登入窗口w_login

窗体w_logintitle登入系统

图片框p_1picturNamD:数据库应用开发实训

图片框p_2picturNamD:数据库应用开发实训

20071013_15f89774a9d21bcabe09Dd

6

标签st_1text洒店管理系统

标签st_2text用户名:

标签st_3text密码:

标签st_4text欢迎光临

文本框sle_1,sle_2将sle_2中的password选项前打钩

两个命令按钮cb_1,

cb_2

text输入“登入”和“取消“

//“登入”按钮代码如下:

selectunointo:g_uno

fromu

whereuno=:sle_dpassword=:sle_;

i_n=i_n+1

e=0then

open(w_main)

close(w_login)

elseifi_n=3then

messagebox("提示","对不起,您是非法用户!")

close(w_login)

else

messagebox("提示","帐户或密码错误,请重新输入!")

sle_=""

sle_=""

endif

//“取消”按钮代码如下:

close(w_login)

主界面

7

主界面w_mainTitle

MenuName

windowType

windowState

主界面

M_menu

Mdihelp!

Maximized!

图片框p_1pictureName同上选择路径

预定餐桌

预定餐桌w_yudingbackcolorsky

8

数据窗口Name

DataObject

选择vscrollBar

Dw_1

a_yuding

两个列表框

ddlb_1,ddlb_2

选择vscrollBar添加滚

动条

订餐日期Name

Mask

maskDataType

选择spin

Em_1

Yyyy-mm-ddhh:mm:ss

dateTimeMask!

//w_yudingopen事件

dw_nsObject(sqlca)

dw_ve()

//房间列表框

stringa

ddlb_()

declarefangjiancursorfor

SELECTdistinct房间

FROM房间列表

usingsqlca;

commit;

openfangjian;

fetchfangjianinto:a;

e=0

ddlb_m(a)

fetchfangjianinto:a;

loop

closefangjian;

//桌号列表框

stringb

ddlb_()

declaredeskcursorfor

SELECTdistinct桌号

FROM桌号列表

usingsqlca;

commit;

opendesk;

fetchdeskinto:b;

e=0

ddlb_m(b)

fetchdeskinto:b;

loop

closedesk;

//预定按钮

9

//退出按钮

close(parent)

预定查询

预定查询w_chaxunbackcolorsky

10

房间,桌号,客户nameRb_1,rb_2,rb_3

数据窗口dw_1DataObjectA_yuding

//open事件

//修改按钮代码:

//删除代码

//确认按钮代码

intret,ret1

ifdw_dCount()>0then

ret=MessageBox("提示","数据已更新,是否保存?",Question!,YesNo!,2)

ifret=1then

ret1=dw_()

11

ifret=1then

commitusingSqlca;

MessageBox("提示","保存成功!")

else

rollbackusingSqlca;

MessageBox("错误","保存失败!")

endif

endif

endif

//查询按钮代码

stringcx

ifTrim(sle_)=""then

cx=""

else

cx="%"+Trim(sle_)+"%"

ifrb_d=truethen

cx="房间like'"+cx+"'"

elseifrb_d=truethen

cx="桌号like'"+cx+"'"

elseifrb_d=truethen

cx="客户like'"+cx+"'"

endif

endif

dw_t("房间a")

dw_()

dw_ter(cx)

dw_()

//退出按钮代码:

close(w_chaxun)

点餐登记

12

左数据窗口dw_1DataObjectD_diancai

右数据窗口dw_2DataObjectE_caidan

//w_xfopen事件

dw_nsObject(sqlca)

dw_Row(0)

dw_nsObject(sqlca)

dw_ve()

stringb

ddlb_()

declarecaimingcursorfor

SELECTdistinct菜品名

FROM菜品表

usingsqlca;

commit;

opencaiming;

fetchcaiminginto:b;

e=0

ddlb_m(b)

fetchcaiminginto:b;

loop

closecaiming;

//添加按钮

inti

i=dw_()

dw_text()

13

dw_row(0)

dw_torow(dw_nt())

dw_umn(1)

dw_us()

//确认按钮

intret,ret1

dw_Text()

ifdw_edCount()>0then

ret=MessageBox("提示","数据已更新,是否保存?",Question!,YesNo!,2)

ifret=1then

ret1=dw_()

ifret=1then

commitusingSqlca;

MessageBox("提示","保存成功!")

else

rollbackusingSqlca;

MessageBox("错误","保存失败!")

endif

endif

endif

//查询按钮

stringcx

ifTrim(ddlb_)=""then

cx=""

else

cx="%"+Trim(ddlb_)+"%"

cx="菜品名like'"+cx+"'"

endif

dw_t("单价a")

dw_()

dw_ter(cx)

dw_()

//退出按钮

close(w_xf)

点餐查询

14

数据窗口dw_1dataobjectC_diancai

//w_chaxun2open事件

dw_nsObject(sqlca)

dw_ve()

rb_d=true

//修改按钮代码

intret,ret1

dw_text()

ifdw_edCount()>0then

ret=messagebox("提示","数据已更新,是否保存?

",Question!,yesnocancel!,3)

ifret=1then

ret1=dw_()

ifret1=1then

commitusingsqlca;

messagebox("提示","保存成功!")

else

rollbackusingsqlca;

messagebox("错误","保存失败!")

endif

endif

endif

//删除按钮代码

15

intn

stringxy

xy=dw_.房间[dw_()]

selectcount(*)into:nfrom结帐表1where房间=:xy;

dw_row(0)

//确定按钮代码

intret,ret1

ifdw_dCount()>0then

ret=MessageBox("提示","数据已更新,是否保存?",Question!,YesNo!,2)

ifret=1then

ret1=dw_()

ifret=1then

commitusingSqlca;

MessageBox("提示","保存成功!")

else

rollbackusingSqlca;

MessageBox("错误","保存失败!")

endif

endif

endif

//查询按钮代码

stringcx

ifTrim(sle_)=""then

cx=""

else

cx="%"+Trim(sle_)+"%"

ifrb_d=truethen

cx="房间like'"+cx+"'"

elseifrb_d=truethen

cx="桌号like'"+cx+"'"

elseifrb_d=truethen

cx="菜品类别like'"+cx+"'"

elseifrb_d=truethen

cx="菜品名like'"+cx+"'"

endif

endif

dw_t("房间a")

16

dw_()

dw_ter(cx)

dw_()

//退出按钮代码

close(w_chaxun2)

餐饮结账

数据窗口dw_1dataobjectA_2

下拉列表框Ddlb_2选择vscrollbar

//open事件

w_nsObject(sqlca)

dw_ve()

//房间列表框

stringa

ddlb_()

declarefangjiancursorfor

SELECTdistinct房间

FROM房间列表

usingsqlca;

commit;

openfangjian;

fetchfangjianinto:a;

e=0

ddlb_m(a)

fetchfangjianinto:a;

loop

closefangjian;

//确定按钮

intret,ret1

17

ifdw_dCount()>0then

ret=MessageBox("提示","数据已更新,是否保存?",Question!,YesNo!,2)

ifret=1then

ret1=dw_()

ifret=1then

commitusingSqlca;

MessageBox("提示","保存成功!")

else

rollbackusingSqlca;

MessageBox("错误","保存失败!")

endif

endif

endif

//删除按钮

intn

stringsno

sno=dw_.菜品类别[dw_()]

selectcount(*)into:nfrom结帐表1where菜品类别=:sno;

dw_row(0)

//查询按钮

stringcx

ifTrim(ddlb_)=""then

cx=""

else

cx="%"+Trim(ddlb_)+"%"

cx="房间like'"+cx+"'"

endif

dw_t("单价a")

dw_()

dw_ter(cx)

dw_()

//退出按钮

close(w_jiezhang)

//原料管理菜单下的原料添加

18

数据窗口dataobject:h_caidan

//ww_yuanliaoopen事件

dw_nsObject(sqlca)

dw_ve()

//修改按钮

intret,ret1

dw_text()

ifdw_edCount()>0then

ret=messagebox("提示","数据已更新,是否保存?

",Question!,yesnocancel!,3)

ifret=1then

ret1=dw_()

ifret1=1then

commitusingsqlca;

messagebox("提示","保存成功!")

else

rollbackusingsqlca;

messagebox("错误","保存失败!")

endif

endif

endif

//添加按钮

inti

i=dw_()

dw_Text()

dw_Row(0)

dw_ToRow(dw_nt())

19

dw_umn(1)

dw_us()

//保存按钮

intret,ret1

dw_Text()

ifdw_edCount()>0then

ret=MessageBox("提示","数据已更新,是否保存?",Question!,YesNo!,2)

ifret=1then

ret1=dw_()

ifret=1then

commitusingSqlca;

MessageBox("提示","保存成功!")

else

rollbackusingSqlca;

MessageBox("错误","保存失败!")

endif

endif

endif

//退出按钮

close(ww_yuanliao)

原料删除

数据窗口dw_2的dataobject:e_caidan

//ww_yuanshanopen事件

dw_nsObject(sqlca)

dw_ve()

dw_t("菜品类别a")

dw_()

//删除按钮

20

intn

stringsno

sno=dw_.菜品类别[dw_()]

selectcount(*)into:nfrom结帐表1where菜品类别=:sno;

dw_row(0)

//确定按钮

intret,ret1

ifdw_dCount()>0then

ret=MessageBox("提示","数据已更新,是否保存?",Question!,YesNo!,2)

ifret=1then

ret1=dw_()

ifret=1then

commitusingSqlca;

MessageBox("提示","保存成功!")

else

rollbackusingSqlca;

MessageBox("错误","保存失败!")

endif

endif

endif

//退出按钮

close(ww_yuanshan)

数据窗口

可以添加表中已有的字段

A_2

可以添加表中已

有的字段

可以进行求和,平均数等

21

D_diancai

(三)、实训总结

经过短短一星期的计算机pb实训课,我深深体会到想一件事很容易,做一

件事却很难很难。

老师布置了一个综合的作业,就是让我们用pb做一个完整的管理系统,想

想觉得平时老师讲的都能听的懂,应该很简单的,但是第一天就为确认主题伤透

了脑筋。上网搜索了半天,终于确定下来“酒店管理系统”,确定完主题后,就

开始建立数据库,按照需求建立了不同的表,但是在数据库中最让我无能为力的

事是“不会建立外键”,对于数据库只能是“书到用时方恨少”,怎么建都会出

错。Pb是一个争对于数据库的软件,所以对于数据库的连接都很顺利,但是对

于“数据窗口”就相对有些陌生了,不知从何下手,经过不断的尝试,终于在同

选中后选择“edit”

同上选项,只要

在”mask”中选择

22

学的帮助下找到了自己所需要的数据窗口。对于数据窗口来说,运用的好,对于

开发一个程序,我认为是很有用的。

在本次实训中让我对pb有了更深入的了解,面对重重困难也在老师和同学

的帮助下顺利完成了,也让我学会了对于事情要成功一定要有很多方面的组成,

我要学习的还有很多,要不断学习,要把学过的东西记住,运用,才能提高自己,

古人云,“活到老、学到老”,这句话是很有道理的。

更多推荐

accepttext