




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、.net程序設(shè)計(jì)(c#)大作業(yè)學(xué)生姓名:學(xué) 號:學(xué) 院:軟件學(xué)院專 業(yè):軟件工程題 目:房地產(chǎn)營銷管理系統(tǒng)成 績:指導(dǎo)教師: 2015年 12月 14 日1. 設(shè)計(jì)目的 作為房屋管理的一個(gè)輔助工具,該系實(shí)現(xiàn)了房屋管理的基本功能,如添加、刪除、修改住房信息,刪除、添加、修改客人信息等。2.設(shè)計(jì)內(nèi)容數(shù)據(jù)庫設(shè)計(jì)實(shí)體類實(shí)現(xiàn)界面設(shè)計(jì)實(shí)現(xiàn)數(shù)據(jù)訪問3. 需求描述房地產(chǎn)管理系統(tǒng)用于管理和維護(hù)房屋的基本信息,公司管理人員登錄系統(tǒng)后可以擁有該系統(tǒng)的所有功能,方便進(jìn)行內(nèi)部管理。 房地產(chǎn)管理系統(tǒng)4. 系統(tǒng)詳細(xì)分析設(shè)計(jì) 用戶管理 基礎(chǔ)管理 業(yè)務(wù)管理 客人管理 用戶管理 房屋信息管理刪除用戶信息增加用戶信息修改用戶信息查
2、詢用戶信息瀏覽用戶信息刪除客人信息增加客人信息刪除房屋信息增加房屋信息修改房屋信息 修改客人信息查詢客人信息瀏覽客人信息查詢房屋信息瀏覽房屋信息 圖一:系統(tǒng)功能設(shè)計(jì) 實(shí)體類 表示層 業(yè)務(wù)邏輯層 數(shù)據(jù)訪問層sql server 2008 數(shù)據(jù)庫 圖二:三層構(gòu)架 表一:客人信息表結(jié)構(gòu)客人編號姓名客人類型性別電話房屋編號入住時(shí)間guestidnamecategeryidsexmoblieroomidarrivetime intnvarchar(50)intnvarchar(50)nvarchar(50) intdatatime主鍵非空非空非空非空非空非空 表二:房屋信息表結(jié)構(gòu)房屋id房屋類型id房屋
3、狀態(tài)roomidtypeidstateintintnvarchar(50)主鍵非空非空 表三:房屋類型表結(jié)構(gòu)房屋類型idtypeid int主鍵房屋類型名typenamenvarchar(50)非空價(jià)格typepricemoney非空 表四:用戶表結(jié)構(gòu)userid用戶idint主鍵username用戶名nvarchar(50)非空password密碼nvarchar(50)非空代碼一: roomuser實(shí)體類的代碼using system;using system.collections.generic;using system.text;namespace homemanager.model
4、s serializable() /序列化 public class homeuser private int userid; /用戶id private string username=string.empty; /用戶名 private string password=string. /用戶密碼 public homeuser() public int userid get return this.userid; set this.userid = value; public string username get return this.username; set this.userna
5、me = value; public string password get return this.password; set this.password = value; 代碼二: guest實(shí)體類代碼using system;using system.collections.generic;using system.linq;using system.text;namespace homemanager.models serializable public class guest private int guestid; /客戶id public int guestid; get ret
6、urn this.userid; set this.userid=value; private string name; /客戶姓名 public string name get return name; set name=value; private int catagoryid; /客戶類型 public string password private string sex; /客戶性別 public string sex get return sex; set sex=value; private string moblie;/電話 public string moblie get re
7、turn moblie; set moblie=value; private int roomid; /房號編號 public int roomidget return roomid; set roomid=value; private datetime arrivetime; /入住時(shí)間 public datetime arrivetime get return arrivetime; set arrivetime=value; 代碼三: room實(shí)體類代碼using system;using system.collections.generic;using system.text;name
8、space homemanager.models serializable public class room #region protected members protected int roomid; /房間號id protected int typeid; /房間類型id protected string state=string.empty; /房間狀態(tài) #endregion #region public methods public room() #endregion #region public properties public int roomid get return ro
9、omid; set roomid = value; public int typeid get return typeid; set typeid = value; public string state getreturn state; setstate = value; #endregion 代碼四:roomtype實(shí)體類代碼using system;using system.collections.generic;using system.text;namespace homemanager.models serializable public class roomtype #regio
10、n protected members protected int typeid; /房間類型id protected string typename = string.empty; /房間名稱 protected decimal typeprice; /房間價(jià)格 #endregion #region public methods public roomtype() #endregion #region public properties public int typeid get return typeid; set typeid = value; public string typenam
11、e get return typename; set typename = value; public decimal typeprice get return typeprice; set typeprice = value; #endregion 代碼五:登錄界面代碼using system;using system.collections.generic;using system.componentmodel;using system.data;using system.drawing;using system.linq;using system.text;using system.wi
12、ndows.forms;namespace windowsformsapplication1 public partial class 登錄 : form public 登錄() initializecomponent(); private void label1_click(object sender, eventargs e) private void form1_load(object sender, eventargs e) private void textbox1_textchanged(object sender, eventargs e) private void button
13、1_click(object sender, eventargs e) if (textbox1.text = dummy & textbox2.text = 123456) 房屋銷售管理系統(tǒng) f = new 房屋銷售管理系統(tǒng)(); f.show(); messagebox.show(登錄成功); private void button2_click(object sender, eventargs e) this.hide(); 圖三:登錄界面代碼六:program.csusing system;using system.collections.generic;using system.li
14、nq;using system.windows.forms;namespace windowsformsapplication1 static class program / / 應(yīng)用程序的主入口點(diǎn)。 / stathread static void main() application.enablevisualstyles(); application.setcompatibletextrenderingdefault(false); application.run(new 登錄(); 代碼七:房屋管理代碼homemanager.csusing system;using system.coll
15、ections.generic;using system.componentmodel;using system.data;using system.drawing;using system.text;using system.windows.forms;using homemanager.models;using homemanager.bll;using system.text.regularexpressions;/* * 類名:roomtypesettingform * 創(chuàng)建日期:2015-12-10 * 功能描述:提供房屋類型信息設(shè)置功能 * */namespace homemana
16、ger public partial class roomtypesettingform : form #region private members roomtype roomtype = new roomtype(); string typeid = string.empty; #endregion #region public methods public roomtypesettingform() initializecomponent(); / / 綁定房屋類型信息列表 / public void bindroomtypelist() /取消datagridview自動生成列功能 t
17、his.dgvroomtype.autogeneratecolumns = false; if (string.isnullorempty(this.txttypename.text.trim() this.dgvroomtype.datasource = roomtypemanager.getroomtypelist(); else this.dgvroomtype.datasource = roomtypemanager.getroomtypelistbytypename(this.txttypename.text.trim(); / / 隱藏編輯區(qū) / public void hidee
18、ditsection() /將窗體高度設(shè)置為原始大小 this.height = ; /將編輯內(nèi)容設(shè)置為不可操作狀態(tài) this.txtaddbedprice.enabled = false; this.txtprice.enabled = false; this.txtremark.enabled = false; this.txttype.enabled = false; this.chkisaddbed.enabled = false; /隱藏編輯區(qū) this.pnlroomtypecontent.visible = false; / / 顯示編輯區(qū) / public void visib
19、leeditsection() /設(shè)置編輯內(nèi)容為可操作狀態(tài) this.txtaddbedprice.enabled = true; this.txtprice.enabled = true; this.txtremark.enabled = true; this.txttype.enabled = true; this.chkisaddbed.enabled = true; /設(shè)置內(nèi)容編輯區(qū) this.height = 498; this.pnlroomtypecontent.visible = true; / / 清空編輯區(qū) / public void cleareditsection()
20、this.txtaddbedprice.text =; this.txtprice.text = ; this.txtremark.text = ; this.txttype.text = ; this.chkisaddbed.checked = false; #endregion #region event handlers / / 搜索房屋類型信息 / private void btnquery_click(object sender, eventargs e) /通過類型名稱得到類型列表 bindroomtypelist(); / / 新增房屋類型信息 / private void ts
21、btnadd_click(object sender, eventargs e) /顯示編輯區(qū) visibleeditsection(); /清空編輯區(qū) cleareditsection(); / / 修改屋房類型信息 / private void tsbtnmodify_click(object sender, eventargs e) if (string.isnullorempty(this.txttype.text) & string.isnullorempty(typeid) messagebox.show(沒有可修改信息,請選擇要修改的信息!, 提交提示, messageboxbu
22、ttons.ok, messageboxicon.information); else /現(xiàn)在編輯區(qū) visibleeditsection(); / / 刪除房類型信息 / private void tsbtndelete_click(object sender, eventargs e) if (!string.isnullorempty(typeid) & !string.isnullorempty(txttype.text.trim() /調(diào)用業(yè)務(wù)邏輯層客房信息刪除功能 dialogresult result = messagebox.show(您確實(shí)要?jiǎng)h除此信息嗎?, 提交提示, me
23、ssageboxbuttons.okcancel, messageboxicon.information); if (result = dialogresult.ok) roomtypemanager.deleteroomtypebytypeid(convert.toint32(typeid); /刷新房屋信息列表 bindroomtypelist(); messagebox.show(信息刪除成功!, 提交提示, messageboxbuttons.ok, messageboxicon.information); else messagebox.show(請選擇要?jiǎng)h除的信息!, 提交提示,
24、messageboxbuttons.ok, messageboxicon.information); / / 保存房類型信息 / private void tsbtnsave_click(object sender, eventargs e) if (string.isnullorempty(this.txttype.text) messagebox.show(類型名稱不能為空!, 提交提示, messageboxbuttons.ok, messageboxicon.information); return; if (iswholenumber(this.txtprice.text.trim(
25、) messagebox.show(請輸入有效的價(jià)格!, 提交提示, messageboxbuttons.ok, messageboxicon.information); return; /提示信息 string message = string.empty; /用實(shí)體對象封裝信息 roomtype.typename = this.txttype.text.trim(); roomtype.typeprice = convert.todecimal(this.txtprice.text.trim(); roomtype.addbedprice = convert.todecimal(this.
26、txtaddbedprice.text.trim(); if (this.chkisaddbed.checked) roomtype.isaddbed = 是; else roomtype.isaddbed = 否; roomtype.remark = this.txtremark.text.trim(); /調(diào)用業(yè)務(wù)邏輯房類型信息增加功能 message = roomtypemanager.addroomtype(roomtype).tostring(); /刷新房屋信息列表 bindroomtypelist(); /彈出提示信息框 messagebox.show(message, 提交提示
27、, messageboxbuttons.ok, messageboxicon.information); / / 取消內(nèi)容編輯區(qū) / private void tsbtncancle_click(object sender, eventargs e) /隱藏編輯區(qū) hideeditsection(); /清空編輯區(qū) cleareditsection(); / / 退出窗體 / private void tsbtnexit_click(object sender, eventargs e) this.close(); / / 窗體加載時(shí)執(zhí)行 / private void roomtypesett
28、ingform_load(object sender, eventargs e) /綁定房類型信息列表 bindroomtypelist(); / / 單擊房信息列表某行獲得客房類型 / private void dgvroomtype_cellclick(object sender, datagridviewcelleventargs e) /顯示編輯區(qū) this.pnlroomtypecontent.visible = true; this.height = 498; /獲取客房類型 typeid = dgvroomtype.rowse.rowindex.cellsid.value.tos
29、tring(); /調(diào)用業(yè)務(wù)邏輯層通過類型得到客房類型信息 roomtype = roomtypemanager.getroomtypebytypeid(convert.toint32(typeid); /回綁數(shù)據(jù) this.txttype.text = roomtype.typename.trim(); this.txtprice.text = convert.tostring(roomtype.typeprice); this.txtaddbedprice.text = convert.tostring(roomtype.addbedprice); if (roomtype.isaddbe
30、d.trim() = 是) this.chkisaddbed.checked = true; else this.chkisaddbed.checked = false; this.txtremark.text = roomtype.remark; / / 數(shù)字驗(yàn)證 / / 被驗(yàn)證信息 / public bool iswholenumber(string strnumber) regex notwholepattern = new regex(-?d+.?d*$); return notwholepattern.ismatch(strnumber, 0); #endregion 代碼八:用戶管
31、理usermanagerform.csusing system;using system.collections.generic;using system.componentmodel;using system.data;using system.drawing;using system.linq;using system.text;using system.windows.forms;using homemanager.models;using homemanager.bll;namespace homemanager public partial class usermanagerform
32、 : form private homeuser user; private int userid; public usermanagerform() initializecomponent(); / / 窗體載入時(shí) / / / private void usermanagerform_load(object sender, eventargs e) this.dgvuser.autogeneratecolumns = false; this.dgvuser.datasource = homeusermanager.getallhotelusers(); this.pnlusercontent
33、.visible = false; / / 單擊新增按鈕事件處理/ private void tsbtnadd_click(object sender, eventargs e) this.pnlusercontent.visible = true; this.txtname.text = ; this.txtpwd.text = ; / / 保存按鈕單擊事件處理 / / / private void tsbtnsave_click(object sender, eventargs e) /檢驗(yàn)用戶名和密碼框是否為空 if (string.isnullorempty(this.txtname.
34、text) messagebox.show(用戶名不能為空!, 提交提示, messageboxbuttons.ok, messageboxicon.information); return; if (string.isnullorempty(this.txtpwd.text) messagebox.show(密碼不能為空!, 提交提示, messageboxbuttons.ok, messageboxicon.information); return; /實(shí)體對象賦值 user.username = this.txtname.text.trim(); user.password = this
35、.txtpwd.text.trim(); if (homeusermanager.addhomeuser(user) /刷新顯示 this.dgvuser.datasource = homeusermanager.getallhomeusers(); messagebox.show(保存成功); else messagebox.show(用戶已經(jīng)存在); / / 修改用戶信息/ / / private void tsbtnmodify_click(object sender, eventargs e) if (userid = 0) messagebox.show(請選擇修改項(xiàng)目); retur
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年上半年安徽宣城旌德招聘勞務(wù)派遣人員11人易考易錯(cuò)模擬試題(共500題)試卷后附參考答案
- 2025年上半年安慶太湖縣事業(yè)單位招考(75人)易考易錯(cuò)模擬試題(共500題)試卷后附參考答案
- 2025年上半年寧夏建設(shè)投資集團(tuán)限公司長期引進(jìn)85人易考易錯(cuò)模擬試題(共500題)試卷后附參考答案
- 2025年頭孢類抗菌藥物項(xiàng)目合作計(jì)劃書
- 浙江鴨2025版高考?xì)v史大三輪復(fù)習(xí)非選擇題專練三人民版
- 高中語文情感美文秋風(fēng)吹組詩
- 江蘇專用版2025版高考語文二輪復(fù)習(xí)題型研訓(xùn)五修辭精練含解析
- 2024江蘇無錫市錫州產(chǎn)城控股集團(tuán)有限公司招聘錄用筆試參考題庫附帶答案詳解
- 2024年安徽民航機(jī)場集團(tuán)有限公司招聘34人筆試參考題庫附帶答案詳解
- 共享單車運(yùn)營承包協(xié)議范本
- 神經(jīng)源性腸道康復(fù)護(hù)理
- 家政人員安全知識
- 四年級全一冊《勞動與技術(shù)》第一單元活動3《學(xué)習(xí)使用家用電器》課件
- S7-200SMART系統(tǒng)手冊(中文)
- 成交量的趨勢拐點(diǎn)-99%精準(zhǔn)的秘密買點(diǎn)
- 跨境車輛代購協(xié)議書
- 《骨髓穿刺術(shù)》課件
- 2025屆湖北省高中名校聯(lián)盟高三上學(xué)期11月第二次聯(lián)合測評(圓創(chuàng)聯(lián)盟)語文試題
- DB41T2689-2024水利工程施工圖設(shè)計(jì)文件編制規(guī)范
- 生日宴快閃開場模板6
- 責(zé)任護(hù)理組長競選
評論
0/150
提交評論