酒店客房管理系統程式如下:
(1)使用t—sql語句建立超市商品管理系統資料庫。
create database 酒店客房管理系統
on(name = 酒店客房管理系統,filename = 'd:\10——丁小玲\酒店客房管理系統.mdf',
size = 10mb,maxsize = 100mb,filegrowth = 10%)
log on
(name = 酒店客房管理系統_log,filename = 'd:\10——丁小玲\酒店客房管理系統.ldf',
size = 5mb,maxsize = 50mb,filegrowth = 1%);
(2)使用t—sql語句建立庫存表。
--1建立使用者資訊表
use 酒店客房管理系統
create table usersinfo
( useid varchar(20) primary key,
name varchar(20),
upassword varchar(20),
*** varchar(2),
email varchar(20),
uaddress varchar(20),
telephone varchar(20),
department varchar(20),
utype int --1代表酒店管理員,代表前台服務員
);--2建立客戶資訊表
use 酒店客房管理系統
create table customersinfo
( cidentityid varchar(30) primary key,
**ame varchar(20),
cphone varchar(20)
);--3建立客房型別表
use 酒店客房管理系統
create table roomcategory
( rcategoryid varchar(20) primary key,
name varchar(10),
area real,
bednum int,
price numeric(7,2),
aircondition varchar(10),
tv varchar(10)
);--4建立客房資訊表
use 酒店客房管理系統
create table roomsinfo
( roomid varchar(20)primary key,
rcategoryid varchar(20)not null,
rpostition varchar(50),
eescription varchar(50)
);--5建立客房狀態表
use 酒店客房管理系統
create table roomstatus
( roomid varchar(20) primary key,
rstatus int, --1有人,空房
foreign key (roomid) references roomsinfo(roomid)
);--6建立客房業務表,用於查詢現在在酒店居住的客戶
use 酒店客房管理系統
create table roomservice
( roomid varchar(20) primary key,
cidentityid varchar(30) not null
);--7建立業務記錄表
use 酒店客房管理系統
create table history
( begintime date,
endtime date,
roomid varchar(20),
totalprice numeric(10,2),
cidentityid varchar(30),
**ame varchar(20),
cphone varchar(20)
primary key(begintime,roomid,cidentityid)
);(3)使用t—sql語句建立庫存檢視。
create view 客房資訊普通查詢_view
asselect roomid 客房編號,rcategoryid 客房型別編號,rpostition 客房位置,eescription 描述
from roomsinfo;
create view 客房資訊高階查詢_view
asselect roomsinfo.roomid 客房編號,roomsinfo.rcategoryid 客房型別編號,rpostition 客房位置,
eescription 描述,name 型別名稱,area 客房面積,bednum 配置床位,price 客房**,
aircondition 配置空調,tv 配置電視,rstatus 客房狀態
from roomsinfo,roomcategory,roomstatus
where roomsinfo.rcategoryid = roomcategory.rcategoryid
and roomsinfo.roomid = roomstatus.roomid ;
create view 客戶資訊查詢_view
asselect cidentityid 身份證號,**ame 客戶姓名,cphone 聯絡**
from customersinfo ;
create view 使用者資訊系統查詢_view
asselect useid 使用者編號,name 使用者姓名,upassword 使用者密碼,*** 使用者性別,email email位址,
uaddress 通訊位址,telephone 聯絡**,department 所在部門,utype 使用者型別
from usersinfo ;
create view 客房型別查詢_view
asselect rcategoryid 客房型別編號,name 型別名稱,area 客房面積,bednum 配置床位,
price 客房**,aircondition 配置空調,tv 配置電視
from roomcategory ;
(4)使用t—sql語句建立庫存索引。
create index 使用者資訊表 on usersinfo(useid);
create index 客戶資訊表 on customerinfo(cidentityid);
create index 客戶型別表 on roomcategory(rcategoryid);
create index 客房資訊表 on roomsinfo(roomid);
create index 客房狀態表 on roomstatus(roomid);
create index 客房業務表 on roomservice(roomid);
create index 業務記錄表 on history(roomid,cidentityid);
(5)使用t—sql語句建立庫存儲存過程。
--1使用者登入
use 酒店客房管理系統
go if exists(
select * from sysobjects
where name = '使用者登入')
drop procedure 使用者登入
gocreate procedure 使用者登入
@useid varchar(20),
@password varchar(20)
asbegin
declare @returnvalue int
set @returnvalue = 1
if exists(select useid,upassword from usersinfo
where useid = @useid and upassword = @password)
begin
set @returnvalue = 0
print '使用者登陸成功^_^'
endelse
print '此使用者不存在,請您重新輸入!'
endgo--2新增客房
use 酒店客房管理系統
go if exists(
select * from sysobjects
where name = '新增客房')
drop procedure 新增客房
gocreate procedure 新增客房
@roomid varchar(20),
@rcategoryid varchar(20),
@rposition varchar(50),
@description varchar(50)
as begin
declare @returnvalue int
set @returnvalue = 1
if exists(select roomid from roomsinfo
where roomid = @roomid)
print '此房間已存在,請您重新新增!'
else
begin
if exists(select rcategoryid from roomcategory where rcategoryid = @rcategoryid)
begin
insert into roomsinfo values(@roomid,@rcategoryid,@rposition,@description)
insert into roomstatus values(@roomid,0)
set @returnvalue = 0
print '客房新增成功^_^'
endelse
print '客房型別不存在,請您重新新增!'
endendgo--3客戶訂房
use 酒店客房管理系統
go if exists(
select * from sysobjects
where name = '客戶訂房')
drop procedure 客戶訂房
gocreate procedure 客戶訂房
@begintime date,
@roomid varchar(20),
@cidentityid varchar(30),
@**ame varchar(20),
@cphone varchar(20)
asbegin
declare
@rstatus int
select @rstatus = rstatus from roomstatus where roomid = @roomid
if(@rstatus = 1)
print '此客房正在使用,請您選擇別的客房!'
else
酒店客房管理系統
本專案以如家連鎖酒店的運營環境為參照,希望設計出適合酒店管理運用的酒店客房管理系統。如家酒店目前擁有連鎖型旅館717余家,分布於中國139個大中城市。是中國最大的酒店分銷商。隨著我國改革開放的不斷推進,國內人民生活水平的不斷提高,旅遊出行的人民越來越多,商務活動也相當的活躍 再加上入境旅遊的人也越來...
酒店客房管理系統設計
青島理工大學 資料庫課程設計報告 院 系 計算機工程學院 專業軟體工程學院 學生姓名 任偉偉 班級 軟體081 學號 200807187 題目酒店客房管理系統設計 起迄日期 2011.1.3 2010.1.14 設計地點 青島理工大學實驗室2 402 指導教師張艷 完成日期 2011 年 1月 14...
UML酒店客房管理系統
資訊科學與技術學院 物件導向分析與設計 課程作業 uml是統一建模語言 uml是 unified modeling language的縮寫 是用來對軟體密集系統進行視覺化建模的一種語言。uml為物件導向開發系統的產品進行說明 視覺化 和編制文件的一種標準語言。uml可以貫穿軟體開發周期中的每乙個階段...