宾馆客房管理系统课程设计说明书_第1页
宾馆客房管理系统课程设计说明书_第2页
宾馆客房管理系统课程设计说明书_第3页
宾馆客房管理系统课程设计说明书_第4页
宾馆客房管理系统课程设计说明书_第5页
已阅读5页,还剩22页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、课程设计说明书 学生姓名王斌学 号210808065学院 计算机科学与技术学院专 业网络工程题 目宾馆客房管理系统的设计与开发指导教师杨素娣 讲师/硕士 (姓 名) (专业技术职称/学位)2010年12月摘 要: 本文论述了宾馆客房管理系统的开发过程。本文针对系统的功能实现展开叙述,该系统包括空房查询、客户信息查询、用户入住管理、用户退房管理、更新客房管理、数据库备份等功能;最后介绍了软件测试的方法、必要性和调试的过程中遇到的一些问题及解决方案。该系统采用基于ASP.NET架构完成的,以SQL Server 2005作为后台数据库。关键词:宾馆客房管理,ASP.NET,SQL Server 2

2、005数据库 Abstract:this article discusses the hotel room management system development process. This paper described the realization of the function of the system, the system including unfold vacancy query, customer information query, user check-in management, customer check-out management, update room

3、 management, database backup function; etc. At last, the paper introduces the software testing methods, necessity and debugging process of some of the problems and solutions. This system USES ASP.net framework based on completion, with SQL Server 2005 as the backend database.Keywords:Hotel room mana

4、gement, , SQL Server 2005 database目 录1 绪论41.1 课题背景41.2 目的和意义42 系统需求分析42.1 功能需求42.2 实体ER图53 系统功能分析63.1 功能介绍64 系统设计84.1 系统数据库物理结构设计84.2 系统数据库逻辑结构设计85 系统运行平台95.1 系统运行环境95.2 系统开发平台106 系统的实现和核心模块的描述106.1 登录模块及实现代码106.2空房信息查询模块及代码126.3客房客人信息查询模块及实现代码146.4增加新的客房模块及实现代码156.5入住新的客户模块设计166.6删除正在修理的客房模块及实现代码19

5、6.7客户退房模块及实现代码216.8 其他模块设计247 软件测试247.1 软件测试的必要性247.2 调试24结 论25参考文献26致谢261 绪论1.1 课题背景人类已经跨入了新世纪,正在进入信息时代。现在信息技术的应用越来越普及,不但促进了社会的高速发展,也改变着人们的工作、学习、生活和娱乐的方式以及思想观念。随着计算机软硬件技术的高速发展,我们每个人都可感觉到信息时代的到来,人们进行信息交流的深度与广度不断增加,信息量急剧增长,传统的信息处理与决策的手段已不能适应社会的需要,信息的重要性和信息处理问题的紧迫性空前提高了。1.2 目的和意义随着宾馆酒店业竞争的加剧,宾馆之间客源的争夺

6、越来越激烈,宾馆需要使用更有效的信息化手段,拓展经营空间,降低运营成本,提高管理和决策效率.传统的宾馆酒店计算机管理系统主要包括前台管理系统和后台管理系统两大部分,基本包含了宾馆主要业务部门,初步实现了对顾客服务和进行财务核算所需要的各个功能.但传统的宾馆酒店管理系统基于财务管理为主线的设计理念,无法满足宾馆酒店全面信息化管理的需要.2 系统需求分析2.1 功能需求宾馆管理系统主要用于宾馆客房信息以及入住客户的信息的查询和保存。主要实现的功能有:录入,入住客户信息录入,已满客房信息录入,新增加的客房信息的录入等。为了便于对系统的维护,要实现的功能有:客房信息的管理,入住用户的信息管理,退房交易

7、的管理等。各模块主要的几种操作如下:1.客房模块:已满的客房信息查询,空的客房统计,维修的客房从客房信息中删除,新增加的客房的录入。2.用户模块:分为普通员工和管理员的身份。3.前台功能模块:客房住客信息查询,新的客户入住功能,顾客结账办理,空的客房查询等功能。2.2 实体ER图E-R图的分析工作通常采用自底向下的设计方法,首先对局部视图进行分析设计,然后再实现视图集成。宾馆客房管理系统一般包括如下几个表:用户信息(UsersInfo)、客户信息(CustomersInfo)、客房类型(RoomCategory)、客房信息(RoomsInfo)、客房状态(RoomStatus)、客房业务(Ro

8、omOperation)。他们之间关系如图1所示。 顾客身份证号姓名电话号码账号客房入住退房房间位置房间状态房间类型房号宾馆密码员工退房时间入住时间MN属于属于M11M身份 ER图3 系统功能分析3.1 功能介绍1. 相关技术采用:本平台是基于SQL Server 2005数据库建立的,在Microsoft Visual Studio 2008写代码,运用asp+SQL Server实现。 2. 数据流图用户名密码身份运行登入 3.1 登录功能 普通员工界面查询入住结算空房查询用户信息查询客户退房结账新的客户住入3.2普通员工功能管理员界面查询入住更新空房查询用户信息查询客户退房结账新的客户住

9、入结算删除数据备份增加新的客房删除坏的客房备份数据3.3 管理员功能4 系统设计4.1 系统数据库物理结构设计该平台搭建于windows XP操作系统下,以C#作为开发语言,数据库选择的是SQL Server 2005。对于硬件环境下,完全可以完成该平台的搭建。4.2 系统数据库逻辑结构设计数据库总共包含6张数据表:表1 用户信息表(Userinf)编 号字 段 名 称数 据 结 构说 明1Usernamechar(50)用户编号2Passwordchar(50)密码3Usertypechar(50)普通员工,管理员表2 客户信息表(Customerinf)编 号字 段 名 称数 据 结 构说

10、 明1Cidchar(50)身份证号2CNamechar(50)客户姓名3CPhonechar(50)联系电话 表3 客房类型表(Roomtype)编 号字 段 名 称数 据 结 构说 明1RoomidInt客房类型编号2Roomtyperchar(50)类型名称3AreaFloat客房面积4BedNumInt配置床位5PriceInt客房价格表4 客房信息表(Roominf)编 号字 段 名 称数 据 结 构说 明1RoomnumberInt客房号2RoomIdInt客房类型编号3Roomwherechar(50)客房位置表5 客房状态表(RoomStatus)编 号字 段 名 称数 据 结

11、 构说 明1RoomnumberInt客房编号2Statuschar(50)空房,已满 表6 客房业务表(RoomOperation)编 号字 段 名 称数 据 结 构说 明1RoomnumberInt客房编号2BeginTimeDateTime入住时间3Cidchar(50)客户身份证号4EndtimeDateTime退房时间5 系统运行平台5.1 系统运行环境系统运行的软件配置为 Window XP SP3版本的操作系统和SQL Server 2005数据库软件。5.2 系统开发平台本系统采用Visual Studio 2008(C#语言)作为前台的开发软件,SQL Server 2005

12、作为后台数据库管理系统。 1.C#技术的特点:C#是由Microsoft开发的一种新型编程语言。它结合了C+的功能强大性和Java语言的简洁性,还具有Delphi和VB的易用性,是一种易于使用、功能强大、表达力丰富的开发.NET框架应用程序语言。C#是事件驱动的,完全面向对象的可视化编程语言,它几乎提供了程序设计语言中所能提供的所有数据类型。相对于C和C+,C#具有以下特点:(1)语法更简单,几乎不再用C+中流行的指针,禁止直接内存操作。(2)支持快速应用开发(RAD)功能。(3)程序能最大程度地实现与任何.NET的语言相互交换信息。(4)具备强大的Web服务器组件。(5)支持跨平台。(6)将

13、XML技术真正融入到.NET和C#中。(7)继承并保留了C+的强大功能。2.系统对数据库管理系统的选择:开发数据库应用,选择一个好的数据库是非常重要的。目前,商品化的数据库管理系统以关系型数据库为主导产品,技术比较成熟。面向对象的数据库管理系统虽然技术先进,数据库易于开发、维护,但尚未有成熟的产品。国际国内的主导关系型数据库管理系统有SQL Server、ORACLE、SYBASE、INFORMIX和 DB2。SQL Server 2005是微软公司开发的新一代企业级数据库产品。该版本增加了许多更先进的功能,具有使用方便、可伸缩性好、与相关软件集成程度高等优点。且就本人而言,对SQL Serv

14、er 2005也比较了解,因而此次毕业设计,选择了SQL Server2005作为后台数据库。3. ASP.NET是面向下一代企业级的WEB应用程序开发平台,是建立在.NET框架的通用语言运行环境上的编程框架,可用于在服务器上生成功能强大的WEB应用程序。把基于通用语言的程序在服务器上运行。不像以前的ASP即时解释程序,而是将程序在服务器端首次运行时进行编译,这样的执行效果比一条条解释强很多。ASP.NET是一个已编译的、基于.NET的环境,可以用任何与.NET兼容的语言(包括 Visual Basic .NET、C# 和 JScript .NET)创作应用程序。另外,任何ASP.NET应用程

15、序都可以使用整个.NET Framework。开发人员可以方便地获得这些技术的优点,其中包括托管的公共语言运行库环境、类型安全、继承等等。ASP.NET可以无缝地与WYSIWYG HTML编辑器和其他编程工具(含Microsoft Visual Studio .NET)一起工作。这不仅使得 Web 开发更加方便,而且还能提供这些工具必须提供的所有优点,包括开发人员可以用来将服务器控件拖放到Web页的GUI和完全集成的调试支持。与以前的WEB开发模型相比,ASP.NET具有开发效率高、使用简单快捷、管理更简便、全新的语言支持以及清晰的程序结构等优点。6 系统的实现和核心模块的描述6.1 登录模块

16、及实现代码系统登录模块用于验证会员登录系统时输入的会员名、密码以及身份是否正确,只有合法的用户才能进入系统。1.登录模块图1 系统登录页面2.登录核心代码登录页面的实现首先是判断登录名和密码以及身份是否为空,如果都不为空并且连接数据库并判断TextBox中输入的内容是否与数据库中的内容一致,如果一致就允许用户登录相应界面,代码如下: private void button1_Click(object sender, EventArgs e) SqlConnection con = new SqlConnection("data source=.;initial catalog=cks

17、j;integrated security=true"); SqlCommand cmd = new SqlCommand(); SqlDataReader datareader; string str ; cmd.Connection = con; if (con.State = ConnectionState.Closed) con.Open(); if (comboBox1.SelectedIndex = 0) str = string.Format("select * from userinf where username='0'and passwo

18、rd='1'",textBox1 .Text.Trim () ,textBox2 .Text .Trim () ); cmd.CommandText = str; datareader = cmd.ExecuteReader(); if (datareader.Read() this.Hide(); Form2 f2 = new Form2(); f2.Show(); else MessageBox.Show("请正确输入!"); if (comboBox1.SelectedIndex = 1) str = string.Format("

19、select * from userinf where username='0'and password='1'", textBox1.Text.Trim(), textBox2.Text.Trim(); cmd.CommandText = str; datareader = cmd.ExecuteReader(); if (datareader.Read() this.Hide(); Form9 f9 = new Form9(); f9.Show(); else MessageBox.Show("请正确输入!"); 6.2 空房信

20、息查询模块及代码1.空房查询模块图 图2空房查询模块页面2. 空房查询功能代码实现代码如下:SqlConnection con = new SqlConnection("data source=.;initial catalog=cksj;integrated security=true"); DataSet ds = new DataSet(); SqlDataAdapter adapter = null; private void button1_Click(object sender, EventArgs e) SqlCommand cmd = new SqlComm

21、and(" select roominf.roomnumber,area,bednum,roomwhere,price,roomtyper from roomtype ,roominf,roomstatus where status='空房'and roomtype.roomid=roominf.roomid and roomstatus.roomnumber=roominf.roomnumber", con); adapter = new SqlDataAdapter(cmd); adapter.Fill(ds, "student");

22、 dataGridView1.DataSource = ds.Tables"student" private void button2_Click(object sender, EventArgs e) this.Close(); Application.Exit(); 6.3 客房客人信息查询模块及实现代码1.客人信息查询模块见图图3客人信息查询模块页面 后台部分功能代码SqlConnection con = new SqlConnection("data source=.;initial catalog=cksj;integrated security=tru

23、e"); DataSet ds = new DataSet(); SqlDataAdapter adapter = null; private void button1_Click(object sender, EventArgs e) SqlCommand cmd = new SqlCommand(" select customerinf.cid,cname,cphone from customerinf ,roomoperation where roomoperation.cid=customerinf.cid and roomnumber='"+te

24、xtBox1 .Text .Trim ()+"'", con); ds.Clear(); adapter = new SqlDataAdapter(cmd); adapter.Fill(ds, "student"); dataGridView1.DataSource = ds.Tables"student" private void button2_Click(object sender, EventArgs e) textBox1.Text = "" private void button3_Click(

25、object sender, EventArgs e) Application.Exit(); 6.4 增加新的客房模块及实现代码1. 增加新的客房模块见图4图4 增加新的客房页面2. 后台部分功能代码 SqlConnection con = new SqlConnection("data source=.;initial catalog=cksj;integrated security=true"); DataSet ds = new DataSet(); private void Display() ds.Clear(); SqlCommand cmd = new Sq

26、lCommand("select roominf.roomnumber,roomid,roomwhere,status from roominf,roomstatus where roominf.roomnumber=roomstatus.roomnumber ", con); SqlDataAdapter adapter = new SqlDataAdapter(cmd); adapter.Fill(ds, "student"); dataGridView1.DataSource = ds.Tables"student" priva

27、te void button1_Click(object sender, EventArgs e) string Str = string.Format("INSERT INTO roominf VALUES('0','1','2')", textBox1 .Text , textBox2 .Text ,textBox3 .Text ); string str1 = string.Format("INSERT INTO roomstatus VALUES('0','空房')"

28、,textBox1 .Text ); SqlCommand Comm = new SqlCommand(Str, con); SqlCommand Comm1= new SqlCommand(str1, con); try con.Open(); Comm.ExecuteNonQuery(); Comm1.ExecuteNonQuery(); catch (SqlException ex) MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); finally con.Cl

29、ose(); MessageBox.Show("更新成功"); textBox1.Text="" textBox2 .Text ="" textBox3.Text="" Display(); private void Form5_Load(object sender, EventArgs e) Display(); private void button2_Click(object sender, EventArgs e) Application.Exit(); 6.5 入住新的客户模块设计 1. 入住新的客户模块

30、结果见图5图5 入住新的客户页面 后台部分功能代码 SqlConnection cn = new SqlConnection("data source=.;initial catalog=cksj;integrated security=true"); DataSet ds = new DataSet(); DataSet ds1= new DataSet(); private void displayDB() ds.Clear(); SqlCommand cmd = new SqlCommand("select roominf.roomnumber,roomid

31、,roomwhere from roominf,roomstatus where roomstatus.roomnumber=roominf.roomnumber and status='空房'", cn); SqlDataAdapter adapter = new SqlDataAdapter(cmd); adapter.Fill(ds, "student"); dataGridView1.DataSource = ds.Tables"student" private void display() ds1.Clear(); S

32、qlCommand cmd4 = new SqlCommand("select customerinf.cid,cname,cphone ,roomnumber from roomoperation,customerinf where customerinf.cid=roomoperation.cid", cn); SqlDataAdapter adapter = new SqlDataAdapter(cmd4); adapter.Fill(ds1, "s"); dataGridView2.DataSource = ds1.Tables"s&q

33、uot; private void button1_Click(object sender, EventArgs e) SqlCommand cmd = new SqlCommand(); SqlCommand cmd1 = new SqlCommand(); SqlCommand cmd2 = new SqlCommand(); string str = string.Format("insert into customerinf values('0','1','2')", textBox1.Text.Trim(), tex

34、tBox2.Text.Trim(), textBox3.Text.Trim(); string str1 = string.Format("insert into roomoperation values('0','1','2','3')", textBox6.Text.Trim(), textBox7.Text.Trim(), textBox1.Text.Trim(), textBox8.Text.Trim(); string str2 = string.Format("update roomsta

35、tus set status='已满' where roomnumber='0'", textBox6.Text.Trim(); cmd.CommandText = str; cmd2.CommandText = str2; cmd1.CommandText = str1; cmd.Connection = cn; cmd1.Connection = cn; cmd2.Connection = cn; try cn.Open(); cmd.ExecuteNonQuery(); cmd1.ExecuteNonQuery(); cmd2.ExecuteNo

36、nQuery(); catch (SqlException ex) MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); finally cn.Close(); textBox1.Text ="" textBox2 .Text ="" textBox3 .Text ="" textBox4 .Text ="" textBox5 .Text ="" textBox6 .Tex

37、t ="" textBox7 .Text ="" textBox8 .Text ="" displayDB(); display(); private void Form6_Load(object sender, EventArgs e) displayDB(); display(); textBox6.DataBindings.Add("Text", ds.Tables"student", ds.Tables"student".Columns"roomnumber

38、".ColumnName); textBox4.DataBindings.Add("Text", ds.Tables"student", ds.Tables"student".Columns"roomid".ColumnName); textBox5.DataBindings.Add("Text", ds.Tables"student", ds.Tables"student".Columns"roomwhere".Column

39、Name); private void button2_Click(object sender, EventArgs e) Application.Exit(); 6.6 删除正在修理的客房模块及实现代码1. 删除正在修理的客房模块结果见图6图6删除正在修理的客房页面2.后台部分功能代码private DataSet ds = new DataSet(); SqlConnection cn = new SqlConnection("data source=.;initial catalog=cksj;integrated security=true"); private v

40、oid displayDB() ds.Clear(); SqlCommand cmd = new SqlCommand("select roominf.roomnumber,roomid,roomwhere from roominf,roomstatus where roomstatus.roomnumber=roominf.roomnumber and status='空房'", cn); SqlDataAdapter adapter = new SqlDataAdapter(cmd); adapter.Fill(ds, "student&quo

41、t;); dataGridView1.DataSource = ds.Tables"student" private void button1_Click(object sender, EventArgs e) string DeleteStr = "DELETE FROM roomstatus WHERE status='空房'and roomnumber='" + textBox1.Text.Trim() + "'" SqlCommand deleComm = new SqlCommand(Dele

42、teStr, cn); try cn.Open(); deleComm.ExecuteNonQuery(); catch (SqlException ex) MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); finally cn.Close(); MessageBox.Show("删除成功"); displayDB(); private void Form7_Load(object sender, EventArgs e) displayDB();

43、 private void button2_Click(object sender, EventArgs e) Application.Exit(); 6.7 客户退房模块及实现代码1. 客户退房模块结果见图7图7客户退房模块页面2.后台部分功能代码public static string userid; SqlConnection cn = new SqlConnection("data source=.;initial catalog=cksj;integrated security=true"); DataSet ds = new DataSet(); private

44、 void displayDB() ds.Clear(); SqlCommand cmd = new SqlCommand("select cname,customerinf.cid,roominf.roomnumber,begintime,endtime,price from customerinf,roomoperation,roominf ,roomtype where roominf.roomnumber=roomoperation.roomnumber and roominf.roomid=roomtype.roomid and roomoperation.cid=cust

45、omerinf.cid ", cn); SqlDataAdapter adapter = new SqlDataAdapter(cmd); adapter.Fill(ds, "student"); dataGridView1.DataSource = ds.Tables"student" private void Form8_Load(object sender, EventArgs e) displayDB(); textBox1.DataBindings.Add("Text", ds.Tables"studen

46、t", ds.Tables"student".Columns"cname".ColumnName); textBox2.DataBindings.Add("Text", ds.Tables"student", ds.Tables"student".Columns"cid".ColumnName); textBox4.DataBindings.Add("Text", ds.Tables"student", ds.Tables&q

47、uot;student".Columns"roomnumber".ColumnName); textBox3.DataBindings.Add("Text", ds.Tables"student", ds.Tables"student".Columns"begintime".ColumnName); textBox6.DataBindings.Add("Text", ds.Tables"student", ds.Tables"student".Columns"endtime".ColumnName); textBox5.DataBindings.Add("Text", ds.Tables"student", ds.Tables"student".Columns"price".ColumnName);

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论