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

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

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

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

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

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

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

8、omOperation)。他們之間關(guān)系如圖1所示。 顧客身份證號(hào)姓名電話號(hào)碼賬號(hào)客房入住退房房間位置房間狀態(tài)房間類型房號(hào)賓館密碼員工退房時(shí)間入住時(shí)間MN屬于屬于M11M身份 ER圖3 系統(tǒng)功能分析3.1 功能介紹1. 相關(guān)技術(shù)采用:本平臺(tái)是基于SQL Server 2005數(shù)據(jù)庫(kù)建立的,在Microsoft Visual Studio 2008寫代碼,運(yùn)用asp+SQL Server實(shí)現(xiàn)。 2. 數(shù)據(jù)流圖用戶名密碼身份運(yùn)行登入 3.1 登錄功能 普通員工界面查詢?nèi)胱〗Y(jié)算空房查詢用戶信息查詢客戶退房結(jié)賬新的客戶住入3.2普通員工功能管理員界面查詢?nèi)胱「驴辗坎樵冇脩粜畔⒉樵兛蛻敉朔拷Y(jié)賬新的客戶住

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

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

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

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

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

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

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

16、及實(shí)現(xiàn)代碼系統(tǒng)登錄模塊用于驗(yàn)證會(huì)員登錄系統(tǒng)時(shí)輸入的會(huì)員名、密碼以及身份是否正確,只有合法的用戶才能進(jìn)入系統(tǒng)。1.登錄模塊圖1 系統(tǒng)登錄頁(yè)面2.登錄核心代碼登錄頁(yè)面的實(shí)現(xiàn)首先是判斷登錄名和密碼以及身份是否為空,如果都不為空并且連接數(shù)據(jù)庫(kù)并判斷TextBox中輸入的內(nèi)容是否與數(shù)據(jù)庫(kù)中的內(nèi)容一致,如果一致就允許用戶登錄相應(yīng)界面,代碼如下: 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("請(qǐng)正確輸入!"); 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("請(qǐng)正確輸入!"); 6.2 空房信

20、息查詢模塊及代碼1.空房查詢模塊圖 圖2空房查詢模塊頁(yè)面2. 空房查詢功能代碼實(shí)現(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 客房客人信息查詢模塊及實(shí)現(xiàn)代碼1.客人信息查詢模塊見圖圖3客人信息查詢模塊頁(yè)面 后臺(tái)部分功能代碼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 增加新的客房模塊及實(shí)現(xiàn)代碼1. 增加新的客房模塊見圖4圖4 增加新的客房頁(yè)面2. 后臺(tái)部分功能代碼 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 入住新的客戶模塊設(shè)計(jì) 1. 入住新的客戶模塊

30、結(jié)果見圖5圖5 入住新的客戶頁(yè)面 后臺(tái)部分功能代碼 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 刪除正在修理的客房模塊及實(shí)現(xiàn)代碼1. 刪除正在修理的客房模塊結(jié)果見圖6圖6刪除正在修理的客房頁(yè)面2.后臺(tái)部分功能代碼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 客戶退房模塊及實(shí)現(xiàn)代碼1. 客戶退房模塊結(jié)果見圖7圖7客戶退房模塊頁(yè)面2.后臺(tái)部分功能代碼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. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論