酒店客房管理系统系统Word格式.docx
《酒店客房管理系统系统Word格式.docx》由会员分享,可在线阅读,更多相关《酒店客房管理系统系统Word格式.docx(15页珍藏版)》请在冰豆网上搜索。
1.1编写目的2
2.外部设计2
2.1支持软件2
3.结构设计3
3.1概念结构设计3
3.2功能模块图5
3.3业务流程图…………………………………………………………………8
3.4数据库的E-R图:
9
4.数据库设计……………………………………………………………………….9
5.代码编写…………………………………………………………………………10
5.1存储过程……………………………………………………………………10
5.2触发器………………………………………………………………………13
.
数据库设计说明书
1.引言
1.1编写目的
为了让本系统的管理员能很好的对本系统进行管理和维护,对本系统的数据能很好的管理,从而为用户提供帮助,提高管理效率和绩效,通过阅读本说明书还可以提高对系统数据库的整体认识。
2.外部设计
2.1支持软件
本数据库主要采用微软公司的成熟数据库系统SQLServer2000,2005,2008,提供了较为灵活操作简单的功能,可以为数据库管理员和系统开发人员提供很好的支持。
3.结构设计
3.1概念结构设计
本数据库将反映的现实世界中的实体、属性和它们之间的关系等的原始数据形式,包括各数据项、记录、系、文卷的标识符、定义、类型、度量单位和值域,建立本数据库的每一幅用户视图,如下图所示:
包间状态
客房状态
客历表
总体关系图
3.2功能模块图:
总图
包间预定
来客接待
结帐系统
3.3业务流程图:
4.数据库设计:
一.客房表:
1.房号2.房间类型号3.状态4.预定备注
二.客房类型表:
1.类型号2.价位3.单/双/多人间4.状态号5.状态
三.房客表:
1.身份证号2.姓名3.性别号4.房间号5.开房日期6.退房日期7.电话
四.性别表:
1.性别号2.性别
五.消费表:
1.房号2.姓名3.身份证号4.开房日期5.退房时间6.结账日期7.账目信息8.备注
5.代码编写:
5.1存储过程:
包间到位登记
CREATEPROCEDUREpro_bjdwdj
@hnochar(10),@pnochar(17),@pnamechar(20),@telchar(20),@sexnochar
(1),@shourschar(4)
AS
updatehousesettexno=1wherehno=@hno
updatehousesetinfo='
null'
wherehno=@hno
insertintoformvalues(@hno,0,'
)
insertintopersonvalues(@pno,@pname,@sexno,@tel,@hno,@shours)
insertintohistoryvalues(@pno,@pname,'
@tel)
updatehousesetfno=@hnowherehno=@hno
GO
包间未预订查询
CREATEPROCEDUREpro_bjwydcx
@hnochar(10)output,@hstylechar(10)output,@pricechar(10)output,@personschar(10)output,@infochar(10)='
@texchar(10)='
空'
select@hno=hno,@hstyle=hstyle,@price=price,@persons=personsfromhouse,hstyle,tex
wheretex.texno=house.texnoandhouse.hstyleno=hstyle.hstylenoandinfo=@infoandtex=@tex
查询包间预定信息
CREATEPROCEDUREpro_cxbjyjxx
@hnochar(10),@infochar(20)output
select@info=infofromhousewherehno=@hno
查询包间状态
CREATEPROCEDUREpro_cxbjzt
@hnochar(10),@hstylechar(10)output,@texchar(8)output,@infochar(20)output,@fnochar(20)output
as
select@hstyle=hstyle,@tex=tex,@info=info,@fno=fno
fromhouse,hstyle,tex
wherehouse.hstyleno=hstyle.hstylenoandtex.texno=house.texnoandhno=@hno
查询住房预定信息
CREATEPROCEDUREpro_cxzfydxx
@rnochar(10),@rinfochar(20)output
select@rinfo=rinfofromroomwhererno=@rno
查账
CREATEPROCEDUREpro_cz
@fnochar(10),@moneychar(10)output,@infochar(20)
select@fno=fno,@money=money,@info=info
fromform
wherefno=@fno
空包间
createprocedurepro_kbjcx
@hnochar(10)output,@hstylechar(10)output,@infochar(20),@texnochar
(1)=0
select@hno=hno,@hstyle=hstyle,@info=info
fromhouse,hstlye
wherehouse.hstyleno=hstyle.hstylenoandhno=@hno
房间查询
CREATEPROCEDUREpro_kfcx
@rnochar(10),@stylechar(10),@pricechar(10),@personschar(10),@texchar(10),@rinfochar(10),@fnochar(10)
AS
select@style=style,@price=price,@persons=persons,@tex=tex,@rinfo=rinfo,@fno=fnofromroom,roomstyle,tex
wheretex.texno=room.texnoandroom.styleno=roomstyle.stylenoandrno=@rno
客户入住登记
CREATEPROCEDUREpro_khrzdj
@rnochar(10),@pnochar(17),@pnamechar(20),@telchar(20),@sexnochar
(1),@shourschar(4)
updateroomsettexno=1whererno=@rno
updateroomsetrinfo='
whererno=@rno
insertintoformvalues(@rno,0,'
insertintopersonvalues(@pno,@pname,@sexno,@tel,@rno,@shours)
updateroomsetfno=@rnowhererno=@rno
空余住房查询
createprocedurepro_kyzfcx
@rnochar(10)output,@stylechar(10)output,@rinfochar(20),@texnochar
(1)=0
select@rno=rno,@style=style,@rinfo=rinfo
fromroom,stlye
whereroom.styleno=style.stylenoandtexno=@texno
录入预定住房信息
CREATEPROCEDUREpro_lrydzfcx
@rnochar(10),@rinfochar(20)
updateroomsetrinfo=@rinfowhererno=@rno
录入预订包间信息
CREATEPROCEDUREpro_lryjbjxx
@hnochar(10),@infochar(20)
updatehousesetinfo=@infowherehno=@hno
录入账单
CREATEPROCEDUREpro_lrzd
@fnochar(10),@moneychar(10)
updateformsetmoney=money+@moneywherefno=@fno
消除包间预定信息
CREATEPROCEDUREpro_scbjyjxx
@hnochar(10)
消除住房预定信息
CREATEPROCEDUREpro_sczfyjxx
@rnochar(10)
退包间结账
CREATEPROCEDUREpro_tbjjz
@fnochar(10)
fno='
wherehno=@fno
deletefromformwherefno=@fno
退房结账
CREATEPROCEDUREpro_tfjz
whererno=@fno
修改查询包间客户信息
createprocedurepro_xfcxgjkhxx
@fnochar(20),@hnochar(5)
updatepersonsetfno=@hnowherefno=@hno
updatehousesettexno=0wherehno=@fno
updatehousesetfno=@hnowherehno=@fno
updateformsetfno=@hnowherefno=@fno
修改查询住房客户信息
createprocedurepro_xgcxzffkxx
@fnochar(20),@rnochar(5)
updatepersonsetfno=@rnowherefno=@rno
updateroomsettexno=0whererno=@fno
updateroomsetfno=@rnowhererno=@fno
updateformsetfno=@rnowherefno=@fno
住房未预订查询
CREATEPROCEDUREpro_zfwydcx
@rnochar(10)output,@stylechar(10)output,@pricechar(10)output,@personschar(10)output,@rinfochar(10)='
select@rno=rno,@style=style,@price=price,@persons=personsfromroom,roomstyle,tex
wheretex.texno=room.texnoandroom.styleno=roomstyle.stylenoandrinfo=@rinfoandtex=@tex
5.2触发器
关于结账后触发器
createtriggertri_sc
onformfordelete
declare@money_oldchar(10),@fnochar(10),@pnochar(17)
select@money_old=money,@fno=fno
fromdeleted
select@pno=pno
fromperson
wherefno=@fno
updatehistorysetmoney=@money_oldwherepno=@pno
deletefrompersonwherepno=@pno