【正文】
客房信息*/update ordform set ozt=39。 from ordform,liveorder where = and =lno /*修改預訂單信息*/insert into hordform select * from ordform where ozt=39。 /*將已入住的預訂單放入歷史*/delete from ordform where ozt=39。 /*清除已入住預訂單*/mitgoselect * from roominfoselect * from ordformgoexec ordformproc 39。exec ordformproc 39。select * from roominfoselect * from ordformgocreate proc liveorderproc lno varchar(36) /*收銀退房*/asbegin tranupdate liveorder set etime=getdate(),lzt=39。 where lno=lno update roominfo set kfzt=39。 from roominfo,liveorder where = and =lno /*修改客房狀態(tài)*/insert into hliveorder select * from liveorder where lno=lno /*導入歷史*/delete from liveorder where lno=lno /*清除入住單*/mitgoselect * from liveorderselect * from hliveordergoexec liveorderproc 39。goselect * from liveorderselect * from hliveorder select *from roominfo where rid=39。gocreate proc billproc lno varchar(36) /*計算應收款*/asbegin trandeclare total moneydeclare datecount intupdate liveorder set etime=getdate() where lno=lno /*設置離店時間*/select datecount=datediff(dd,btime,getdate()) from liveorder where lno=lno /*計算住店天數(shù)*/select total=0select total=datecount*(isnull(rprice,0)) from liveorder,bill,roomsp where = and = and lno=lno /*計算住店金額*/update bill set etime=getdate(),cust=total from bill,liveorder where = and lno=lno /*修改賬單*/mitgo select * from liveorderselect * from bill goexec billproc 39。goselect * from liveorderselect * from bill 數(shù)據(jù)庫的完整性和安全性 數(shù)據(jù)庫的完整性是指數(shù)據(jù)的正確性和相容性。 本系統(tǒng)中定義了表與表之間的聯(lián)系有助于實現(xiàn)完整性規(guī)則,一般在程序中實現(xiàn)具體的完整性控制。在數(shù)據(jù)庫系統(tǒng)中,大量的數(shù)據(jù)集中存放,而且為許多用戶直接共享,是寶貴的信息資源,系統(tǒng)的安全保護措施就顯得更為重要,它保護數(shù)據(jù)庫防止惡意的破壞和非法的存取。采用管理員表示和鑒定的方法實現(xiàn)數(shù)據(jù)庫的安全,此安全管理措施并不在前臺開發(fā)工具中實現(xiàn),而是在后臺數(shù)據(jù)庫中實現(xiàn)。服務器的安全也是通過用戶在登錄服務器時輸入合法的用戶名和密碼來實現(xiàn)的。沒有采用更加復雜的系統(tǒng)安全管理措施是因為本管理系統(tǒng)一般是應用在校園網(wǎng)中,采用安全管理措施主要是為了防止沒有修改權限的用戶無意間修改了數(shù)據(jù),因此采用用戶標識和鑒定的安全管理措施就能夠保障數(shù)據(jù)庫的安全性。一個從需求分析,概念結構設計,邏輯結構設計,物理設計,數(shù)據(jù)庫實施,數(shù)據(jù)庫運行與維護的完整過程。如:快速實現(xiàn)客人入住登記和賬務處理,減少客人住店及離店時的等待時間;準確實現(xiàn)客人預訂入住的要求,實現(xiàn)有效及有保障的前臺系統(tǒng)作業(yè);快速響應住宿客人的有關項目查詢要求;實現(xiàn)入住、消費、結賬一條龍服務,方便客人在店內(nèi)的各類消費要求;提供清晰、準確的各類明細報表、賬單,給客人留下良好的管理印象。不過,對于我們來說,編寫程序代碼是比較困難的一個步驟,如存儲過程的創(chuàng)建,觸發(fā)器的編寫,由于平時上課,這些內(nèi)容也不是掌握的很好,這次在課程設計過程中遇到了許多問題。但是由于時間有限,自己的能力也有限,系統(tǒng)還是有些不足之處,有些小問題的出現(xiàn),以后會努