




已阅读5页,还剩10页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
.net程序设计(c#)大作业学生姓名:学 号:学 院:软件学院专 业:软件工程题 目:房地产营销管理系统成 绩:指导教师: 2015年 12月 14 日271. 设计目的 作为房屋管理的一个辅助工具,该系实现了房屋管理的基本功能,如添加、删除、修改住房信息,删除、添加、修改客人信息等。2.设计内容数据库设计实体类实现界面设计实现数据访问3. 需求描述房地产管理系统用于管理和维护房屋的基本信息,公司管理人员登录系统后可以拥有该系统的所有功能,方便进行内部管理。 房地产管理系统4. 系统详细分析设计 用户管理 基础管理 业务管理 客人管理 用户管理 房屋信息管理删除用户信息增加用户信息修改用户信息查询用户信息浏览用户信息删除客人信息增加客人信息删除房屋信息增加房屋信息修改房屋信息 修改客人信息查询客人信息浏览客人信息查询房屋信息浏览房屋信息 图一:系统功能设计 实体类 表示层 业务逻辑层 数据访问层sql server 2008 数据库 图二:三层构架 表一:客人信息表结构客人编号姓名客人类型性别电话房屋编号入住时间guestidnamecategeryidsexmoblieroomidarrivetime intnvarchar(50)intnvarchar(50)nvarchar(50) intdatatime主键非空非空非空非空非空非空 表二:房屋信息表结构房屋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 homemanager.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 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 guestid; 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 moblie 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 system.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 get 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 roomtype #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 string 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;using 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 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.csusing system;using system.collections.generic;using system.linq;using system.windows.forms;namespace windowsformsapplication1 static class program / / 应用程序的主入口点。 / stathread static void main() application.enablevisualstyles(); application.setcompatibletextrenderingdefault(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.regularexpressions;/* * 类名: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() initializecomponent(); / / 绑定房屋类型信息列表 / public void bindroomtypelist() /取消datagridview自动生成列功能 this.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(); / / 隐藏编辑区 / public void hideeditsection() /将窗体高度设置为原始大小 this.height = ; /将编辑内容设置为不可操作状态 this.txtaddbedprice.enabled = false; this.txtprice.enabled = false; this.txtremark.enabled = false; this.txttype.enabled = false; this.chkisaddbed.enabled = false; /隐藏编辑区 this.pnlroomtypecontent.visible = false; / / 显示编辑区 / public void visibleeditsection() /设置编辑内容为可操作状态 this.txtaddbedprice.enabled = true; this.txtprice.enabled = true; this.txtremark.enabled = true; this.txttype.enabled = true; this.chkisaddbed.enabled = true; /设置内容编辑区 this.height = 498; this.pnlroomtypecontent.visible = true; / / 清空编辑区 / public void cleareditsection() 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 tsbtnadd_click(object sender, eventargs e) /显示编辑区 visibleeditsection(); /清空编辑区 cleareditsection(); / / 修改屋房类型信息 / private void tsbtnmodify_click(object sender, eventargs e) if (string.isnullorempty(this.txttype.text) & string.isnullorempty(typeid) messagebox.show(没有可修改信息,请选择要修改的信息!, 提交提示, messageboxbuttons.ok, messageboxicon.information); else /现在编辑区 visibleeditsection(); / / 删除房类型信息 / private void tsbtndelete_click(object sender, eventargs e) if (!string.isnullorempty(typeid) & !string.isnullorempty(txttype.text.trim() /调用业务逻辑层客房信息删除功能 dialogresult result = messagebox.show(您确实要删除此信息吗?, 提交提示, messageboxbuttons.okcancel, messageboxicon.information); if (result = dialogresult.ok) roomtypemanager.deleteroomtypebytypeid(convert.toint32(typeid); /刷新房屋信息列表 bindroomtypelist(); messagebox.show(信息删除成功!, 提交提示, messageboxbuttons.ok, messageboxicon.information); else messagebox.show(请选择要删除的信息!, 提交提示, 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() messagebox.show(请输入有效的价格!, 提交提示, 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.txtaddbedprice.text.trim(); if (this.chkisaddbed.checked) roomtype.isaddbed = 是; else roomtype.isaddbed = 否; roomtype.remark = this.txtremark.text.trim(); /调用业务逻辑房类型信息增加功能 message = roomtypemanager.addroomtype(roomtype).tostring(); /刷新房屋信息列表 bindroomtypelist(); /弹出提示信息框 messagebox.show(message, 提交提示, messageboxbuttons.ok, messageboxicon.information); / / 取消内容编辑区 / private void tsbtncancle_click(object sender, eventargs e) /隐藏编辑区 hideeditsection(); /清空编辑区 cleareditsection(); / / 退出窗体 / private void tsbtnexit_click(object sender, eventargs e) this.close(); / / 窗体加载时执行 / private void roomtypesettingform_load(object sender, eventargs e) /绑定房类型信息列表 bindroomtypelist(); / / 单击房信息列表某行获得客房类型 / private void dgvroomtype_cellclick(object sender, datagridviewcelleventargs e) /显示编辑区 this.pnlroomtypecontent.visible = true; this.height = 498; /获取客房类型 typeid = dgvroomtype.rowse.rowindex.cellsid.value.tostring(); /调用业务逻辑层通过类型得到客房类型信息 roomtype = roomtypemanager.getroomtypebytypeid(convert.toint32(typeid); /回绑数据 this.txttype.text = roomtype.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.remark; / / 数字验证 / / 被验证信息 / public bool iswholenumber(string strnumber) regex notwholepattern = new regex(-?d+.?d*$); return notwholepattern.ismatch(strnumber, 0); #endregion 代码八:用户管理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 : form private homeuser user; private int userid; public usermanagerform() initializecomponent(); / / 窗体载入时 / / / private void usermanagerform_load(object sender, eventargs e) this.dgvuser.autogeneratecolumns = false; this.dgvuser.datasource = homeusermanager.getallhotelusers(); this.pnlusercontent.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) /检验用户名和密码框是否为空 if (string.isnullorempty(this.txtname.text) messagebox.show(用户名不能为空!, 提交提示, messageboxbuttons.ok, messageboxicon.information); return; if (string.isnullorempty(this.txtpwd.text) messagebox.show(密码不能为空!, 提交提示, messageboxbuttons.ok, messageboxicon.information); 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(用户已经存在); / / 修改用户信息/ / / private void tsbtnmodify_click(object sender, eventargs e) if (userid = 0) messagebox.show(请选择修改项目);
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 《唐代诗歌鉴赏方法与技巧的教学教案》
- 《物理力学基础概念:初二物理力学入门教案》
- 《中华文学经典:《红楼梦》文学赏析教学》
- 值得七年级作文600字7篇范文
- 青春词与古文风:高中文言文教学对比教案
- 摄影比赛活动方案
- 以核心素养为导向的初中历史故事讲解教案
- 公交公司筹款活动方案
- 钻孔桩劳务分包合同
- 公众号开业活动方案
- 广东省珠海市文园中学2025届七下数学期末质量跟踪监视试题含解析
- 高二日语考试试卷及答案
- 钢结构安装施工记录 - 副本
- 超市食品安全管理制度手册
- 海鲜水饺供货合同协议
- 非财务人员的财务管理方法与案例
- 2025+CSCO淋巴瘤诊疗指南解读课件
- 统编版语文六年级上册第三单元大单元整体教学设计
- 山东临沂历年中考作文题与审题指导(2005-2023)
- 2024年幽门螺杆菌感染基层诊疗指南讲座课件
- 2025-2030中国助听器、植入物和诊断设备行业市场发展趋势与前景展望战略研究报告
评论
0/150
提交评论