【文章內(nèi)容簡介】
tPage等任何文本編輯器,編寫完畢后保存為擴(kuò)展名為 aspx的文件即可。 web控件認(rèn)識(shí) Label(標(biāo)簽) Label控件可以在頁面上顯示信息。語法為: text=” 顯示的文字 ” runat=”server”/ TextBox(文本框 ) TextBox控件是一個(gè)可以輸入單行文本、密碼和多行文本的控件,語法為: textmode=”single|multiline|pas sword” text=” 顯示的文字 ” maxlength=” 整數(shù),表示在文本框中輸入的最大的字符數(shù) ” rows=“ 整數(shù),當(dāng)為多行文本時(shí)的行數(shù) ” columns=“ 整數(shù),當(dāng)為多行文本時(shí)的列數(shù) ” wrap=“true|false ,分別表示允許不允許換行,默認(rèn)為 ” autopostback=“true|false” ontextchanged=“ 當(dāng)文字改變時(shí)觸發(fā)的事件過程 ” runat=”server”/ DropDownList(下拉列表框 ) DropDownList控件是一個(gè)下拉列表框控件 ,語法為: autopostback=”true|false” onselectedindexchanged=” 改變選擇時(shí)觸發(fā)的事件過程 ” runat=”server” 選項(xiàng)文字 1 選項(xiàng)文字 2 ?? Button(按鈕) Button控件是一個(gè)普通按鈕控件,一般用來提交 web表單,語法為: text=” 按鈕上的文字 ” onclick=” 事件過程名稱 ” runat=”server”/ 數(shù)據(jù)庫分析 由于本系統(tǒng)涉及到許多數(shù)據(jù)的處理,這就需要有一個(gè)強(qiáng)大的后臺(tái)數(shù)據(jù)庫管理系統(tǒng)支持。本系統(tǒng)采 用的是微軟公司的 SQL Server 2021。原因如下:第一, SQL Server與 Windows 2021 Server服務(wù)器緊密集成,而 Windows 2021 Server服務(wù)器具有很好的安全性,能夠排除所有未經(jīng)授權(quán)的非法用戶的訪問,確保了 SQL Server 2021服務(wù)器的安全性,符合系統(tǒng)對(duì)安全性的要求;第二,用戶可以使用 Web瀏覽器查詢存儲(chǔ)在 SQL Server 2021數(shù)據(jù)庫中的數(shù)據(jù),符合系統(tǒng)遠(yuǎn)程訪問數(shù)據(jù)庫的要求;第三,容量龐大,每個(gè)數(shù)據(jù)庫中可創(chuàng)建多達(dá) 20萬個(gè)數(shù)據(jù)表,數(shù)據(jù)表中的記錄的行數(shù)只受 服務(wù)器硬盤空間的限制,符合系統(tǒng)的考題數(shù)目較多的要求。 根據(jù)系統(tǒng)的需求分析、模塊設(shè)計(jì),可以得出能夠滿足用戶需求的各種實(shí)體以及它們之間的關(guān)系,本系統(tǒng)根據(jù)設(shè)計(jì)規(guī)劃出的實(shí)體有:客戶信息實(shí)體、客房類型信息實(shí)體、入住信息實(shí)體、客房狀態(tài)信息實(shí)體。各實(shí)體具體關(guān)系 ER圖如下: 客戶信息實(shí)體圖如圖 52所示: 圖 52客戶信息實(shí)體圖 客房類型信息實(shí)體圖如圖 53所示: 圖 53客房類型信息實(shí)體圖 入住信息實(shí)體圖如圖 54所示: 圖 54入住信息實(shí)體圖 客房狀態(tài)信息信息實(shí)體圖如圖 55所示: 圖 55客房 狀態(tài)信息實(shí)體圖 酒店客房網(wǎng)上預(yù)訂系統(tǒng)的實(shí)現(xiàn)目標(biāo) 從 “ 酒店客房網(wǎng)上預(yù)訂系統(tǒng) ” 這一選題設(shè)計(jì)名稱就可看出,它的最終目標(biāo)即是實(shí)現(xiàn)酒店房間的在線預(yù)訂功能。換言之表現(xiàn)為在所建數(shù)據(jù)庫中插入客戶所填寫的預(yù)訂資料,而客戶可以通過返回給的訂單號(hào)查詢自己的訂房資料,當(dāng)需要對(duì)某一訂單進(jìn)行修改或酒店不再需要某一客戶的訂單資料時(shí),酒店工作人員可以通過訂單管理進(jìn)行相關(guān)操作。 客戶端具體功能的實(shí)現(xiàn) 房間預(yù)訂 圖 56 在線預(yù)定界面 設(shè)計(jì)實(shí)現(xiàn): sub dd() dim con as new sqlconnection(server=localhost。database=zz。uid=sa。pwd=123) dim con1 as new sqlconnection(server=localhost。database=zz。uid=sa。pwd=123) dim str, str1 as string str=insert into khxx(xm,xb,zjhm,dzyj,lxdh,cz,gj,sfrz,ddrq1,ddrq2,ddrq3,ddsj1,ddsj2,crsm,etsm,fjlx, ydjs,tsyq) values (39。 amp。 amp。 39。,39。amp。 amp。 39。,39。amp。 amp。 39。,39。amp。 amp。 39。,39。amp。 amp。 39。,39。amp。 amp。39。,39。amp。 amp。 39。,39。amp。 amp。 39。,39。amp。 amp。 39。,39。amp。 amp。 39。,39。amp。 amp。 39。,39。amp。 amp。 39。,39。amp。 amp。 39。,39。amp。 amp。 39。,39。amp。 amp。 39。,39。amp。 amp。 39。,39。amp。 amp。 39。,39。amp。 amp。 39。) str1=select * from khxx where xm=39。 amp。 amp。 39。 and zjhm=39。amp。 amp。 39。 dim cmd as new sqlmand(str,con) () =con1 =str1 dim dr1 as sqldatareader=() () =你的訂單號(hào)是 :amp。 (bianhao) amp。 end sub sub aa(sender as object, e as eventargs) if = then () else if = then () else if = then () else if = then () else if = then () else if = then () else if = then () else if = then () else dd() end if end if end if end if end if end if end if end if end sub sub cc(sender as object, e as eventargs) = = = = = = = = = end sub 概述:當(dāng)用戶輸入信息并提交后,客戶的各項(xiàng)信息將插入至 “khxx” 表中。各個(gè)帶 *號(hào)的值均不能為空,如當(dāng)姓名為空時(shí),系統(tǒng)通過 ()語句顯示:系統(tǒng)校驗(yàn)出錯(cuò),帶 *號(hào)的值不能為空。若某一類型的房間預(yù)訂數(shù)額已達(dá)到其最大值時(shí),系統(tǒng)給出 “ 該類房間已滿,請選擇其它房間類型 ” 的提示信息。用戶提交訂單后,系統(tǒng)通過查詢編號(hào)語句返回給用戶與之對(duì)應(yīng)的訂單編號(hào)。 姓 名 房 類 價(jià) 格 數(shù) 量 總 價(jià) 圖 57 訂單查詢界面 設(shè)計(jì)實(shí)現(xiàn): sub aa(sender as object, e as eventargs) dim con as new sqlconnection(server=localhost。database=zz。uid=sa。pwd=123) dim con1 as new sqlconnection(server=localhost。database=zz。uid=sa。pwd=123) dim str,str1 as string str=select * from khxx where bianhao=amp。 amp。 dim cmd as new sqlmand(str,con) dim dr as sqldatareader= () =(bianhao) =(xm) =(ydjs) str1=select * from tj where taofangleixing=39。 amp。 trim((fjlx)) amp。 39。 =con1 =str1 dim dr1 as sqldatareader= ()