c#语言房地产营销管理

上传人:1777****777 文档编号:39865651 上传时间:2021-11-12 格式:DOC 页数:29 大小:413.21KB
返回 下载 相关 举报
c#语言房地产营销管理_第1页
第1页 / 共29页
c#语言房地产营销管理_第2页
第2页 / 共29页
c#语言房地产营销管理_第3页
第3页 / 共29页
点击查看更多>>
资源描述
.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(请选择修改项目); 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(修改成功); / / 取消按钮单击事件 / / / private void tsbtnCancle_Click(object sender, EventArgs e) /隐藏编辑区 this.pnlUserContent.Visible = false; /清空编辑区 this.txtName.Text = ; this.txtPwd.Text = ; / / 退出按钮单击事件 / / / private void tsbtnExit_Click(object sender, EventArgs e) this.Close(); / / 删除按钮单击事件 / / / private void deleteToolStripButton_Click(object sender, EventArgs e) if (userid!=0) /调用业务逻辑层用户信息删除功能 DialogResult result = MessageBox.Show(您确实要删除此信息吗?, 提交提示, MessageBoxButtons.OKCancel, MessageBoxIcon.Information); if (result = DialogResult.OK) HomeUserManager.DeleteHomeUserById(userid); /刷新用户信息列表 this.dgvUser.DataSource = HomeUserManager.GetAllHomeUsers(); MessageBox.Show(信息删除成功!, 提交提示, MessageBoxButtons.OK, MessageBoxIcon.Information); else MessageBox.Show(请选择要删除的信息!, 提交提示, MessageBoxButtons.OK, MessageBoxIcon.Information); /private void dgvUser_CellClick(object sender, DataGridViewCellEventArgs e) / / /显示编辑区 / this.pnlUserCont
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 图纸设计 > 任务书类


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!