c語言房地產(chǎn)營(yíng)銷管理_第1頁
c語言房地產(chǎn)營(yíng)銷管理_第2頁
c語言房地產(chǎn)營(yíng)銷管理_第3頁
c語言房地產(chǎn)營(yíng)銷管理_第4頁
c語言房地產(chǎn)營(yíng)銷管理_第5頁
已閱讀5頁,還剩24頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

1、.net程序設(shè)計(jì)(c#)大作業(yè)學(xué)生姓名:學(xué) 號(hào):學(xué) 院:軟件學(xué)院專 業(yè):軟件工程題 目:房地產(chǎn)營(yíng)銷管理系統(tǒng)成 績(jī):指導(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)客人編號(hào)姓名客人類型性別電話房屋編號(hào)入住時(shí)間guestidnamecategeryidsexmoblieroomidarrivetime intnvarchar(50)intnvarchar(50)nvarchar(50) intdatatime主鍵非空非空非空非空非空非空 表二:房屋信息表結(jié)構(gòu)

3、房屋id房屋類型id房屋狀態(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 homem

4、anager.models 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

5、 this.username = 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 gues

6、tid; get return 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 m

7、oblie get return moblie; set moblie=value; private int roomid; /房號(hào)編號(hào) 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 syst

8、em.text;namespace homemanager.models serializable public class room #region protected members protected int roomid; /房間號(hào)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 g

9、et return roomid; 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 roo

10、mtype #region 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 st

11、ring typename 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;usi

12、ng system.windows.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

13、 void button1_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.csusin

14、g system;using system.collections.generic;using system.linq;using system.windows.forms;namespace windowsformsapplication1 static class program / <summary> / 應(yīng)用程序的主入口點(diǎn)。 / </summary> stathread static void main() application.enablevisualstyles(); application.setcompatibletextrenderingdefaul

15、t(false); application.run(new 登錄(); 代碼七:房屋管理代碼homemanager.csusing system;using system.collections.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.regularexpression

16、s;/* * 類名:roomtypesettingform * 創(chuàng)建日期:2015-12-10 * 功能描述:提供房屋類型信息設(shè)置功能 * */namespace homemanager public partial class roomtypesettingform : form #region private members roomtype roomtype = new roomtype(); string typeid = string.empty; #endregion #region public methods public roomtypesettingform() initi

17、alizecomponent(); / <summary> / 綁定房屋類型信息列表 / </summary> public void bindroomtypelist() /取消datagridview自動(dòng)生成列功能 this.dgvroomtype.autogeneratecolumns = false; if (string.isnullorempty(this.txttypename.text.trim() this.dgvroomtype.datasource = roomtypemanager.getroomtypelist(); else this.dgv

18、roomtype.datasource = roomtypemanager.getroomtypelistbytypename(this.txttypename.text.trim(); / <summary> / 隱藏編輯區(qū) / </summary> public void hideeditsection() /將窗體高度設(shè)置為原始大小 this.height = ; /將編輯內(nèi)容設(shè)置為不可操作狀態(tài) this.txtaddbedprice.enabled = false; this.txtprice.enabled = false; this.txtremark.en

19、abled = false; this.txttype.enabled = false; this.chkisaddbed.enabled = false; /隱藏編輯區(qū) this.pnlroomtypecontent.visible = false; / <summary> / 顯示編輯區(qū) / </summary> public void visibleeditsection() /設(shè)置編輯內(nèi)容為可操作狀態(tài) this.txtaddbedprice.enabled = true; this.txtprice.enabled = true; this.txtremark.

20、enabled = true; this.txttype.enabled = true; this.chkisaddbed.enabled = true; /設(shè)置內(nèi)容編輯區(qū) this.height = 498; this.pnlroomtypecontent.visible = true; / <summary> / 清空編輯區(qū) / </summary> public void cleareditsection() this.txtaddbedprice.text ="" this.txtprice.text = "" this.

21、txtremark.text = "" this.txttype.text = "" this.chkisaddbed.checked = false; #endregion #region event handlers / <summary> / 搜索房屋類型信息 / </summary> private void btnquery_click(object sender, eventargs e) /通過類型名稱得到類型列表 bindroomtypelist(); / <summary> / 新增房屋類型信息 /

22、</summary> private void tsbtnadd_click(object sender, eventargs e) /顯示編輯區(qū) visibleeditsection(); /清空編輯區(qū) cleareditsection(); / <summary> / 修改屋房類型信息 / </summary> private void tsbtnmodify_click(object sender, eventargs e) if (string.isnullorempty(this.txttype.text) && string.is

23、nullorempty(typeid) messagebox.show("沒有可修改信息,請(qǐng)選擇要修改的信息!", "提交提示", messageboxbuttons.ok, messageboxicon.information); else /現(xiàn)在編輯區(qū) visibleeditsection(); / <summary> / 刪除房類型信息 / </summary> private void tsbtndelete_click(object sender, eventargs e) if (!string.isnulloremp

24、ty(typeid) && !string.isnullorempty(txttype.text.trim() /調(diào)用業(yè)務(wù)邏輯層客房信息刪除功能 dialogresult result = messagebox.show("您確實(shí)要?jiǎng)h除此信息嗎?", "提交提示", messageboxbuttons.okcancel, messageboxicon.information); if (result = dialogresult.ok) roomtypemanager.deleteroomtypebytypeid(convert.toin

25、t32(typeid); /刷新房屋信息列表 bindroomtypelist(); messagebox.show("信息刪除成功!", "提交提示", messageboxbuttons.ok, messageboxicon.information); else messagebox.show("請(qǐng)選擇要?jiǎng)h除的信息!", "提交提示", messageboxbuttons.ok, messageboxicon.information); / <summary> / 保存房類型信息 / </su

26、mmary> 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() messagebox.show("請(qǐng)輸入有效的價(jià)

27、格!", "提交提示", messageboxbuttons.ok, messageboxicon.information); return; /提示信息 string message = string.empty; /用實(shí)體對(duì)象封裝信息 roomtype.typename = this.txttype.text.trim(); roomtype.typeprice = convert.todecimal(this.txtprice.text.trim(); roomtype.addbedprice = convert.todecimal(this.txtaddb

28、edprice.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.sho

29、w(message, "提交提示", messageboxbuttons.ok, messageboxicon.information); / <summary> / 取消內(nèi)容編輯區(qū) / </summary> private void tsbtncancle_click(object sender, eventargs e) /隱藏編輯區(qū) hideeditsection(); /清空編輯區(qū) cleareditsection(); / <summary> / 退出窗體 / </summary> private void tsbt

30、nexit_click(object sender, eventargs e) this.close(); / <summary> / 窗體加載時(shí)執(zhí)行 / </summary> private void roomtypesettingform_load(object sender, eventargs e) /綁定房類型信息列表 bindroomtypelist(); / <summary> / 單擊房信息列表某行獲得客房類型 / </summary> private void dgvroomtype_cellclick(object sende

31、r, datagridviewcelleventargs e) /顯示編輯區(qū) this.pnlroomtypecontent.visible = true; this.height = 498; /獲取客房類型 typeid = dgvroomtype.rowse.rowindex.cells"id".value.tostring(); /調(diào)用業(yè)務(wù)邏輯層通過類型得到客房類型信息 roomtype = roomtypemanager.getroomtypebytypeid(convert.toint32(typeid); /回綁數(shù)據(jù) this.txttype.text = r

32、oomtype.typename.trim(); this.txtprice.text = convert.tostring(roomtype.typeprice); this.txtaddbedprice.text = convert.tostring(roomtype.addbedprice); if (roomtype.isaddbed.trim() = "是") this.chkisaddbed.checked = true; else this.chkisaddbed.checked = false; this.txtremark.text = roomtype.

33、remark; / <summary> / 數(shù)字驗(yàn)證 / </summary> / <param name="strnumber">被驗(yàn)證信息</param> / <returns></returns> public bool iswholenumber(string strnumber) regex notwholepattern = new regex("-?d+.?d*$"); return notwholepattern.ismatch(strnumber, 0); #end

34、region 代碼八:用戶管理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 u

35、sermanagerform : form private homeuser user; private int userid; public usermanagerform() initializecomponent(); / <summary> / 窗體載入時(shí) / </summary> / <param name="sender"></param> / <param name="e"></param> private void usermanagerform_load(objec

36、t sender, eventargs e) this.dgvuser.autogeneratecolumns = false; this.dgvuser.datasource = homeusermanager.getallhotelusers(); this.pnlusercontent.visible = false; / <summary>/ 單擊新增按鈕事件處理/ </summary> private void tsbtnadd_click(object sender, eventargs e) this.pnlusercontent.visible = tr

37、ue; this.txtname.text = "" this.txtpwd.text = "" / <summary> / 保存按鈕單擊事件處理 / </summary> / <param name="sender"></param> / <param name="e"></param> private void tsbtnsave_click(object sender, eventargs e) /檢驗(yàn)用戶名和密碼框是否為空 if (st

38、ring.isnullorempty(this.txtname.text) messagebox.show("用戶名不能為空!", "提交提示", messageboxbuttons.ok, messageboxicon.information); return; if (string.isnullorempty(this.txtpwd.text) messagebox.show("密碼不能為空!", "提交提示", messageboxbuttons.ok, messageboxicon.information)

39、; return; /實(shí)體對(duì)象賦值 user.username = this.txtname.text.trim(); user.password = this.txtpwd.text.trim(); if (homeusermanager.addhomeuser(user) /刷新顯示 this.dgvuser.datasource = homeusermanager.getallhomeusers(); messagebox.show("保存成功"); else messagebox.show("用戶已經(jīng)存在"); / <summary>

40、/ 修改用戶信息/ </summary>/ <param name="sender"></param>/ <param name="e"></param> private void tsbtnmodify_click(object sender, eventargs e) if (userid = 0) messagebox.show("請(qǐng)選擇修改項(xiàng)目"); return; user.username = this.txtname.text.trim(); user.password = this.txtpwd.text.trim(); user.userid = userid; homeusermanager.modifyhomeuser(user);/調(diào)用業(yè)務(wù)層添加用戶方法 this.dgvuser.datasource = homeusermanager.getallhomeusers(); messagebox.show("修改成功"); / <summary> / 取消按鈕單擊事件 / </summary> / <

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(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)論