賓館客房管理系統(tǒng)課程設計說明書_第1頁
賓館客房管理系統(tǒng)課程設計說明書_第2頁
賓館客房管理系統(tǒng)課程設計說明書_第3頁
賓館客房管理系統(tǒng)課程設計說明書_第4頁
賓館客房管理系統(tǒng)課程設計說明書_第5頁
已閱讀5頁,還剩22頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、課程設計說明書 學生姓名王斌學 號210808065學院 計算機科學與技術學院專 業(yè)網(wǎng)絡工程題 目賓館客房管理系統(tǒng)的設計與開發(fā)指導教師楊素娣 講師/碩士 (姓 名) (專業(yè)技術職稱/學位)2010年12月摘 要: 本文論述了賓館客房管理系統(tǒng)的開發(fā)過程。本文針對系統(tǒng)的功能實現(xiàn)展開敘述,該系統(tǒng)包括空房查詢、客戶信息查詢、用戶入住管理、用戶退房管理、更新客房管理、數(shù)據(jù)庫備份等功能;最后介紹了軟件測試的方法、必要性和調試的過程中遇到的一些問題及解決方案。該系統(tǒng)采用基于ASP.NET架構完成的,以SQL Server 2005作為后臺數(shù)據(jù)庫。關鍵詞:賓館客房管理,ASP.NET,SQL Server 2

2、005數(shù)據(jù)庫 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 系統(tǒng)需求分析42.1 功能需求42.2 實體ER圖53 系統(tǒng)功能分析63.1 功能介紹64 系統(tǒng)設計84.1 系統(tǒng)數(shù)據(jù)庫物理結構設計84.2 系統(tǒng)數(shù)據(jù)庫邏輯結構設計85 系統(tǒng)運行平臺95.1 系統(tǒng)運行環(huán)境95.2 系統(tǒng)開發(fā)平臺106 系統(tǒng)的實現(xiàn)和核心模塊的描述106.1 登錄模塊及實現(xiàn)代碼106.2空房信息查詢模塊及代碼126.3客房客人信息查詢模塊及實現(xiàn)代碼146.4增加新的客房模塊及實現(xiàn)代碼156.5入住新的客戶模塊設計166.6刪除正在修理的客房模塊及實現(xiàn)代碼19

5、6.7客戶退房模塊及實現(xiàn)代碼216.8 其他模塊設計247 軟件測試247.1 軟件測試的必要性247.2 調試24結 論25參考文獻26致謝261 緒論1.1 課題背景人類已經(jīng)跨入了新世紀,正在進入信息時代?,F(xiàn)在信息技術的應用越來越普及,不但促進了社會的高速發(fā)展,也改變著人們的工作、學習、生活和娛樂的方式以及思想觀念。隨著計算機軟硬件技術的高速發(fā)展,我們每個人都可感覺到信息時代的到來,人們進行信息交流的深度與廣度不斷增加,信息量急劇增長,傳統(tǒng)的信息處理與決策的手段已不能適應社會的需要,信息的重要性和信息處理問題的緊迫性空前提高了。1.2 目的和意義隨著賓館酒店業(yè)競爭的加劇,賓館之間客源的爭奪

6、越來越激烈,賓館需要使用更有效的信息化手段,拓展經(jīng)營空間,降低運營成本,提高管理和決策效率.傳統(tǒng)的賓館酒店計算機管理系統(tǒng)主要包括前臺管理系統(tǒng)和后臺管理系統(tǒng)兩大部分,基本包含了賓館主要業(yè)務部門,初步實現(xiàn)了對顧客服務和進行財務核算所需要的各個功能.但傳統(tǒng)的賓館酒店管理系統(tǒng)基于財務管理為主線的設計理念,無法滿足賓館酒店全面信息化管理的需要.2 系統(tǒng)需求分析2.1 功能需求賓館管理系統(tǒng)主要用于賓館客房信息以及入住客戶的信息的查詢和保存。主要實現(xiàn)的功能有:錄入,入住客戶信息錄入,已滿客房信息錄入,新增加的客房信息的錄入等。為了便于對系統(tǒng)的維護,要實現(xiàn)的功能有:客房信息的管理,入住用戶的信息管理,退房交易

7、的管理等。各模塊主要的幾種操作如下:1.客房模塊:已滿的客房信息查詢,空的客房統(tǒng)計,維修的客房從客房信息中刪除,新增加的客房的錄入。2.用戶模塊:分為普通員工和管理員的身份。3.前臺功能模塊:客房住客信息查詢,新的客戶入住功能,顧客結賬辦理,空的客房查詢等功能。2.2 實體ER圖E-R圖的分析工作通常采用自底向下的設計方法,首先對局部視圖進行分析設計,然后再實現(xiàn)視圖集成。賓館客房管理系統(tǒng)一般包括如下幾個表:用戶信息(UsersInfo)、客戶信息(CustomersInfo)、客房類型(RoomCategory)、客房信息(RoomsInfo)、客房狀態(tài)(RoomStatus)、客房業(yè)務(Ro

8、omOperation)。他們之間關系如圖1所示。 顧客身份證號姓名電話號碼賬號客房入住退房房間位置房間狀態(tài)房間類型房號賓館密碼員工退房時間入住時間MN屬于屬于M11M身份 ER圖3 系統(tǒng)功能分析3.1 功能介紹1. 相關技術采用:本平臺是基于SQL Server 2005數(shù)據(jù)庫建立的,在Microsoft Visual Studio 2008寫代碼,運用asp+SQL Server實現(xiàn)。 2. 數(shù)據(jù)流圖用戶名密碼身份運行登入 3.1 登錄功能 普通員工界面查詢入住結算空房查詢用戶信息查詢客戶退房結賬新的客戶住入3.2普通員工功能管理員界面查詢入住更新空房查詢用戶信息查詢客戶退房結賬新的客戶住

9、入結算刪除數(shù)據(jù)備份增加新的客房刪除壞的客房備份數(shù)據(jù)3.3 管理員功能4 系統(tǒng)設計4.1 系統(tǒng)數(shù)據(jù)庫物理結構設計該平臺搭建于windows XP操作系統(tǒng)下,以C#作為開發(fā)語言,數(shù)據(jù)庫選擇的是SQL Server 2005。對于硬件環(huán)境下,完全可以完成該平臺的搭建。4.2 系統(tǒng)數(shù)據(jù)庫邏輯結構設計數(shù)據(jù)庫總共包含6張數(shù)據(jù)表:表1 用戶信息表(Userinf)編 號字 段 名 稱數(shù) 據(jù) 結 構說 明1Usernamechar(50)用戶編號2Passwordchar(50)密碼3Usertypechar(50)普通員工,管理員表2 客戶信息表(Customerinf)編 號字 段 名 稱數(shù) 據(jù) 結 構說

10、 明1Cidchar(50)身份證號2CNamechar(50)客戶姓名3CPhonechar(50)聯(lián)系電話 表3 客房類型表(Roomtype)編 號字 段 名 稱數(shù) 據(jù) 結 構說 明1RoomidInt客房類型編號2Roomtyperchar(50)類型名稱3AreaFloat客房面積4BedNumInt配置床位5PriceInt客房價格表4 客房信息表(Roominf)編 號字 段 名 稱數(shù) 據(jù) 結 構說 明1RoomnumberInt客房號2RoomIdInt客房類型編號3Roomwherechar(50)客房位置表5 客房狀態(tài)表(RoomStatus)編 號字 段 名 稱數(shù) 據(jù) 結

11、 構說 明1RoomnumberInt客房編號2Statuschar(50)空房,已滿 表6 客房業(yè)務表(RoomOperation)編 號字 段 名 稱數(shù) 據(jù) 結 構說 明1RoomnumberInt客房編號2BeginTimeDateTime入住時間3Cidchar(50)客戶身份證號4EndtimeDateTime退房時間5 系統(tǒng)運行平臺5.1 系統(tǒng)運行環(huán)境系統(tǒng)運行的軟件配置為 Window XP SP3版本的操作系統(tǒng)和SQL Server 2005數(shù)據(jù)庫軟件。5.2 系統(tǒng)開發(fā)平臺本系統(tǒng)采用Visual Studio 2008(C#語言)作為前臺的開發(fā)軟件,SQL Server 2005

12、作為后臺數(shù)據(jù)庫管理系統(tǒng)。 1.C#技術的特點:C#是由Microsoft開發(fā)的一種新型編程語言。它結合了C+的功能強大性和Java語言的簡潔性,還具有Delphi和VB的易用性,是一種易于使用、功能強大、表達力豐富的開發(fā).NET框架應用程序語言。C#是事件驅動的,完全面向對象的可視化編程語言,它幾乎提供了程序設計語言中所能提供的所有數(shù)據(jù)類型。相對于C和C+,C#具有以下特點:(1)語法更簡單,幾乎不再用C+中流行的指針,禁止直接內存操作。(2)支持快速應用開發(fā)(RAD)功能。(3)程序能最大程度地實現(xiàn)與任何.NET的語言相互交換信息。(4)具備強大的Web服務器組件。(5)支持跨平臺。(6)將

13、XML技術真正融入到.NET和C#中。(7)繼承并保留了C+的強大功能。2.系統(tǒng)對數(shù)據(jù)庫管理系統(tǒng)的選擇:開發(fā)數(shù)據(jù)庫應用,選擇一個好的數(shù)據(jù)庫是非常重要的。目前,商品化的數(shù)據(jù)庫管理系統(tǒng)以關系型數(shù)據(jù)庫為主導產(chǎn)品,技術比較成熟。面向對象的數(shù)據(jù)庫管理系統(tǒng)雖然技術先進,數(shù)據(jù)庫易于開發(fā)、維護,但尚未有成熟的產(chǎn)品。國際國內的主導關系型數(shù)據(jù)庫管理系統(tǒng)有SQL Server、ORACLE、SYBASE、INFORMIX和 DB2。SQL Server 2005是微軟公司開發(fā)的新一代企業(yè)級數(shù)據(jù)庫產(chǎn)品。該版本增加了許多更先進的功能,具有使用方便、可伸縮性好、與相關軟件集成程度高等優(yōu)點。且就本人而言,對SQL Serv

14、er 2005也比較了解,因而此次畢業(yè)設計,選擇了SQL Server2005作為后臺數(shù)據(jù)庫。3. ASP.NET是面向下一代企業(yè)級的WEB應用程序開發(fā)平臺,是建立在.NET框架的通用語言運行環(huán)境上的編程框架,可用于在服務器上生成功能強大的WEB應用程序。把基于通用語言的程序在服務器上運行。不像以前的ASP即時解釋程序,而是將程序在服務器端首次運行時進行編譯,這樣的執(zhí)行效果比一條條解釋強很多。ASP.NET是一個已編譯的、基于.NET的環(huán)境,可以用任何與.NET兼容的語言(包括 Visual Basic .NET、C# 和 JScript .NET)創(chuàng)作應用程序。另外,任何ASP.NET應用程

15、序都可以使用整個.NET Framework。開發(fā)人員可以方便地獲得這些技術的優(yōu)點,其中包括托管的公共語言運行庫環(huán)境、類型安全、繼承等等。ASP.NET可以無縫地與WYSIWYG HTML編輯器和其他編程工具(含Microsoft Visual Studio .NET)一起工作。這不僅使得 Web 開發(fā)更加方便,而且還能提供這些工具必須提供的所有優(yōu)點,包括開發(fā)人員可以用來將服務器控件拖放到Web頁的GUI和完全集成的調試支持。與以前的WEB開發(fā)模型相比,ASP.NET具有開發(fā)效率高、使用簡單快捷、管理更簡便、全新的語言支持以及清晰的程序結構等優(yōu)點。6 系統(tǒng)的實現(xiàn)和核心模塊的描述6.1 登錄模塊

16、及實現(xiàn)代碼系統(tǒng)登錄模塊用于驗證會員登錄系統(tǒng)時輸入的會員名、密碼以及身份是否正確,只有合法的用戶才能進入系統(tǒng)。1.登錄模塊圖1 系統(tǒng)登錄頁面2.登錄核心代碼登錄頁面的實現(xiàn)首先是判斷登錄名和密碼以及身份是否為空,如果都不為空并且連接數(shù)據(jù)庫并判斷TextBox中輸入的內容是否與數(shù)據(jù)庫中的內容一致,如果一致就允許用戶登錄相應界面,代碼如下: 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. 空房查詢功能代碼實現(xiàn)代碼如下: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 客房客人信息查詢模塊及實現(xiàn)代碼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 增加新的客房模塊及實現(xiàn)代碼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 刪除正在修理的客房模塊及實現(xiàn)代碼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 客戶退房模塊及實現(xiàn)代碼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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論