c语言房地产营销管理_第1页
c语言房地产营销管理_第2页
c语言房地产营销管理_第3页
c语言房地产营销管理_第4页
c语言房地产营销管理_第5页
已阅读5页,还剩24页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、.net程序设计(c#)大作业学生姓名:学 号:学 院:软件学院专 业:软件工程题 目:房地产营销管理系统成 绩:指导教师: 2015年 12月 14 日1. 设计目的 作为房屋管理的一个辅助工具,该系实现了房屋管理的基本功能,如添加、删除、修改住房信息,删除、添加、修改客人信息等。2.设计内容数据库设计>实体类实现>界面设计>实现数据访问3. 需求描述房地产管理系统用于管理和维护房屋的基本信息,公司管理人员登录系统后可以拥有该系统的所有功能,方便进行内部管理。 房地产管理系统4. 系统详细分析设计 用户管理 基础管理 业务管理 客人管理 用户管理 房屋信息管理删除用户信息增

2、加用户信息修改用户信息查询用户信息浏览用户信息删除客人信息增加客人信息删除房屋信息增加房屋信息修改房屋信息 修改客人信息查询客人信息浏览客人信息查询房屋信息浏览房屋信息 图一:系统功能设计 实体类 表示层 业务逻辑层 数据访问层sql server 2008 数据库 图二:三层构架 表一:客人信息表结构客人编号姓名客人类型性别电话房屋编号入住时间guestidnamecategeryidsexmoblieroomidarrivetime intnvarchar(50)intnvarchar(50)nvarchar(50) intdatatime主键非空非空非空非空非空非空 表二:房屋信息表结构

3、房屋id房屋类型id房屋状态roomidtypeidstateintintnvarchar(50)主键非空非空 表三:房屋类型表结构房屋类型idtypeid int主键房屋类型名typenamenvarchar(50)非空价格typepricemoney非空 表四:用户表结构userid用户idint主键username用户名nvarchar(50)非空password密码nvarchar(50)非空代码一: roomuser实体类的代码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实体类代码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; /房号编号 public int roomidget return roomid; set roomid=value; private datetime arrivetime; /入住时间 public datetime arrivetime get return arrivetime; set arrivetime=value; 代码三: room实体类代码using system;using system.collections.generic;using syst

8、em.text;namespace homemanager.models serializable public class room #region protected members protected int roomid; /房间号id protected int typeid; /房间类型id protected string state=string.empty; /房间状态 #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实体类代码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; /房间价格 #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") 房屋销售管理系统 f = new 房屋销售管理系统(); 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> / 应用程序的主入口点。 / </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 * 创建日期:2015-12-10 * 功能描述:提供房屋类型信息设置功能 * */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自动生成列功能 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> / 隐藏编辑区 / </summary> public void hideeditsection() /将窗体高度设置为原始大小 this.height = ; /将编辑内容设置为不可操作状态 this.txtaddbedprice.enabled = false; this.txtprice.enabled = false; this.txtremark.en

19、abled = false; this.txttype.enabled = false; this.chkisaddbed.enabled = false; /隐藏编辑区 this.pnlroomtypecontent.visible = false; / <summary> / 显示编辑区 / </summary> public void visibleeditsection() /设置编辑内容为可操作状态 this.txtaddbedprice.enabled = true; this.txtprice.enabled = true; this.txtremark.

20、enabled = true; this.txttype.enabled = true; this.chkisaddbed.enabled = true; /设置内容编辑区 this.height = 498; this.pnlroomtypecontent.visible = true; / <summary> / 清空编辑区 / </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) /显示编辑区 visibleeditsection(); /清空编辑区 cleareditsection(); / <summary> / 修改屋房类型信息 / </summary> private void tsbtnmodify_click(object sender, eventargs e) if (string.isnullorempty(this.txttype.text) && string.is

23、nullorempty(typeid) messagebox.show("没有可修改信息,请选择要修改的信息!", "提交提示", messageboxbuttons.ok, messageboxicon.information); else /现在编辑区 visibleeditsection(); / <summary> / 删除房类型信息 / </summary> private void tsbtndelete_click(object sender, eventargs e) if (!string.isnulloremp

24、ty(typeid) && !string.isnullorempty(txttype.text.trim() /调用业务逻辑层客房信息删除功能 dialogresult result = messagebox.show("您确实要删除此信息吗?", "提交提示", 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("请选择要删除的信息!", "提交提示", 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("请输入有效的价

27、格!", "提交提示", messageboxbuttons.ok, messageboxicon.information); return; /提示信息 string message = string.empty; /用实体对象封装信息 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(); /调用业务逻辑房类型信息增加功能 message = roomtypemanager.addroomtype(roomtype).tostring(); /刷新房屋信息列表 bindroomtypelist(); /弹出提示信息框 messagebox.sho

29、w(message, "提交提示", messageboxbuttons.ok, messageboxicon.information); / <summary> / 取消内容编辑区 / </summary> private void tsbtncancle_click(object sender, eventargs e) /隐藏编辑区 hideeditsection(); /清空编辑区 cleareditsection(); / <summary> / 退出窗体 / </summary> private void tsbt

30、nexit_click(object sender, eventargs e) this.close(); / <summary> / 窗体加载时执行 / </summary> private void roomtypesettingform_load(object sender, eventargs e) /绑定房类型信息列表 bindroomtypelist(); / <summary> / 单击房信息列表某行获得客房类型 / </summary> private void dgvroomtype_cellclick(object sende

31、r, datagridviewcelleventargs e) /显示编辑区 this.pnlroomtypecontent.visible = true; this.height = 498; /获取客房类型 typeid = dgvroomtype.rowse.rowindex.cells"id".value.tostring(); /调用业务逻辑层通过类型得到客房类型信息 roomtype = roomtypemanager.getroomtypebytypeid(convert.toint32(typeid); /回绑数据 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> / 数字验证 / </summary> / <param name="strnumber">被验证信息</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> / 窗体载入时 / </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) /检验用户名和密码框是否为空 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; /实体对象赋值 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("用户已经存在"); / <summary>

40、/ 修改用户信息/ </summary>/ <param name="sender"></param>/ <param name="e"></param> private void tsbtnmodify_click(object sender, eventargs e) if (userid = 0) messagebox.show("请选择修改项目"); return; user.username = this.txtname.text.trim(); user.password = this.txtpwd.text.trim(); user.userid = userid; homeusermanager.modifyhomeuser(user);/调用业务层添加用户方法 this.dgvuser.datasource = homeusermanager.getallhomeusers(); messagebox.show("修改成功"); / <summary> / 取消按钮单击事件 / </summary> / <

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论