搜索
您的当前位置:首页房屋中介管理信息系统课程设计(完稿)[1]

房屋中介管理信息系统课程设计(完稿)[1]

时间:2022-01-31 来源:乌哈旅游
山东理工大学管理学院信管2008管理信息系统课程设计

管理信息系统课程设计

房屋中介管理信息系统

设计人:

信管0802班

战文 刘钊 丁磊 黄宇凡 张舜

时间:2011年2月28日

1

山东理工大学管理学院信管2008管理信息系统课程设计

第一章 引言

1.1房产中介管理信息系统的研究意义

新中国成立后,特别是改革开放以来,居民住房问题一直是一个很棘手的问题,国家对于这个问题一再地修改关于房地产方面的议案,特别是在上海等比较发达的地区出现炒房现象之后,国家对于房地产的问题更加重视了,所以在居民和买卖房屋之间起桥梁作用的房产中介等机构就愈发显得重要了,而与此同时,由于计算机的普及以及互联网的飞速发展,使得很多原来由人力来完成的工作可以借由计算机来实现,因此,房屋中介管理信息系统渐渐发展起来了。

房屋中介管理信息系统在全球范围内都得到了广泛的应用:在法国房屋中介利用该系统实现从帮助寻找客户到签约、管理等“一条龙”服务。在美国,随着计算机和互联网的发展,MLS(Multiple Listing Service即多重上市服务)的应用程序逐渐代替了纸张抄写房源信息的方法。数据库的特性与房中介的工作习惯、操作流程激发了软件工程师们对客户端的开发,房地产中介商可以在客户端进行数据的传输,同时可以通过互联网自动升级,避免了客户成本过多的投入。然而,在国内传统中介公司往往有成堆的文件需要人工去处理,信息的收集和更新非常缓慢,同时大量的信息也由于无法实现共享和深度开发而难以达到最优。传统的以手工登记为主的房屋中介信息管理方式,效率低下、出错率高,耗费了大量的时间和人力资源,而借助房屋中介管理信息系统,买卖房屋的顾客只需到房屋中介中心登记一下,留下相关信息,便可以得到顾客需要的消息,同时节省了人力。

随着科学技术的不断提高,计算机科学的日渐成熟,其强大的功能已为人们深刻认识,它已进入人类社会的各个领域并发挥着越来越重要的作用。作为计算机应用的一部分,使用计算机对房屋中介的信息进行管理,具有着手工管理所无法比拟的优点.例如:检索迅速、查找方便、可靠性高、存储量大、保密性好、寿命长、成本低等。这些优点能够极大地提高房屋中介和房地产公司营运的管理效率,也是中介和公司的科学化、正规化管理,与世界接轨的重要条件。

管理信息系统软件能使您的公司、中介或单位的生产效率,工作效率、管理水平有一个较大的提高,减少您不必要的浪费,使您对您的顾客信息的收集、房源的分配等做到心中有数,使您的决策、计划更科学、更合理,以适应当今竞争日趋激

2

山东理工大学管理学院信管2008管理信息系统课程设计

烈的环境。

管理信息系统从单位、中介到大型房产公司都是很必要的,它的内容对于买卖房屋的顾客和管理者来说都至关重要,所以房屋中介管理信息系统应该能够为用户提供充足的信息和快捷的查询手段。一直以来人们使用传统人工的方式管理文件档案,或者使用人工和电脑统计相结合的方式,这些管理方式存在着许多缺点,如:效率低、保密性差,易出错,另外时间一长,将产生大量的文件和数据,这对于查找、更新和维护都带来了不少的困难。

因此,开发这样一个房屋中介管理信息系统成为很有必要的事情,在下面的各章中我们将以开发一个房屋中介管理信息系统为例,谈谈其开发过程和所涉及到的问题及解决方法。

1.2房屋中介管理信息系统简介

1.2.1 背景

随着科学技术的快速发展,不论是小型房屋中介还是大型的房地产公司,需要分类和管理的信息具有多而杂的特点,而且,信息的更新速度比较快,中介或者公司的经营者都需要及时地对各种信息进行分类整理,以最快的速度找到满足客户需求的房源,避免不必要的损失。在这种背景下,传统的人工管理,已经不再适宜。本系统用于房屋中介对信息的管理,以提高信息管理的效率,减轻管理人员的劳动力度,使得管理步骤更加简化。

1.2.2 功能描述

房屋中介管理信息系统只要用于房产信息的管理,能让工作人员更方便的对买卖房屋的顾客资料进行整理并对房源进行分类,而对买卖房屋的顾客来说,这个系统可以快捷地让他们实现对房屋的需求。

对不同身份的用户实现不同的操作权限,加强信息管理的安全性。

表1-1

3

山东理工大学管理学院信管2008管理信息系统课程设计

用户类型 买房者 卖房者 管理员 权限描述 查询空闲房源,对中意房源报价,查询成交情况 发布房源,查询购买者意向,确认成交 查询买卖双方基本信息,查询房源情况,对卖房者登记的信息进行审核,并能根据房源情况进行分类统计 4

山东理工大学管理学院信管2008管理信息系统课程设计

第二章 可行性分析及系统需求

2.1系统可行性分析

开发.net方面的信息管理系统是一项复杂的系统工程,从70年代开始,人们逐渐认识到,为了保证在.net环境下运行的系统开发成功,必须采用工程化的系统开发方法,并研究出一些符合工程化标准的开发方法。这些方法旨在指导开发者进行信息化的系统开发,从而加快系统开发的速度、保证质量、以及降低开发成本。信息化的系统开发方法确实在开发实践中取得了一定的效果。作为我们在校即将毕业的毕业生来说,鉴于经验欠缺,时间仓促的实际情况;我们选择技术要求不高,软件规模小的小软件来做为设计题目比较适合。另外在软件数据结构方面,我们以管理方便的SQL Server作为程序后台数据支持。在软件安全方面来讲,一般的软件都包括了软件加密、软件注册、以及不同用户使用软件的安全管理功能。

1、可行性研究的前提要求:

功能:设计一套房屋中介管理信息系统,使信息管理系统化,完善化,高效化.设计方案的具体要求应包括如下几部分:

1)需求分析

2)功能实现(用户登录, 房源发布及查询, 房源的成交情况及查询,顾客以及房源信息的更新及删除等)

3)界面美观,性能:稳定快速,实时控制 4)输入/输出:汉字

5)安全与保密要求:不能轻易被破坏,不能让中介或公司管理员以外的人删改,对断电、死机、系统崩溃等问题有有力措施以保障数据不受损失。

2、可行性研究的方法:

通过调查分析开发实验室管理所具备的能力及实现的方法。确定总体结构,利用SQL Server数据库所具有的能力,以最简洁最容易的方法,使用C#使其成为一个初级的系统软件。

3、决定可行性的主要因素:

中介或公司规模、设备状况、操作人员技术。

5

山东理工大学管理学院信管2008管理信息系统课程设计

4、与原有操作方式比较的优越性:

比原方式操作简单易行,查询信息准,减少人力工作。

2.1.1经济上的可行性

现在,计算机的配件不断在更新,性能也变得越来越好,同时其价格正在逐渐下降。这次做的这个房屋中介管理信息系统,给房屋中介公司和顾客都带来了很大的方便,表现为以下几方面:

1、本系统的运行可以代替人工进行许多繁杂的劳动; 2、本系统的运行可以节省许多资源;

3、本系统的运行可以大大的提高中介的工作效率;

4、本系统的运行可以方便管理员对各种信息(员工、顾客以及房源等)进行分类统计和管理;

5、本系统可以保证各种信息(员工、顾客以及房源等)的安全。 所以本系统在经济上是可行的。

2.1.2 技术上可行性

本系统的开发利用Microsoft SQL Server2008R2作为本系统的数据库,它是一个关系型数据库,而且最基本的功能和SQL2005都一样,增加的都是扩展的功能,它是一个支持多用户的新型数据库适用于大中规模的数据量需求。

使用Visual Studio .NET作为系统开发的开发环境,它提供完善的指令控制语句、类与对象的支持及丰富的数据类型,给开发高性能系统提供的保障为开发满足客户要求的系统,保证了代码的模块化要求,而代码模块化的提高,非常有利于以后对新系统的扩展与修改。Visual Studio .NET 是一套完整的开发工具,用于生成 ASP Web 应用程序、XML Web services、桌面应用程序和移动应用程序。Visual Basic .NET、Visual C++ .NET、Visual C# .NET 和 Visual J# .NET 全都使用相同的集成开发环境 (IDE),该环境允许它们共享工具并有助于创建混合语言解决方案。另外,这些语言利用了 .NET Framework 的功能,此框架提供对简化 ASP Web 应用程序和 XML Web services 开发的关键技术的访问。

综上所述,本系统的设计与开发在技术上和硬件设备上的条件都是满足的,因此,它在技术上是可行的。

6

山东理工大学管理学院信管2008管理信息系统课程设计

2.1.3 运行可行性

本系统为房屋中介管理信息系统,所耗费的资源不大,学校的电脑无论是硬件还是软件都能够满足条件,因此,本系统在运行上是可行的。

2.2系统前台的设计

1、系统在功能上应在不同程度上实现以下几个方面的功能:

系统使用前必须先给用户授权,权限分:管理员权限和卖房者权限以及买房者权限;有关卖房者各种信息的输入,包括姓名,年龄,房源的描述,联系方式等;有关买房者各种信息的输入,包括姓名,年龄,对房源需求的描述,联系方式等;中介或公司工作人员管理的各种信息查询,修改和维护;房屋中介管理信息系统的使用帮助。

2、系统功能的模块设计

在系统功能分析基础上,考虑到程序的特点,编制系统功能模块图。

2.3系统设计使用的开发工具

在做系统时数据库的正常,平稳,安全很重要,而要做到这点,需要精心的设计及大量的时间。对于大的数据库开发平台,不但难于开发,有的对硬件要求还很高,而且也是浪费。因此,在选择开发工具的时候我作了很多考虑,因为现在,市场上可以选购的应用开发产品很多,流行的也有数十种,综合所有其优点和缺点,本系统使用Microsoft公司的Visual Studio 2010和Microsoft公司的SQL server 2008 R2作为开发工具。

2.4需求分析

2.4.1业务需求

随着计算计硬件和软件的发展,现代社会早已经进入信息化高速运行时代。计算机在各中行业和领域的应用也越来越广泛,对于房屋中介和一些大型的房地产公司也不例外。现代社会的房产信息管理也以进入系统化、信息化阶段。大量的库存

7

山东理工大学管理学院信管2008管理信息系统课程设计

信息管理和快节奏的更新速度是传统的管理方式显得力不从心,而使用计算机管理就成了惟一的解决方案,然而计算机的应用是需要强大的系统软件和行业软件来支持的,房产信息的管理亦不例外。所以开发出一款功能强大的房屋中介管理信息系统是软件支持的需要,更何况此系统既要是功能强大,也要要求操作简单,易实现。

所以,开发出一款功能强大,而又操作简洁、方便、快捷,适应用户要求的房屋中介管理信息系统是业务的需要。

2.4.2用户需求

1. 软件具有简洁美观的界面。

2. 操作简单、快捷,适合用户使用习惯。 3. 要求系统安全、稳定。

4. 要求能够注册多个用户,有不同的用户权限。 5. 要求能够方便的使用增删改查等功能。 6. 要求实现面向3个用户分别实现以下功能: 卖房者:发布房源,查询购买者意向,确认成交。

买房者:查询空闲房源,对中意房源报价,查询成交情况。

管理员:查询买卖双方基本信息,查询房源情况,对卖房者登记的信息进行审核,并能根据房源情况进行分类统计。

2.4.3功能需求

1. 2. 3. 4. 5. 6. 7. 8. 9.

创建系统用户、修该用户密码、设置用户权限。(权限说明详见表1-1) 卖房者发布房源。

卖房者查询购买者意向,确认成交。 买房者查询空闲房源。

买房者对中意房源报价,查询成交情况。 管理员查询买卖双方基本信息。 管理员查询房源情况。

管理员对卖房者登记的信息进行审核。 管理员根据房源情况进行分类统计。

8

山东理工大学管理学院信管2008管理信息系统课程设计

第三章 系统总体结构设计

3.1系统配置

3.1.1 SQL Server 2008 配置要求:

版本:SQL Server 2008 R2

处理器类型:Pentium III 兼容处理器或更高速度的处理器。 处理器速度:最低要求,500 MHz,建议1 GHz 或更高。

内存 (RAM):最小192 MB,最大为操作系统最大内存,建议512 MB 或更高。 SQL Server 安装程序安装该产品所需的以下软件组件:

  

Microsoft .NET Framework 4.0 Microsoft SQL Server Native Client Microsoft SQL Server 安装程序支持文件

3.1.2 Visual Studio 2010 配置要求:

处理器:600 MHz 处理器,建议1 GHz 处理器 RAM:192 MB,建议256 MB 可用硬盘空间: 不含 MSDN:

系统驱动器上需要 1 GB 的可用空间 安装驱动器上需要 2 GB 的可用空间 含 MSDN:

系统驱动器上需要 1 GB 的可用空间

完整安装 MSDN 的安装驱动器上需要 3.8 GB 的可用空间 默认安装 MSDN 的安装驱动器上需要 2.8 GB 的可用空间 操作系统:

Windows 2008 Service Pack 2

9

山东理工大学管理学院信管2008管理信息系统课程设计

视频:800 X 600,256 色 建议:1024 X 768,增强色 16 位 鼠标:Microsoft 鼠标或兼容的指针设备

3.2系统功能模块分析

根据系统需求分析,整个系统包括以下的6个基本模块:用户信息管理,求租管理,员工信息,出租管理,系统管理和帮助模块。如表3-1所示:

表3-1

3.2.1 系统功能模块划分

通过调查研究和以上对系统的分析,系统中6个功能模块所实现的主要功能如下:

1)用户信息管理:主要用于完成有关客户资料的各项信息的录入、查询、添加、删除、修改等对数据的更新和维护操作。该模块主要包括“出租者信息控制”、“求租者信息控制”、“人员信息控制”等功能。

2)求租管理:主要用于完成求租者或买房者的对已有房源信息的查询和设置等操作,另外若房源状态中没有买房者心仪的信息,她们则可以通过填写意向申请来提出自己的要求和条件。该模块主要包括“房源查询设置”、“求租意向设置”等功能。

3)员工信息:主要用于完成有关员工的各项信息的录入、查询、删除、修改等对数据的更新和维护操作。该模块主要包括“录入员工信息”、“所有员工信息查询”。

4)出租管理,成交管理:主要是针对出租者或卖房者在对各项信息进行录入时,遇到一些初始数据库中没有的数据,则可以通过改模块进行增删改。对于成交记录

10

山东理工大学管理学院信管2008管理信息系统课程设计

可以进行查询和修改,该模块主要包括“房型设置”、“幢/座设置”、“装修设置”、“楼层设置”、“朝向设置”、“用途设置”等功能。

5)系统管理模块:主要用于清除一些垃圾信息,同时可以安全快速的退出本系统。该模块模块包括“退出系统”、“清理无效文件”等功能。

6)帮助模块:该模块包括“帮助文件”窗口,密码修改,密码查询的功能,它的具体功能仍有待进一步的完善。

3.2.2 系统各模块功能图

以上分析说明可以用表3-2明确表示出各模块的功能:

表3-2

11

山东理工大学管理学院信管2008管理信息系统课程设计

3.3系统流程描述

整个系统分为两个部分,即登录部分、管理部分。

1、用户登录,如果登录成功,判断用户权限,给出相应的操作功能(见表1-1),进入管理部分。

2、进入管理部分,判断出用户权限,只激活相应的操作功能(见表1-1),进入操作功能选择既管理界面。所有的操作功能平行,各操作功能有:删除顾客信息、修改顾客信息、查询房源、确认成交等。

3.4系统结构及数据模块

在进行软件系统结构设计之前,我们首先要掌握好信息系统开发中常用的数据库技术以及常用的数据库控件。在编写数据库应用程序时,经常要遇到这样的情况,即好多组件、窗体同时访问相同的数据源,如果为每一个组件或者窗体都设置一个数据源将是十分耗时的工作。那么,能不能将这些数据源集中管理,最好是做成一个统一的模块,需要时就将该模块引入而不必直接操作数据源本身呢?使用数据模块(Data Module)是解决这个问题最好的方法。简单说来,数据模块是用来集中管理数据源的一个窗体,该窗体可被需要的地方随时引入,但在运行时不会在应用程序中显示出来。

由于本系统采用软件开发中常用的ADO技术来访问数据库;故在下面我们就以ADO技术介绍如下:ADO是为Microsoft最新和最强大的数据访问接口OLEDB而设计的,是一个便于使用的应用程序层。OLEDB为任何数据源提供了高性能的访问,而这些数据源包括关系和非关系数据库、电子邮件、文件系统、文本和图形以及自定义的业务对象等。ADO在关键的Internet方案中使用最少的网络流量,并且在前端和数据源之间使用最少的层数,所有这些都是为了提供轻量、高性能的接口。同时ADO使用了与ADO相似的约定和特性,使得它更易于学习。 现先介绍一下本软件开发中用到的ADO技术访问数据库的方法和特点。

用ADO访问数据库的特点可概括如下:

第一,易于使用,可以说这是最重要的特点之一。由于ADO是高层数据库访问技术,所以相对于ODBC来说,具有面向对象的特点。同时,ADO对象结构中,对

12

山东理工大学管理学院信管2008管理信息系统课程设计

象与对象之间的层次结构不是非常的明显,这会给编写数据库程序带来很多便利,比如,在应用程序中如果要使用记录集对象,就不一定要先建立连接、会话对象,如果需要就可以直接构造记录集对象。总之,已经没有必要去关心对象的构造层次和构造顺序了。第二,可以访问多种数据源。这一点是和OLEDB一样的,使应用程序有很好的通用性和灵活性。第三,访问数据源效率高。这是由于ADO本身就是基于OLEDB的接口,自然就具有OLEDB的特点。第四,方便地Web应用。ADO可以以ActiveX控件的形式出现,这就大大方便了Web应用程序的编制。第五,技术编程接口丰富。ADO支持Visual C++、Visual Basic、Visual J++以及Vbscript和Javascript等脚本语言。

3.5 ADO的对象

ADO包含了连接对象(Connection)、命令对象(Command)、记录集对象(Recordset)、字段对象(Field)、参数对象(Parameter)、错误对象(Error)、属性对象(Property)和集合与事件等。

1、连接(Connection)

用于表示和数据源的连接,以及处理一些命令和事物。通过它可以从应用程序访问数据源,是交换数据所必需的环境。

2、命令(Command)

用于执行某些命令来进行诸如查询、修改数据库结构的操作。 3、记录集(Recordset)

用于处理数据源的表格集,它是在表中修改、检索数据的最主要的方法。 4、字段(Field)

用于描述数据集中的列的信息。 5、参数(Parameter)

用于传递给数据源的命令赋参数值 6、错误(Error)

用于承载所产生错误的详细信息。 7、属性(Properties)

通过属性,每个ADO对象借此,来让用户描述和控制自身的行为。

13

山东理工大学管理学院信管2008管理信息系统课程设计

8、集合(Set)

集合是一种可方便地包含其他特殊对象类型。ADO提供4种类型的集合: Connection对象具有Error集合。 Command对象具有Parameters集合。 cordset对象具有Fields集合。

Connection、Command、Recordset、Field对象都具有Properties集合。 9、事件(Event)

事件模型是异步操作的基础,这是ADO2.0引进的新特性。

14

山东理工大学管理学院信管2008管理信息系统课程设计

第四章 数据库设计

4.1数据库需求分析

通过对整个系统的分析,可以列出以下整个系统所需要数据表的结构:  客户资料:账号,姓名,性别,生日,手机,家庭电话,邮箱,银行卡号,

用户类型,房屋编号,注册日期等。

 员工资料:姓名,性别,生日,手机,银行卡号,住址,民族,学历,基本

工资等。

 房源资料:房屋编号,房屋类型,房屋位置(栋/幢),房屋状态,房屋装修

情况,房屋朝向,房屋用途,房屋所在地图,房屋价格,房屋所在楼层,房屋年限,房屋面积,房屋备注,业主编号等。

 意向资料:用户账号,房屋类型,房屋位置(栋/幢),房屋所在楼层,房屋

朝向,房屋用途,房屋价格,房屋面积等。

 付款管理:应付款额,经手人编号,经手人姓名,房屋编号,付款日期,卖

房者编号,卖房者姓名,卖房者联系电话,买房者编号,买房者姓名,买房者联系电话等。

4.2数据库设计

在设计数据库的表的时候,因为考虑到在系统运行时,可能会出现有些用户的需求会超出数据库库中数据之外,从而导致不能登记正确完整的信息,所以数据库中一共30个表左右,每个表都是独立存在的,没有外界关联的,而且每个表都有自己的主键,所以,基本上每个表都可以实现直接在该表上进行增删改查四种操作,如:房源所在楼层为10,而在tb_floor(楼层信息表)的初始数据中并没有10,由于这种单独的设计,用户可以再在表中增加数据10,以实现正确完整的输入自己的房源信息,既方便又准确。

15

山东理工大学管理学院信管2008管理信息系统课程设计

4.3 E-R模型图

1、实体及其属性

16

山东理工大学管理学院信管2008管理信息系统课程设计

17

山东理工大学管理学院信管2008管理信息系统课程设计

图4-1 主要实体及其属性

2、E-R图

图4-2 数据库的E-R图

18

山东理工大学管理学院信管2008管理信息系统课程设计

4.4创建数据库和表

t创建数据库和表

操作用户数据库

列 名 用户名称 用户姓名 所在部门 联系电话 职责电话 资料管理之房源字典 资料管理之公司职员 资料管理之业务资料 房源管理之出售房屋 房源管理之出租房屋 房屋管理之查询可售 房源管理之查询可租 客源管理之求购客户 客源管理之求租客户 客源管理之查询求购 客源管理之查询求租 成交管理之广告发布 成交管理之经济跟踪 成交管理之租售成本 成交管理之查询售源 成交管理之查询租源 系统管理之分配用处 系统管理之公司信誉 数据类型 nvarchar(50) nvarchar(50) nvarchar(50) nvarchar(50) nvarchar(50) int int int int int int int int int int int int int int int int int int 是否为空 否 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 19

山东理工大学管理学院信管2008管理信息系统课程设计

Membership表

20

山东理工大学管理学院信管2008管理信息系统课程设计

列 名 ApplicationId UserId Password PassworFormat PasswordSalt MobilePIN Email LoweredEmail PasswordQuestion PasswordAnswer IsApproved IsLockedOur CreateDate LastLoginDate LastPasswordChange„ LasrLockOutDate 数据类型 uniqueidentifier uniqueidentifier nvarchar(128) int nvarchar(128) nvarchar(16) nvarchar(256) nvarchar(256) nvarchar(256) nvarchar(128) bit bit datetime datetime datetime datetime int datetime int datetime 21 是否为空 是 是 是 是 FailedPassword„ FailedPassword„ FailedPassword„ FailedPassword„ Conment 是 ntext 山东理工大学管理学院信管2008管理信息系统课程设计

用户信息表

列 名 ApplicationId UserId UserName LowerdUserName MobileAlias IsAnonymous LastActivityDate 数据类型 uniqueidentifier uniqueidentifier nvarchar(256) nvarchar(256) nvarchar(16) bit datetime 求购客户表

是否为空 是 22

列名 数据类型 是否为空 客源编号 nvarchar(20) 否 山东理工大学管理学院信管2008管理信息系统课程设计 客源姓名 客源性别 最大面积 委托日期 最小面积 最高购价 付款方式 最大房间数 最低购价 装修要求 最小房间数 配套设施 家具家电 具体位置 朝向要求 楼层类型 楼层结构 所在城区 客户地址 邮政编码 客源电话 电子邮箱 nvarchar(10) nvarchar(10) nvarchar(20) nvarchar(50) nvarchar(100) nvarchar(10) nvarchar(10) nvarchar(10) nvarchar(10) nvarchar(100) nvarchar(10) nvarchar(150) nvarchar(10) nvarchar(10) int int float float varchar(50) float float 23 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 datetime 山东理工大学管理学院信管2008管理信息系统课程设计

求租客户表

24

列名 数据类型 是否为空 客源编号 nvarchar(20) 否 山东理工大学管理学院信管2008管理信息系统课程设计 客源姓名 客源性别 客源电话 电子邮箱 客户地址 邮政编码 电梯要求 所在城区 具体位置 配套设施 家具家电 装修级别 房龄要求 最小房间数 最大面积 最低物管费 最高物管费 付款方式 最小面积 最高租价 最大房间数 最低租价 nvarchar(10) nvarchar(10) nvarchar(20) nvarchar(50) nvarchar(150) nvarchar(10) int nvarchar(10) nvarchar(150) nvarchar(50) nvarchar(50) nvarchar(50) nvarchar(50) int int float float nvarchar(10) float float float float 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 25 山东理工大学管理学院信管2008管理信息系统课程设计

业务资料表

列 名 资料编号 资料类别 资料(业务资料表) 标题 补充说明 内容摘要 原始文件名 数据类型 nvarchar(20) nvarchar(50) nvarchar(50) nvarchar(250) nvarchar(500) nvarchar(100) 房源参数表

是否为空 是 是 是 是 是

26

列名 数据类型 是否为空 自编号 nvarchar(50) 否 山东理工大学管理学院信管2008管理信息系统课程设计 城区 类型 公交 环境 用途 结构 土地 证件 朝向 配置 家具 装修 家电 付款 货币 付佣 来源 委托 产权 状态 铺型 适应行业 nvarchar(500) nvarchar(500) nvarchar(500) nvarchar(500) nvarchar(500) nvarchar(500) nvarchar(500) nvarchar(500) nvarchar(500) nvarchar(500) nvarchar(500) nvarchar(500) nvarchar(500) nvarchar(500) nvarchar(500) nvarchar(500) nvarchar(500) nvarchar(500) nvarchar(500) nvarchar(500) nvarchar(500) 27 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 nvarchar(500) 山东理工大学管理学院信管2008管理信息系统课程设计

出租房源

28

山东理工大学管理学院信管2008管理信息系统课程设计

列 名 房源编号 所在城区 具体位置 楼盘名称 配套环境 电梯 房 厅 厨 卫 阳 朝向 物管费 楼层类型 数据类型 nvarchar(20) nvarchar(10) nvarchar(50) nvarchar(50) nvarchar(100) int int int int int int nvarchar(10) float nvarchar(10) nvarchar(10) float float nvarchar(10) nvarchar(50) nvarchar(10) float 是否为空 否 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是

房屋结构 建筑面积 套内面积 装修级别 装修说明 付租方式 出租价格 押金 家私 家电 配套设施 车位 公钥 私钥 float nvarchar(100) nvarchar(100) nvarchar(100) nvarchar(50) int int 29 山东理工大学管理学院信管2008管理信息系统课程设计

租售成交表

列 名 自编号 经办人员 资料类型 资料编号 合同编号 数据类型 int nvarchar(10) nvarchar(20) nvarchar(20) nvarchar(20) datetime float nvarchar(10) float float nvarchar(10) nvarchar(20) nvarchar(20) nvarchar(50) nvarchar(150) nvarchar(250) 公司信息

是否为空 是 成交日期 成交金额 付款方式 客户佣金 业主佣金 客户姓名 身份证号码 联系电话 电子邮箱 合同文件 补充说明 是 是 是 是 是 是 是 是 是 是 是 30

山东理工大学管理学院信管2008管理信息系统课程设计

列 名 公司名称 法人代表 公司地址 邮政编码 服务电话 电子信箱 公司网站 首页图像 标志图标 系统名称 优先级 数据类型 nvarchar(50) nvarchar(50) nvarchar(50) nchar(10) nvarchar(50) nvarchar(50) nvarchar(50) nvarchar(50) nvarchar(50) nvarchar(50) int 职员信息表

是否为空 否 是 是 是 是 是 是 是 是 是 是 31

山东理工大学管理学院信管2008管理信息系统课程设计

列 名 职员编号 职员姓名 职员性别 职员学历 职员职务 所在部门 身份证号 出生日期 入职日期 婚姻状况 联系电话 家庭地址 邮政编码 电子邮箱 补充说明 工作简历 数据类型 nvarchar(20) nvarchar(10) nvarchar(10) nvarchar(10) nvarchar(10) nvarchar(10) nvarchar(20) datetime datetime nvarchar(10) nvarchar(20) nvarchar(150) nchar(10) nvarchar(50) nvarchar(150) nvarchar(500) 是否为空 是 是 是 是 是 是 是 是 是 是 是 是 是 是 是 经济跟进表

32

山东理工大学管理学院信管2008管理信息系统课程设计

列名 自编号 经办人员 资料类型 资料编号 跟进日期 跟进方式 跟进内容 补充说明 数据类型 int nvarchar(10) nvarchar(20) nvarchar(20) datetime nvarchar(20) nvarchar(500) nvarchar(150) 广告发布

是否为空 否 是 是 是 是 是 列 名 自编号 经办人员 资料类型 资料编号 发布媒体 媒体期号 发布日期 截止日期 广告价格 广告描述 补充说明 数据类型 int nvarchar(10) nvarchar(20) nvarchar(20) nvarchar(50) nvarchar(50) datetime datetime float nvarchar(500) nvarchar(150) 其他参数表

是否为空 否 否 否 否 否 是 是 是 是 是 是 33

山东理工大学管理学院信管2008管理信息系统课程设计

列名 自编号 职业 来源 客源状态 跟进方式 提成说明 收据类别 收款项目 数据类型 nvarchar(20) nvarchar(500) nvarchar(500) nvarchar(500) nvarchar(500) nvarchar(500) nvarchar(500) nvarchar(500) 是否为空 否 是 是 是 是 是 是 是 34

山东理工大学管理学院信管2008管理信息系统课程设计

第五章 系统详细设计

5.1登录窗体模块

首先设计好程序运行时系统加载的登录窗口,其运行效果如下图所示:

图5-1

本模块主要实现功能有:

1.直接从数据库表里获得管理员姓名,通过输入的密码和选择的用户类型正确与否来确定是否允许进入下一个主界面。

2.程序根据调用存储过程后返回的值来判断是否通过验证,以此来实现用户登录时账号密码和权限的验证。

3.业务流程图 如图5-2所示:

35

山东理工大学管理学院信管2008管理信息系统课程设计

图5-2 4.登录事件核心代码:

//文件名:Login.aspx.cs using System;

using System.Data;

using System.Configuration; using System.Collections; using System.Web;

using System.Web.Security; using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;

using System.Data.SqlClient;

public partial class System_Login : System.Web.UI.Page {

protected void Page_Load(object sender, EventArgs e) {

36

山东理工大学管理学院信管2008管理信息系统课程设计

string dd = \"\";

dd = Request.QueryString[\"Type\"] == null || Request.QueryString[\"Type\"] == string.Empty ? \"Login\" : Request.QueryString[\"Type\"].ToString().Trim(); if (dd == \"LoginOut\") {

Session.Clear(); Session.Abandon();

HttpContext.Current.Response.Write(\"\"); } }

protected void Login1_LoggedIn(object sender, EventArgs e) {

Session[\"MyUserName\"] = this.Login1.UserName;

System.Text.StringBuilder MyForbidString = new System.Text.StringBuilder(); MyForbidString.Append(\"禁止操作权限:A1A2A3B1B2B3B4C1C2C3C4D1D2D3D4D5E1E2\"); string MyConnectionString =

ConfigurationManager.ConnectionStrings[\"MyHouseDBConnectionString\"].ConnectionString; ;

string MySQL = \"Select * From 操作用户 Where 用户名称='\" + this.Login1.UserName + \"'\";

SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnectionString);

DataTable MyTable = new DataTable(); MyAdapter.Fill(MyTable); if (MyTable.Rows.Count > 0) {

if ((int)MyTable.Rows[0][\"资料管理之房源字典设置\"] == 1) {

MyForbidString.Replace(\"A1\是\"); }

if ((int)MyTable.Rows[0][\"资料管理之公司职员设置\"] == 1) {

MyForbidString.Replace(\"A2\是\"); }

if ((int)MyTable.Rows[0][\"资料管理之业务资料管理\"] == 1) {

MyForbidString.Replace(\"A3\是\"); }

if ((int)MyTable.Rows[0][\"房源管理之出售房源管理\"] == 1) {

37

山东理工大学管理学院信管2008管理信息系统课程设计

MyForbidString.Replace(\"B1\是\"); }

if ((int)MyTable.Rows[0][\"房源管理之出租房源管理\"] == 1) {

MyForbidString.Replace(\"B2\是\"); }

if ((int)MyTable.Rows[0][\"房源管理之查询可售房源\"] == 1) {

MyForbidString.Replace(\"B3\是\"); }

if ((int)MyTable.Rows[0][\"房源管理之查询可租房源\"] == 1) {

MyForbidString.Replace(\"B4\是\"); }

if ((int)MyTable.Rows[0][\"客源管理之求购客源管理\"] == 1) {

MyForbidString.Replace(\"C1\是\"); }

if ((int)MyTable.Rows[0][\"客源管理之求租客源管理\"] == 1) {

MyForbidString.Replace(\"C2\是\"); }

if ((int)MyTable.Rows[0][\"客源管理之查询求购客源\"] == 1) {

MyForbidString.Replace(\"C3\是\"); }

if ((int)MyTable.Rows[0][\"客源管理之查询求租客源\"] == 1) {

MyForbidString.Replace(\"C4\是\"); }

if ((int)MyTable.Rows[0][\"成交管理之广告发布管理\"] == 1) {

MyForbidString.Replace(\"D1\是\"); }

if ((int)MyTable.Rows[0][\"成交管理之经纪跟进管理\"] == 1) {

MyForbidString.Replace(\"D2\是\"); }

if ((int)MyTable.Rows[0][\"成交管理之租售成交管理\"] == 1) {

MyForbidString.Replace(\"D3\是\"); }

if ((int)MyTable.Rows[0][\"成交管理之查询售房信息\"] == 1) {

38

山东理工大学管理学院信管2008管理信息系统课程设计

MyForbidString.Replace(\"D4\是\"); }

if ((int)MyTable.Rows[0][\"成交管理之查询租房信息\"] == 1) {

MyForbidString.Replace(\"D5\是\"); }

if ((int)MyTable.Rows[0][\"系统管理之分配用户权限\"] == 1) {

MyForbidString.Replace(\"E1\是\"); }

if ((int)MyTable.Rows[0][\"系统管理之公司信息设置\"] == 1) {

MyForbidString.Replace(\"E2\是\"); }

Session[\"MyForbid\"] = MyForbidString; } else {

Session[\"MyForbid\"] = MyForbidString; } } }

5.2 主窗体模块

主窗体界面如图5-3所示:

主窗体模块主要实现功能有:

图5-3

1.我们可以直接从主界面的工具条上选择要进行的操作,包括:“用户信息管

39

山东理工大学管理学院信管2008管理信息系统课程设计

理”,“求租管理”,“员工信息”,“出租管理”,“系统管理”,“帮助”等需经常操作的对象,把他们放到工具条上更方便了操作,提高一定的操作效率。

2.我们还可以通过菜单项进行其他项目的操作。比如:通过用户信息管理,可以来对出租人、求租人进行信息设置以及对人员信息的控制。其他的一些功能,求租和出租管理对于房屋中介管理更是必不可少的,这样间接的界面既直接又方便。

3.我们还可以在必要的时候在用户信息管理菜单下修改个人密码,确保安全。

5.3用户列表模块 1.查询求购信息

此模块的主要作用是能够比较集中,并且准确的查询出求购情况,对比区分。 核心代码:

//文件名:QueryClientBuyForm.aspx.cs using System;

using System.Data;

using System.Configuration; using System.Collections; using System.Web;

using System.Web.Security; using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;

using System.Data.SqlClient;

public partial class ClientManage_QueryClientBuyForm : System.Web.UI.Page

40

山东理工大学管理学院信管2008管理信息系统课程设计

{

private static string MySQL = \"\";

protected void Page_Load(object sender, EventArgs e) {

string MyForbidString = Session[\"MyForbid\"].ToString(); if (MyForbidString.IndexOf(\"C3\") > 1) {

Server.Transfer(\"~/SystemManage/AllErrorHelp.aspx\"); }

if (!IsPostBack) {

String MySQLConnectionString =

ConfigurationManager.ConnectionStrings[\"MyHouseDBConnectionString\"].ConnectionString;

string MySQL = \"Select * From 房源参数 Where 自编号='CQ001'\";

SqlConnection MyConnection = new SqlConnection(MySQLConnectionString); MyConnection.Open();

DataTable MyHouseTable = new DataTable();

SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection);

MyAdapter.Fill(MyHouseTable); string MyName = \"城区\"; string MyValue = MyHouseTable.Rows[0][MyName].ToString(); String[] MyPayData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyPayData) {

this.DropDownList1.Items.Add(MyString); }

MyName = \"装修\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MyDecData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyDecData) {

this.DropDownList2.Items.Add(MyString); }

if (MyConnection.State == ConnectionState.Open) {

MyConnection.Close(); } } }

protected void Button1_Click(object sender, EventArgs e)

41

山东理工大学管理学院信管2008管理信息系统课程设计

{//查询求购客源

string fangxing1 = \"\"; string fangxing2 = \"\"; string mianji1 = \"\"; string mianji2 = \"\"; string jiage1 = \"\"; string jiage2 = \"\";

if (this.TextBox8.Text == \"\" || this.TextBox9.Text == \"\") {

jiage1 = \"1\";

jiage2 = \"10000000\";

} else {

jiage1 = this.TextBox8.Text.ToString(); jiage2 = this.TextBox9.Text.ToString(); }

if (this.TextBox6.Text == \"\" || this.TextBox7.Text == \"\") {

mianji1 = \"0\"; mianji2 = \"1000\"; } else {

mianji1 = this.TextBox6.Text.ToString(); mianji2 = this.TextBox7.Text.ToString(); }

if (this.TextBox4.Text == \"\" || this.TextBox5.Text == \"\") {

fangxing1 = \"1\"; fangxing2 = \"10\"; } else {

fangxing1 = this.TextBox4.Text.ToString(); fangxing2 = this.TextBox5.Text.ToString();

}

DataTable MyQueryTable = new System.Data.DataTable(); SqlConnection MyConnection = new SqlConnection(); MyConnection.ConnectionString =

ConfigurationManager.ConnectionStrings[\"MyHouseDBConnectionString\"].ConnectionString;

42

山东理工大学管理学院信管2008管理信息系统课程设计

MyConnection.Open();

MySQL = \"SELECT * FROM 求购客源视图 WHERE ('\" +

this.TextBox1.Text + \"' BETWEEN 委托日期 AND 截止日期) AND (所在城区='\" +

this.DropDownList1.SelectedValue.ToString() + \"') AND (装修要求='\" +

this.DropDownList2.SelectedValue.ToString() +

\"') AND ( 最小房间数>=\" + fangxing1 + \") AND (最大房间数<=\" +

fangxing2 + \") AND (最小面积>=\" + mianji1 + \") AND (最大面积<=\" +

mianji2 + \") AND (最低购价>=\" + jiage1 + \") AND (最高购价<=\" +

jiage2 + \")\";

SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection);

MyAdapter.Fill(MyQueryTable);

this.GridView1.DataSource = MyQueryTable; this.GridView1.DataBind();

if (MyConnection.State == ConnectionState.Open) {

MyConnection.Close(); } }

public string MyPrintSQL {//设置要传递到打印页的数据 get {

return MySQL; } }

public String MyPrintDate {//设置要传递到打印页的数据 get {

return \"当前日期:\" + DateTime.Now.ToShortDateString() + \" 查询条件:所在城区:\" +

this.DropDownList1.SelectedValue.ToString() + \" 装修级别:\" +

this.DropDownList2.SelectedValue.ToString() + \" 房型:\" + this.TextBox4.Text + \"房至\" +

this.TextBox5.Text + \"房 建筑面积:\" + this.TextBox6.Text + \"至\" +

this.TextBox7.Text + \"m2 价格:\" + this.TextBox8.Text + \"

43

山东理工大学管理学院信管2008管理信息系统课程设计

至\" +

this.TextBox9.Text + \"元\"; } }

protected void Button2_Click(object sender, EventArgs e) {//打印求购客源

Server.Transfer(\"~/ClientManage/QueryClientBuyPrint.aspx\"); } }

2.查询求租信息

此模块的主要作用是能够比较集中,准确的调查出求租情况

核心代码:

//文件名:QueryLeaseForm.aspx.cs using System;

using System.Data;

using System.Configuration; using System.Collections; using System.Web;

using System.Web.Security; using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;

using System.Data.SqlClient; public partial class ContractManage_QueryLeaseForm : System.Web.UI.Page {

private static string MySQL = \"\";

protected void Page_Load(object sender, EventArgs e) {

44

山东理工大学管理学院信管2008管理信息系统课程设计

string MyForbidString = Session[\"MyForbid\"].ToString(); if (MyForbidString.IndexOf(\"D5\") > 1) {

Server.Transfer(\"~/SystemManage/AllErrorHelp.aspx\"); }

if (!IsPostBack) {

String MySQLConnectionString =

ConfigurationManager.ConnectionStrings[\"MyHouseDBConnectionString\"].ConnectionString;

SqlConnection MyConnection = new SqlConnection(MySQLConnectionString);

MyConnection.Open();

string MySQL = \"Select * From 职员信息\";

DataTable MyPersonnelTable = new DataTable();

SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection);

MyAdapter.Fill(MyPersonnelTable); string MyName = \"职员姓名\"; string MyValue =

MyPersonnelTable.Rows[0][MyName].ToString();

foreach (DataRow MyRow in MyPersonnelTable.Rows) {

this.DropDownList1.Items.Add(MyRow[MyName].ToString());

}

if (MyConnection.State == ConnectionState.Open) {

MyConnection.Close(); } } }

protected void Button1_Click(object sender, EventArgs e) {//查询租房信息

DataTable MyQueryTable = new System.Data.DataTable(); SqlConnection MyConnection = new SqlConnection(); MyConnection.ConnectionString =

ConfigurationManager.ConnectionStrings[\"MyHouseDBConnectionString\"].ConnectionString;

MyConnection.Open();

MySQL = \"SELECT * FROM 租售成交 WHERE ((资料类型='出租房源') OR (资料类型='求租客源')) AND ( 成交日期 BETWEEN '\" +

this.TextBox1.Text + \"' AND '\" + this.TextBox2.Text + \"') AND (合同编号 LIKE '%\" + this.TextBox3.Text +

45

山东理工大学管理学院信管2008管理信息系统课程设计

\"%') AND (资料编号 LIKE '%\" + this.TextBox4.Text + \"%') AND (经办人员='\" + this.DropDownList1.SelectedValue.ToString() + \"')\";

SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection);

MyAdapter.Fill(MyQueryTable);

this.GridView1.DataSource = MyQueryTable; this.GridView1.DataBind();

if (MyConnection.State == ConnectionState.Open) {

MyConnection.Close(); } }

public string MyPrintSQL {//设置要传递到打印页的数据 get {

return MySQL; } }

public String MyPrintDate {//设置要传递到打印页的数据 get {

return \"当前日期:\" + DateTime.Now.ToShortDateString() + \" 经办人员:\" + this.DropDownList1.SelectedValue.ToString();

} }

protected void Button2_Click(object sender, EventArgs e) {//打印租房信息

Server.Transfer(\"~/ContractManage/QueryLeasePrint.aspx\"); } }

3.求购客源管理

46

山东理工大学管理学院信管2008管理信息系统课程设计

1. 任何已注册的买房者用户都可以通过该模块实现对意向的房源进行查

询。

2. 进行查询时,可以从不同方面的意向,如面积,地点,价位,楼层,朝

向,房型,用途等,对已有的房源进行筛选符合意向的房源,查询快捷,操作简单,方便查看。

3. 对于卖方也可以及时查询自己的房源的求购情况,做出合理合适的安排

核心代码:

//文件名:ClientBuyForm.aspx.cs using System;

using System.Data;

using System.Configuration; using System.Collections; using System.Web;

using System.Web.Security; using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;

using System.Data.SqlClient;

public partial class ClientManage_ClientBuyForm : System.Web.UI.Page {

protected void Page_Load(object sender, EventArgs e) {

string MyForbidString = Session[\"MyForbid\"].ToString();

47

山东理工大学管理学院信管2008管理信息系统课程设计

if (MyForbidString.IndexOf(\"C1\") > 1) {

house.alertAndBack();

}

if (!IsPostBack) {

String MySQLConnectionString =

ConfigurationManager.ConnectionStrings[\"MyHouseDBConnectionString\"].ConnectionString;

string MySQL = \"Select * From 房源参数 Where 自编号='CQ001'\";

SqlConnection MyConnection = new SqlConnection(MySQLConnectionString);

MyConnection.Open();

DataTable MyHouseTable = new DataTable();

SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection);

MyAdapter.Fill(MyHouseTable); string MyName = \"城区\";

string MyValue = MyHouseTable.Rows[0][MyName].ToString(); String[] MyDistData = MyValue.Split(new char[1] { '、' }); //设置所在城区列表项

foreach (String MyString in MyDistData) {

this.DropDownList4.Items.Add(MyString); }

MyName = \"类型\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MyTypeData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyTypeData) {

this.DropDownList2.Items.Add(MyString); }

MyName = \"付款\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MyTypeMoney = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyTypeMoney) {

this.DropDownList99.Items.Add(MyString); }

MyName = \"朝向\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MyDireData = MyValue.Split(new char[1] { '、' });

48

山东理工大学管理学院信管2008管理信息系统课程设计

foreach (String MyString in MyDireData) {

this.DropDownList5.Items.Add(MyString); }

MyName = \"产权\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MyPreData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyPreData) {

this.DropDownList7.Items.Add(MyString); }

MyName = \"结构\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MyStruData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyStruData) {

this.DropDownList3.Items.Add(MyString); }

MyName = \"装修\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MyDecoData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyDecoData) {

this.DropDownList6.Items.Add(MyString); }

MyName = \"付佣\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MyFeeData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyFeeData) {

this.DropDownList8.Items.Add(MyString); }

MyName = \"状态\";

MyValue = MyHouseTable.Rows[0][MyName].ToString(); String[] MyStatusData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyStatusData) {

this.DropDownList10.Items.Add(MyString); }

MySQL = \"Select * From 职员信息\";

DataTable MyPersonnelTable = new DataTable();

MyAdapter = new SqlDataAdapter(MySQL, MyConnection); MyAdapter.Fill(MyPersonnelTable);

49

山东理工大学管理学院信管2008管理信息系统课程设计

MyName = \"职员姓名\";

MyValue = MyPersonnelTable.Rows[0][MyName].ToString(); foreach (DataRow MyRow in MyPersonnelTable.Rows) {

this.DropDownList9.Items.Add(MyRow[MyName].ToString());

}

if (MyConnection.State == ConnectionState.Open) {

MyConnection.Close(); } } }

protected void Button2_Click(object sender, EventArgs e) {//新增求购客源信息

if (this.TextBox2.Text.Trim() != \"\" && this.TextBox3.Text != \"\" && this.TextBox4.Text != \"\" && this.TextBox5.Text != \"\" && this.TextBox6.Text != \"\" && this.TextBox7.Text != \"\" && this.TextBox8.Text != \"\" && this.TextBox9.Text != \"\" && this.TextBox14.Text != \"\" && this.TextBox15.Text != \"\" && this.TextBox18.Text != \"\" && this.TextBox19.Text != \"\" && this.TextBox20.Text != \"\" && this.TextBox21.Text != \"\" && this.TextBox22.Text != \"\" && this.TextBox23.Text != \"\" && this.TextBox24.Text != \"\" && this.TextBox25.Text != \"\" && this.TextBox26.Text != \"\")

{

this.SqlDataSource1.Insert(); } else

house.notnull(); }

protected void Button3_Click(object sender, EventArgs e) {//修改求购客源信息

this.SqlDataSource1.Update(); }

protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)

{//弹出删除操作确认对话框

if (e.Row.RowType == DataControlRowType.DataRow) {

Button MyButton = (Button)e.Row.FindControl(\"Button1\"); MyButton.OnClientClick = \"return confirm('是否确认删除当前选择的记录?')\";

}

50

山东理工大学管理学院信管2008管理信息系统课程设计

}

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)

{//在控件中显示选择的记录 this.TextBox2.Text =

this.GridView1.SelectedRow.Cells[2].Text.ToString();

this.TextBox3.Text =

this.GridView1.SelectedRow.Cells[3].Text.ToString();

this.DropDownList1.SelectedValue =

this.GridView1.SelectedRow.Cells[4].Text.ToString();

this.TextBox5.Text =

this.GridView1.SelectedRow.Cells[5].Text.ToString();

this.TextBox6.Text =

this.GridView1.SelectedRow.Cells[6].Text.ToString();

this.TextBox7.Text =

this.GridView1.SelectedRow.Cells[7].Text.ToString();

this.TextBox8.Text =

this.GridView1.SelectedRow.Cells[8].Text.ToString();

this.DropDownList2.SelectedValue =

this.GridView1.SelectedRow.Cells[9].Text.ToString();

this.DropDownList3.SelectedValue =

this.GridView1.SelectedRow.Cells[10].Text.ToString();

this.DropDownList4.SelectedValue =

this.GridView1.SelectedRow.Cells[11].Text.ToString();

this.TextBox12.Text =

this.GridView1.SelectedRow.Cells[12].Text.ToString();

this.DropDownList5.SelectedValue =

this.GridView1.SelectedRow.Cells[13].Text.ToString();

this.TextBox14.Text =

this.GridView1.SelectedRow.Cells[14].Text.ToString();

this.TextBox15.Text =

this.GridView1.SelectedRow.Cells[15].Text.ToString();

this.DropDownList6.SelectedValue =

this.GridView1.SelectedRow.Cells[16].Text.ToString();

this.DropDownList7.SelectedValue =

this.GridView1.SelectedRow.Cells[17].Text.ToString();

this.TextBox18.Text =

this.GridView1.SelectedRow.Cells[18].Text.ToString();

this.TextBox19.Text =

this.GridView1.SelectedRow.Cells[19].Text.ToString();

this.TextBox20.Text =

this.GridView1.SelectedRow.Cells[20].Text.ToString();

this.TextBox21.Text =

this.GridView1.SelectedRow.Cells[21].Text.ToString();

51

山东理工大学管理学院信管2008管理信息系统课程设计

this.DropDownList99.SelectedValue =

this.GridView1.SelectedRow.Cells[22].Text.ToString().Trim();

this.TextBox22.Text =

this.GridView1.SelectedRow.Cells[23].Text.ToString();

this.TextBox23.Text =

this.GridView1.SelectedRow.Cells[24].Text.ToString();

this.TextBox24.Text =

this.GridView1.SelectedRow.Cells[25].Text.ToString();

this.TextBox25.Text =

this.GridView1.SelectedRow.Cells[26].Text.ToString();

this.DropDownList8.SelectedValue =

this.GridView1.SelectedRow.Cells[27].Text.ToString();

this.TextBox4.Text =

this.GridView1.SelectedRow.Cells[28].Text.ToString();

this.DropDownList9.SelectedValue =

this.GridView1.SelectedRow.Cells[29].Text.ToString();

this.CheckBox1.Checked =

(Convert.ToInt16(this.GridView1.SelectedRow.Cells[30].Text.ToString()) == 1) ? true : false;

this.CheckBox2.Checked =

(Convert.ToInt16(this.GridView1.SelectedRow.Cells[31].Text.ToString()) == 1) ? true : false;

this.DropDownList10.SelectedValue =

this.GridView1.SelectedRow.Cells[32].Text.ToString();

this.TextBox9.Text =

this.GridView1.SelectedRow.Cells[33].Text.ToString();

} }

52

山东理工大学管理学院信管2008管理信息系统课程设计

4.求租客源管理

(1) 任何已注册的租房者用户都可以通过该模块实现对意向的房源进行查询。 (2) 进行查询时,可以从不同方面的意向,如面积,地点,价位,楼层,朝向,

房型,用途等,对已有的房源进行筛选符合意向的房源,查询快捷,操作简单,方便查看。

(3) 对于商家也可以及时了解自己的房源的租赁情况,一键明了

5.4房源查询模块

1.查询售房信息

53

山东理工大学管理学院信管2008管理信息系统课程设计

在此模块中,可以查询售房数量,售房现状等信息,供我们参考 核心代码:

//文件名:QuerySaleForm.aspx.cs using System;

using System.Data;

using System.Configuration; using System.Collections; using System.Web;

using System.Web.Security; using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;

using System.Data.SqlClient;

public partial class ContractManage_QuerySaleForm : System.Web.UI.Page {

private static string MySQL = \"\";

protected void Page_Load(object sender, EventArgs e) {

string MyForbidString = Session[\"MyForbid\"].ToString(); if (MyForbidString.IndexOf(\"D4\") > 1) {

Server.Transfer(\"~/SystemManage/AllErrorHelp.aspx\"); }

if (!IsPostBack) {

String MySQLConnectionString = ConfigurationManager.ConnectionStrings[\"MyHouseDBConnectionString\"].Conn

54

山东理工大学管理学院信管2008管理信息系统课程设计

ectionString;

SqlConnection MyConnection = new SqlConnection(MySQLConnectionString); MyConnection.Open();

string MySQL = \"Select * From 职员信息\";

DataTable MyPersonnelTable = new DataTable();

SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection);

MyAdapter.Fill(MyPersonnelTable); string MyName = \"职员姓名\";

string MyValue = MyPersonnelTable.Rows[0][MyName].ToString(); foreach (DataRow MyRow in MyPersonnelTable.Rows) {

this.DropDownList1.Items.Add(MyRow[MyName].ToString()); }

if (MyConnection.State == ConnectionState.Open) {

MyConnection.Close(); } } }

protected void Button1_Click(object sender, EventArgs e) {//查询售房信息

DataTable MyQueryTable = new System.Data.DataTable(); SqlConnection MyConnection = new SqlConnection(); MyConnection.ConnectionString = ConfigurationManager.ConnectionStrings[\"MyHouseDBConnectionString\"].ConnectionString;

MyConnection.Open();

MySQL = \"SELECT * FROM 租售成交 WHERE ((资料类型='出售房源') OR (资料类型='求购客源')) AND ( 成交日期 BETWEEN '\" +

this.TextBox1.Text + \"' AND '\" + this.TextBox2.Text + \"') AND (合同编号 LIKE '%\" + this.TextBox3.Text +

\"%') AND (资料编号 LIKE '%\" + this.TextBox4.Text + \"%') AND (经办人员='\" + this.DropDownList1.SelectedValue.ToString() + \"')\"; SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection); MyAdapter.Fill(MyQueryTable);

this.GridView1.DataSource = MyQueryTable; this.GridView1.DataBind();

if (MyConnection.State == ConnectionState.Open) {

MyConnection.Close(); } }

55

山东理工大学管理学院信管2008管理信息系统课程设计

public string MyPrintSQL {//设置要传递到打印页的数据 get {

return MySQL; } }

public String MyPrintDate {//设置要传递到打印页的数据 get {

return \"当前日期:\" + DateTime.Now.ToShortDateString() + \" 经办人员:\" + this.DropDownList1.SelectedValue.ToString(); } }

protected void Button2_Click(object sender, EventArgs e) {//打印售房信息

Server.Transfer(\"~/ContractManage/QuerySalePrint.aspx\"); } }

2.查询租房信息

在此模块中,可以查询租房的现状信息,供我们参考 核心代码:类似查询售房信息

3.查询可售房源

56

山东理工大学管理学院信管2008管理信息系统课程设计

在此系统中,会提供给很多房源,包括可售,可租的信息,其中包括很多信息,包括:位置,地址,朝向,路线,价钱,面积,房型.... 核心代码:

//文件名:QueryHouseSaleForm.aspx.cs using System;

using System.Data;

using System.Configuration; using System.Collections; using System.Web;

using System.Web.Security; using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;

using System.Data.SqlClient;

public partial class HouseManage_QueryHouseSaleForm : System.Web.UI.Page {

private static string MySQL = \"\";

protected void Page_Load(object sender, EventArgs e) {

string MyForbidString = Session[\"MyForbid\"].ToString(); if (MyForbidString.IndexOf(\"B3\") > 1) {

Server.Transfer(\"~/SystemManage/AllErrorHelp.aspx\"); }

if (!IsPostBack) {

String MySQLConnectionString = ConfigurationManager.ConnectionStrings[\"MyHouseDBConnectionString\"].ConnectionString;

string MySQL = \"Select * From 房源参数 Where 自编号='CQ001'\"; SqlConnection MyConnection = new SqlConnection(MySQLConnectionString);

57

山东理工大学管理学院信管2008管理信息系统课程设计

MyConnection.Open();

DataTable MyHouseTable = new DataTable();

SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection);

MyAdapter.Fill(MyHouseTable); string MyName = \"城区\";

string MyValue = MyHouseTable.Rows[0][MyName].ToString(); String[] MyPayData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyPayData) {

this.DropDownList1.Items.Add(MyString); }

MyName = \"装修\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MyDecData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyDecData) {

this.DropDownList2.Items.Add(MyString); }

if (MyConnection.State == ConnectionState.Open) {

MyConnection.Close(); } } }

protected void Button1_Click(object sender, EventArgs e) {//查询可售房源

DataTable MyQueryTable = new System.Data.DataTable(); SqlConnection MyConnection = new SqlConnection(); MyConnection.ConnectionString = ConfigurationManager.ConnectionStrings[\"MyHouseDBConnectionString\"].ConnectionString;

MyConnection.Open();

int My电梯 = this.CheckBox1.Checked?1 : 0; string fangxing1 = \"\"; string fangxing2 = \"\"; string mianji1 = \"\"; string mianji2 = \"\";

string jiage1 = \"\"; string jiage2 = \"\";

if (this.TextBox8.Text == \"\" || this.TextBox9.Text == \"\") {

jiage1 = \"1\";

58

山东理工大学管理学院信管2008管理信息系统课程设计

jiage2 = \"10000000\";

} else {

jiage1 = this.TextBox8.Text.ToString(); jiage2 = this.TextBox9.Text.ToString(); }

if (this.TextBox6.Text == \"\" || this.TextBox7.Text == \"\") {

mianji1 = \"0\"; mianji2 = \"1000\"; } else {

mianji1 = this.TextBox6.Text.ToString(); mianji2 = this.TextBox7.Text.ToString(); }

if (this.TextBox4.Text == \"\" || this.TextBox5.Text == \"\") {

fangxing1 = \"1\"; fangxing2 = \"10\"; } else {

fangxing1 = this.TextBox4.Text.ToString(); fangxing2 = this.TextBox5.Text.ToString();

}

MySQL = \"SELECT * FROM 可售房源视图 WHERE ('\" +

this.TextBox1.Text + \"' BETWEEN 委托日期 AND 截止日期) AND (所在城区='\" +

this.DropDownList1.SelectedValue.ToString() + \"') AND (装修级别='\" +

this.DropDownList2.SelectedValue.ToString() + \"') AND (电梯=\"+My电梯 +

\") AND ( 房 BETWEEN \"+fangxing1 + \" AND \" +

fangxing2 +\") AND (建筑面积 BETWEEN \" + mianji1 +\" AND \" + mianji2 + \") AND (价格 BETWEEN \" + jiage1 + \" AND \" + jiage2 + \")\"; SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection); MyAdapter.Fill(MyQueryTable);

this.GridView1.DataSource= MyQueryTable; this.GridView1.DataBind();

59

山东理工大学管理学院信管2008管理信息系统课程设计

if (MyConnection.State == ConnectionState.Open) {

MyConnection.Close(); } }

public string MyPrintSQL {//设置要传递到打印页的数据 get {

return MySQL; } }

public String MyPrintDate {//设置要传递到打印页的数据 get {

return \"当前日期:\"+DateTime.Now.ToShortDateString()+\" 查询条件:所在城区:\" +

this.DropDownList1.SelectedValue.ToString() +\" 装修级别:\" + this.DropDownList2.SelectedValue.ToString() + \" 房型:\"+this.TextBox4.Text + \"房至\" +

this.TextBox5.Text +\"房 建筑面积:\" + this.TextBox6.Text +\"至\" +

this.TextBox7.Text + \"m2 价格:\" + this.TextBox8.Text + \"至\" + this.TextBox9.Text + \"元\"; } }

protected void Button2_Click(object sender, EventArgs e) {//打印可售房源

Server.Transfer(\"~/HouseManage/QueryHouseSalePrint.aspx\"); } }

4.查询可租房源

60

山东理工大学管理学院信管2008管理信息系统课程设计

功能类似查询可售房源 核心代码类似查询可售房源

5.5 业务管理模块 1.出售房屋管理

2.出租房源管理

61

山东理工大学管理学院信管2008管理信息系统课程设计

此模块中,可以看到很多关于房源的信息以及客户的信息,每一个下拉箭头可以调节客户的信息选择,

也可以自行在空白处填写信息,以便查询出相应信息。

核心代码:

//文件名:HouseSaleForm.aspx.cs using System;

using System.Data;

using System.Configuration; using System.Collections; using System.Web;

using System.Web.Security; using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;

using System.Data.SqlClient;

public partial class HouseManage_HouseSaleForm : System.Web.UI.Page {

protected void Page_Load(object sender, EventArgs e) {

string MyForbidString = Session[\"MyForbid\"].ToString(); if (MyForbidString.IndexOf(\"B1\") > 1) {

house.alertAndBack(); }

if (!IsPostBack) {

62

山东理工大学管理学院信管2008管理信息系统课程设计

String MySQLConnectionString = ConfigurationManager.ConnectionStrings[\"MyHouseDBConnectionString\"].ConnectionString;

string MySQL = \"Select * From 房源参数 Where 自编号='CQ001'\"; SqlConnection MyConnection = new SqlConnection(MySQLConnectionString); MyConnection.Open();

DataTable MyHouseTable = new DataTable();

SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection);

MyAdapter.Fill(MyHouseTable); string MyName = \"城区\";

string MyValue = MyHouseTable.Rows[0][MyName].ToString(); String[] MyDistData = MyValue.Split(new char[1] { '、' }); //设置所在城区列表项

foreach (String MyString in MyDistData) {

this.DropDownList1.Items.Add(MyString); }

MyName = \"类型\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MyTypeData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyTypeData) {

this.DropDownList3.Items.Add(MyString); }

MyName = \"朝向\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MyDireData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyDireData) {

this.DropDownList2.Items.Add(MyString); }

MyName = \"用途\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MyUseData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyUseData) {

this.DropDownList6.Items.Add(MyString); }

MyName = \"土地\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MyFieldData = MyValue.Split(new char[1] { '、' });

63

山东理工大学管理学院信管2008管理信息系统课程设计

foreach (String MyString in MyFieldData) {

this.DropDownList4.Items.Add(MyString); }

MyName = \"产权\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MyPreData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyPreData) {

this.DropDownList5.Items.Add(MyString); }

MyName = \"结构\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MyStruData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyStruData) {

this.DropDownList7.Items.Add(MyString); }

MyName = \"装修\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MyDecoData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyDecoData) {

this.DropDownList8.Items.Add(MyString); }

MyName = \"证件\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MyCertData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyCertData) {

this.DropDownList9.Items.Add(MyString); }

MyName = \"付款\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MyPayData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyPayData) {

this.DropDownList10.Items.Add(MyString); }

MyName = \"货币\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MyMoneyData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyMoneyData) {

64

山东理工大学管理学院信管2008管理信息系统课程设计

this.DropDownList11.Items.Add(MyString); }

MyName = \"付佣\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MyFeeData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyFeeData) {

this.DropDownList12.Items.Add(MyString); }

MyName = \"委托\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MyDeleData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyDeleData) {

this.DropDownList13.Items.Add(MyString); }

MyName = \"来源\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MySourceData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MySourceData) {

this.DropDownList14.Items.Add(MyString); }

MyName = \"状态\";

MyValue = MyHouseTable.Rows[0][MyName].ToString();

String[] MyStatusData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyStatusData) {

this.DropDownList16.Items.Add(MyString); }

MySQL = \"Select * From 职员信息\";

DataTable MyPersonnelTable = new DataTable();

MyAdapter = new SqlDataAdapter(MySQL, MyConnection); MyAdapter.Fill(MyPersonnelTable); MyName = \"职员姓名\";

MyValue = MyPersonnelTable.Rows[0][MyName].ToString(); foreach (DataRow MyRow in MyPersonnelTable.Rows) {

this.DropDownList15.Items.Add(MyRow[MyName].ToString()); }

if (MyConnection.State == ConnectionState.Open) {

MyConnection.Close(); }

65

山东理工大学管理学院信管2008管理信息系统课程设计

} }

protected void Button2_Click(object sender, EventArgs e) {//新增出售房源信息

if (this.TextBox2.Text.Trim() != \"\" && this.TextBox4.Text != \"\" && this.TextBox5.Text != \"\" && this.TextBox6.Text != \"\" && this.TextBox7.Text != \"\" && this.TextBox8.Text != \"\" && this.TextBox9.Text != \"\" && this.TextBox10.Text != \"\" && this.TextBox11.Text != \"\" && this.TextBox13.Text != \"\" && this.TextBox14.Text != \"\" && this.TextBox15.Text != \"\" && this.TextBox16.Text != \"\" && this.TextBox17.Text != \"\" && this.TextBox19.Text != \"\" && this.TextBox21.Text != \"\" && this.TextBox26.Text != \"\" && this.TextBox27.Text != \"\" && this.TextBox29.Text != \"\" && this.TextBox30.Text != \"\" && this.TextBox31.Text != \"\" && this.TextBox32.Text != \"\" && this.TextBox33.Text != \"\" && this.TextBox34.Text != \"\" && this.TextBox35.Text != \"\" && this.TextBox37.Text != \"\" && this.TextBox38.Text != \"\" && this.TextBox39.Text != \"\" && this.TextBox40.Text != \"\" && this.TextBox44.Text != \"\" && this.TextBox45.Text != \"\" && this.TextBox46.Text != \"\" && this.TextBox47.Text != \"\" && this.TextBox49.Text != \"\" && this.TextBox50.Text != \"\" && this.TextBox55.Text != \"\" && this.TextBox58.Text != \"\") {

this.SqlDataSource1.Insert(); } else

house.notnull();

}

protected void Button3_Click(object sender, EventArgs e) {//修改出售房源信息

this.SqlDataSource1.Update(); }

protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)

{//弹出删除操作确认对话框

if (e.Row.RowType == DataControlRowType.DataRow) {

Button MyButton = (Button)e.Row.FindControl(\"Button1\");

MyButton.OnClientClick = \"return confirm('是否确认删除当前选择的记录?')\"; } }

66

山东理工大学管理学院信管2008管理信息系统课程设计

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)

{//在控件中显示选择的记录 this.TextBox2.Text = this.GridView1.SelectedRow.Cells[2].Text.ToString(); this.DropDownList1.SelectedValue = this.GridView1.SelectedRow.Cells[3].Text.ToString(); this.TextBox4.Text = this.GridView1.SelectedRow.Cells[4].Text.ToString(); this.TextBox5.Text = this.GridView1.SelectedRow.Cells[5].Text.ToString(); this.TextBox6.Text = this.GridView1.SelectedRow.Cells[6].Text.ToString(); this.TextBox7.Text = this.GridView1.SelectedRow.Cells[7].Text.ToString(); this.TextBox8.Text = this.GridView1.SelectedRow.Cells[8].Text.ToString(); this.TextBox9.Text = this.GridView1.SelectedRow.Cells[9].Text.ToString(); this.TextBox10.Text = this.GridView1.SelectedRow.Cells[10].Text.ToString(); this.TextBox11.Text = this.GridView1.SelectedRow.Cells[11].Text.ToString(); this.CheckBox1.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[12].Text.ToString()) == 1) ? true : false;

this.TextBox13.Text = this.GridView1.SelectedRow.Cells[13].Text.ToString(); this.TextBox14.Text = this.GridView1.SelectedRow.Cells[14].Text.ToString(); this.TextBox15.Text = this.GridView1.SelectedRow.Cells[15].Text.ToString(); this.TextBox16.Text = this.GridView1.SelectedRow.Cells[16].Text.ToString(); this.TextBox17.Text = this.GridView1.SelectedRow.Cells[17].Text.ToString(); this.DropDownList2.SelectedValue = this.GridView1.SelectedRow.Cells[18].Text.ToString(); this.TextBox19.Text = this.GridView1.SelectedRow.Cells[19].Text.ToString(); this.DropDownList3.SelectedValue = this.GridView1.SelectedRow.Cells[20].Text.ToString(); this.TextBox21.Text = this.GridView1.SelectedRow.Cells[21].Text.ToString();

67

山东理工大学管理学院信管2008管理信息系统课程设计

this.DropDownList4.SelectedValue

this.GridView1.SelectedRow.Cells[22].Text.ToString(); this.DropDownList5.SelectedValue

this.GridView1.SelectedRow.Cells[23].Text.ToString(); this.DropDownList6.SelectedValue

this.GridView1.SelectedRow.Cells[24].Text.ToString(); this.DropDownList7.SelectedValue

this.GridView1.SelectedRow.Cells[25].Text.ToString(); this.TextBox26.Text

this.GridView1.SelectedRow.Cells[26].Text.ToString(); this.TextBox27.Text

this.GridView1.SelectedRow.Cells[27].Text.ToString(); this.DropDownList8.SelectedValue

this.GridView1.SelectedRow.Cells[28].Text.ToString(); this.TextBox29.Text

this.GridView1.SelectedRow.Cells[29].Text.ToString(); this.TextBox30.Text

this.GridView1.SelectedRow.Cells[30].Text.ToString(); this.TextBox31.Text

this.GridView1.SelectedRow.Cells[31].Text.ToString(); ////单价

////this.TextBox32.Text

this.GridView1.SelectedRow.Cells[32].Text.ToString(); this.TextBox32.Text

this.GridView1.SelectedRow.Cells[33].Text.ToString(); this.TextBox33.Text

this.GridView1.SelectedRow.Cells[34].Text.ToString(); this.TextBox34.Text

this.GridView1.SelectedRow.Cells[35].Text.ToString(); this.TextBox35.Text

this.GridView1.SelectedRow.Cells[36].Text.ToString();

this.DropDownList9.SelectedValue

this.GridView1.SelectedRow.Cells[37].Text.ToString(); this.TextBox37.Text

this.GridView1.SelectedRow.Cells[38].Text.ToString(); this.TextBox38.Text

this.GridView1.SelectedRow.Cells[39].Text.ToString(); this.TextBox39.Text

this.GridView1.SelectedRow.Cells[40].Text.ToString(); this.TextBox40.Text

this.GridView1.SelectedRow.Cells[41].Text.ToString(); this.DropDownList10.SelectedValue

this.GridView1.SelectedRow.Cells[42].Text.ToString();

68

= = = = = = = = = =

= = = = =

= = = = = =

山东理工大学管理学院信管2008管理信息系统课程设计

this.DropDownList11.SelectedValue = this.GridView1.SelectedRow.Cells[43].Text.ToString(); this.DropDownList12.SelectedValue = this.GridView1.SelectedRow.Cells[44].Text.ToString(); this.TextBox44.Text = this.GridView1.SelectedRow.Cells[45].Text.ToString(); this.TextBox45.Text = this.GridView1.SelectedRow.Cells[46].Text.ToString(); this.TextBox46.Text = this.GridView1.SelectedRow.Cells[47].Text.ToString(); this.TextBox47.Text = this.GridView1.SelectedRow.Cells[48].Text.ToString(); this.DropDownList13.SelectedValue = this.GridView1.SelectedRow.Cells[49].Text.ToString(); this.TextBox49.Text = this.GridView1.SelectedRow.Cells[50].Text.ToString(); this.TextBox50.Text = this.GridView1.SelectedRow.Cells[51].Text.ToString(); this.DropDownList14.SelectedValue = this.GridView1.SelectedRow.Cells[52].Text.ToString(); this.CheckBox2.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[53].Text.ToString()) == 1) ? true : false;

this.CheckBox3.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[54].Text.ToString()) == 1) ? true : false;

this.CheckBox4.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[55].Text.ToString()) == 1) ? true : false;

this.TextBox55.Text = this.GridView1.SelectedRow.Cells[56].Text.ToString(); this.DropDownList15.SelectedValue = this.GridView1.SelectedRow.Cells[57].Text.ToString(); this.DropDownList16.SelectedValue = this.GridView1.SelectedRow.Cells[58].Text.ToString(); this.TextBox58.Text = this.GridView1.SelectedRow.Cells[59].Text.ToString(); this.CheckBox5.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[60].Text.ToString()) == 1) ? true : false; }

protected void Button4_Click(object sender, EventArgs e) {//打印出售房源信息

Server.Transfer(\"~/HouseManage/HouseSalePrint.aspx\");

69

山东理工大学管理学院信管2008管理信息系统课程设计

}

public string MyPrint建成年份 {//设置要传递到打印页的数据 get {

DateTime MyDate = DateTime.Parse(this.TextBox21.Text);

return \"建成年份:\" + MyDate.Year.ToString() + \"年 位置:\" + this.DropDownList1.SelectedValue.ToString() + this.TextBox4.Text; } }

public string MyPrint房屋产权 {//设置要传递到打印页的数据 get {

return \"土地:\" + this.DropDownList4.SelectedValue.ToString() + \" 产权:\" + this.DropDownList5.SelectedValue.ToString() + \" 装修:\" + this.DropDownList8.SelectedValue.ToString(); } }

public string MyPrint建筑面积 {//设置要传递到打印页的数据 get {

int MyPrice = Convert.ToInt32(this.TextBox31.Text) / 10000; return \"建面(m2):\" + this.TextBox26.Text + \" 套面(m2):\" + this.TextBox27.Text + \" 售价:\" + MyPrice.ToString() + \"万元\"; } }

public string MyPrint房型物管费 {//设置要传递到打印页的数据 get {

return \"房型:\" + this.TextBox13.Text + \"房\" + this.TextBox14.Text + \"厅\" + this.TextBox15.Text + \"厨\" + this.TextBox16.Text + \"卫\" + this.TextBox17.Text + \"阳台\" + \" 物管费:\" + this.TextBox19.Text; } }

public string MyPrint家电家私 {//设置要传递到打印页的数据 get {

return \"家私:\" + this.TextBox32.Text + \" 家电:\" + this.TextBox33.Text;

70

山东理工大学管理学院信管2008管理信息系统课程设计

} }

public string MyPrint配套设施 {//设置要传递到打印页的数据 get {

return \"配套设施:\" + this.TextBox34.Text; } }

public string MyPrint房源编号 {//设置要传递到打印页的数据 get {

return \"房源编号:\" + this.TextBox2.Text; } } }

3租售成交管理

此模块中,可以查询出相应的成交信息,以便作为商家做出合理的计划,来调节经营以及租售策略。 核心代码:

//文件名:ContractForm.aspx.cs using System;

using System.Data;

using System.Configuration;

71

山东理工大学管理学院信管2008管理信息系统课程设计

using System.Collections; using System.Web;

using System.Web.Security; using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;

using System.Data.SqlClient;

public partial class ContractManage_ContractForm : System.Web.UI.Page {

protected void Page_Load(object sender, EventArgs e) {

string MyForbidString = Session[\"MyForbid\"].ToString(); if (MyForbidString.IndexOf(\"D3\") > 1) {

Server.Transfer(\"~/SystemManage/AllErrorHelp.aspx\"); }

if (!IsPostBack) {

String MySQLConnectionString = ConfigurationManager.ConnectionStrings[\"MyHouseDBConnectionString\"].ConnectionString;

string MySQL = \"Select * From 房源参数 Where 自编号='CQ001'\"; SqlConnection MyConnection = new SqlConnection(MySQLConnectionString); MyConnection.Open();

DataTable MyHouseTable = new DataTable();

SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection);

MyAdapter.Fill(MyHouseTable); string MyName = \"付款\";

string MyValue = MyHouseTable.Rows[0][MyName].ToString(); String[] MyPayData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyPayData) {

this.DropDownList3.Items.Add(MyString); }

MySQL = \"Select * From 职员信息\";

DataTable MyPersonnelTable = new DataTable();

MyAdapter = new SqlDataAdapter(MySQL, MyConnection); MyAdapter.Fill(MyPersonnelTable); MyName = \"职员姓名\";

MyValue = MyPersonnelTable.Rows[0][MyName].ToString();

72

山东理工大学管理学院信管2008管理信息系统课程设计

foreach (DataRow MyRow in MyPersonnelTable.Rows) {

this.DropDownList1.Items.Add(MyRow[MyName].ToString()); }

if (MyConnection.State == ConnectionState.Open) {

MyConnection.Close(); } } }

protected void Button4_Click(object sender, EventArgs e) {//显示合同文件

string MyPath = HttpContext.Current.Server.MapPath(\"~/FileData/\") + this.TextBox18.Text;

System.Diagnostics.Process.Start(MyPath); }

protected void btnUpload_Click(object sender, EventArgs e) {//上传合同文件

string MyFileName = this.FileUpload1.FileName; if (MyFileName == \"\") {

house.notnull(); } else {

TextBox18.Text = MyFileName.ToString(); string MyTargetFile = System.IO.Path.Combine(HttpContext.Current.Server.MapPath(\"~/FileData/\"), MyFileName);

this.FileUpload1.PostedFile.SaveAs(MyTargetFile); } }

protected void Button2_Click(object sender, EventArgs e) {//新增租售成交信息 String MySQLConnectionString = ConfigurationManager.ConnectionStrings[\"MyHouseDBConnectionString\"].ConnectionString;

string MySQL = \"Select * From 租售成交 Where (资料类型='\" + this.DropDownList2.Text + \"') AND (资料编号='\" + this.TextBox7.Text + \"')\"; SqlConnection MyConnection = new SqlConnection(MySQLConnectionString); MyConnection.Open();

DataTable MyQueryTable = new DataTable();

73

山东理工大学管理学院信管2008管理信息系统课程设计

SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection); MyAdapter.Fill(MyQueryTable); if (MyQueryTable.Rows.Count > 0) return;

if (MyConnection.State == ConnectionState.Open) {

MyConnection.Close(); }

if (this.TextBox7.Text != \"\" && this.TextBox8.Text != \"\" && this.TextBox9.Text != \"\" && this.TextBox10.Text != \"\" && this.TextBox12.Text != \"\" && this.TextBox13.Text != \"\" && this.TextBox14.Text != \"\" && this.TextBox15.Text != \"\" && this.TextBox16.Text != \"\" && this.TextBox17.Text != \"\" && this.TextBox18.Text != \"\" && this.TextBox19.Text != \"\" && this.TextBox20.Text != \"\") {

this.SqlDataSource1.Insert();

} else

house.notnull(); }

protected void Button3_Click(object sender, EventArgs e) {//修改租售成交信息

this.SqlDataSource1.Update(); }

protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)

{//弹出删除操作确认对话框

if (e.Row.RowType == DataControlRowType.DataRow) {

Button MyButton = (Button)e.Row.FindControl(\"Button1\");

MyButton.OnClientClick = \"return confirm('是否确认删除当前选择的记录?')\"; } }

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)

{//在控件中显示选择的记录 this.TextBox20.Text = this.GridView1.SelectedRow.Cells[2].Text.ToString(); this.DropDownList1.SelectedValue = this.GridView1.SelectedRow.Cells[3].Text.ToString();

74

山东理工大学管理学院信管2008管理信息系统课程设计

this.DropDownList2.SelectedValue

this.GridView1.SelectedRow.Cells[4].Text.ToString(); this.TextBox7.Text

this.GridView1.SelectedRow.Cells[5].Text.ToString(); this.TextBox8.Text

this.GridView1.SelectedRow.Cells[6].Text.ToString(); this.TextBox9.Text

this.GridView1.SelectedRow.Cells[7].Text.ToString(); this.TextBox10.Text

this.GridView1.SelectedRow.Cells[8].Text.ToString(); this.DropDownList3.SelectedValue

this.GridView1.SelectedRow.Cells[9].Text.ToString(); this.TextBox12.Text

this.GridView1.SelectedRow.Cells[10].Text.ToString(); this.TextBox13.Text

this.GridView1.SelectedRow.Cells[11].Text.ToString(); this.TextBox14.Text

this.GridView1.SelectedRow.Cells[12].Text.ToString(); this.TextBox15.Text

this.GridView1.SelectedRow.Cells[13].Text.ToString(); this.TextBox16.Text

this.GridView1.SelectedRow.Cells[14].Text.ToString(); this.TextBox17.Text

this.GridView1.SelectedRow.Cells[15].Text.ToString(); this.TextBox18.Text

this.GridView1.SelectedRow.Cells[16].Text.ToString(); this.TextBox19.Text

this.GridView1.SelectedRow.Cells[17].Text.ToString(); } }

4.房源字典管理

75

= = = = = = = = = = = = = =

山东理工大学管理学院信管2008管理信息系统课程设计

功能:增加房源参数。 核心代码:

//文件名:ParameterForm.aspx.cs using System;

using System.Data;

using System.Configuration; using System.Collections; using System.Web;

using System.Web.Security; using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; //do u know 51aspx?

using System.Data.SqlClient;

public partial class CompanyManage_ParameterForm : System.Web.UI.Page {

protected void Page_Load(object sender, EventArgs e) { }

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)

{//显示房源参数值 String MySQLConnectionString = ConfigurationManager.ConnectionStrings[\"MyHouseDBConnectionString\"].ConnectionString;

string MySQL = \"Select * From 房源参数 Where 自编号='CQ001'\"; SqlConnection MyConnection = new

76

山东理工大学管理学院信管2008管理信息系统课程设计

SqlConnection(MySQLConnectionString); MyConnection.Open();

DataTable MyHouseTable = new DataTable(); SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection); MyAdapter.Fill(MyHouseTable);

string MyName = this.DropDownList1.SelectedValue.ToString(); string MyValue = MyHouseTable.Rows[0][MyName].ToString(); String[] MyData = MyValue.Split(new char[1] { '、' }); this.TextBox1.Text = \"\";

foreach (string MyLine in MyData) {

if (MyLine.Length > 0) {

this.TextBox1.Text += MyLine + \"、\"; } }

if (MyConnection.State == ConnectionState.Open) {

MyConnection.Close(); } }

protected void Button1_Click(object sender, EventArgs e) {//新增房源参数值 String MySQLConnectionString = ConfigurationManager.ConnectionStrings[\"MyHouseDBConnectionString\"].ConnectionString;

SqlConnection MyConnection = new SqlConnection(MySQLConnectionString); MyConnection.Open();

string MyName = this.DropDownList1.SelectedValue.ToString(); string MyValue = this.TextBox1.Text;

string MySQL = \"Update 房源参数 Set \" + MyName + \"='\" + MyValue + \"' Where 自编号='CQ001'\";

SqlCommand MyCommand = new SqlCommand(MySQL, MyConnection); MyCommand.ExecuteNonQuery();

if (MyConnection.State == ConnectionState.Open) {

MyConnection.Close(); } }

protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)

{//显示其他参数值 String MySQLConnectionString =

77

山东理工大学管理学院信管2008管理信息系统课程设计

ConfigurationManager.ConnectionStrings[\"MyHouseDBConnectionString\"].ConnectionString;

string MySQL = \"Select * From 其他参数 Where 自编号='CQ001'\"; SqlConnection MyConnection = new SqlConnection(MySQLConnectionString); MyConnection.Open();

DataTable MyHouseTable = new DataTable(); SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection); MyAdapter.Fill(MyHouseTable);

string MyName = this.DropDownList2.SelectedValue.ToString(); string MyValue = MyHouseTable.Rows[0][MyName].ToString(); String[] MyData = MyValue.Split(new char[1] { '、' }); this.TextBox2.Text = \"\";

foreach (string MyLine in MyData) {

if (MyLine.Length > 0) {

this.TextBox2.Text += MyLine + \"、\"; } }

if (MyConnection.State == ConnectionState.Open) {

MyConnection.Close(); } }

protected void Button2_Click(object sender, EventArgs e) {//新增其他参数值 String MySQLConnectionString = ConfigurationManager.ConnectionStrings[\"MyHouseDBConnectionString\"].ConnectionString;

SqlConnection MyConnection = new SqlConnection(MySQLConnectionString); MyConnection.Open();

string MyName = this.DropDownList2.SelectedValue.ToString(); string MyValue = this.TextBox2.Text;

string MySQL = \"Update 其他参数 Set \" + MyName + \"='\" + MyValue + \"' Where 自编号='CQ001'\";

SqlCommand MyCommand = new SqlCommand(MySQL, MyConnection); MyCommand.ExecuteNonQuery();

if (MyConnection.State == ConnectionState.Open) {

MyConnection.Close(); } }

78

山东理工大学管理学院信管2008管理信息系统课程设计

}

5.6 公司信息管理 1.公司信息设置

此模块中,可以查询公司的相关信息,在空处可以填写公司名称,可以对其中的信息进行编辑,删除,新建,并且可以添加图片以用来说明等相关操作

2.公司职员管理

79

山东理工大学管理学院信管2008管理信息系统课程设计

对于此模块,在公司内部管理中,可以对职员的相关信息进行查询,包括编号的输入,姓名的填写,性别,学历,职务,部门的选择,身份证,出生日期的选择,还有入职日期,婚姻状况,联想电话,家庭住址,邮政编码,邮箱的设置。同时包括,补充说明,和工作简历的填写,当进行查询后会弹出相应的信息,并且可以做出选择和删除操作。 核心代码:

//文件名:PersonnelForm.aspx.cs using System;

using System.Data;

using System.Configuration; using System.Collections; using System.Web;

using System.Web.Security; using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;

public partial class CompanyManage_PersonnelForm : System.Web.UI.Page {

protected void Page_Load(object sender, EventArgs e) {

string MyForbidString = Session[\"MyForbid\"].ToString(); if (MyForbidString.IndexOf(\"A2\") > 1) {

80

山东理工大学管理学院信管2008管理信息系统课程设计

Server.Transfer(\"~/SystemManage/AllErrorHelp.aspx\"); } }

protected void Button2_Click(object sender, EventArgs e) {//新增公司职员信息

if (this.TextBox2.Text != \"\"&& this.TextBox3.Text != \"\"&& this.TextBox6.Text != \"\"&& this.TextBox7.Text != \"\"&& this.TextBox8.Text != \"\"&& this.TextBox9.Text != \"\"&& this.TextBox10.Text != \"\"&& this.TextBox12.Text != \"\"&& this.TextBox13.Text != \"\"&& this.TextBox14.Text != \"\"&& this.TextBox15.Text != \"\"&& this.TextBox16.Text != \"\"&& this.TextBox17.Text != \"\") {

this.SqlDataSource1.Insert(); }

house.notnull(); }

protected void Button3_Click(object sender, EventArgs e) {//修改公司职员信息

this.SqlDataSource1.Update(); }

protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)

{//弹出删除操作确认对话框

if (e.Row.RowType == DataControlRowType.DataRow) {

Button MyButton = (Button)e.Row.FindControl(\"Button1\");

MyButton.OnClientClick = \"return confirm('是否确认删除当前选择的记录?')\"; } }

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)

{//在控件中显示选择的记录 this.TextBox2.Text = this.GridView1.SelectedRow.Cells[2].Text.ToString(); this.TextBox3.Text = this.GridView1.SelectedRow.Cells[3].Text.ToString(); this.DropDownList1.SelectedItem.Text = this.GridView1.SelectedRow.Cells[4].Text.ToString(); this.DropDownList2.SelectedItem.Text = this.GridView1.SelectedRow.Cells[5].Text.ToString(); this.TextBox6.Text = this.GridView1.SelectedRow.Cells[6].Text.ToString();

81

山东理工大学管理学院信管2008管理信息系统课程设计

this.TextBox7.Text

this.GridView1.SelectedRow.Cells[7].Text.ToString(); this.TextBox8.Text

this.GridView1.SelectedRow.Cells[8].Text.ToString(); this.TextBox9.Text

this.GridView1.SelectedRow.Cells[9].Text.ToString(); this.TextBox10.Text

this.GridView1.SelectedRow.Cells[10].Text.ToString(); this.DropDownList3.Text

this.GridView1.SelectedRow.Cells[11].Text.ToString(); this.TextBox12.Text

this.GridView1.SelectedRow.Cells[12].Text.ToString(); this.TextBox13.Text

this.GridView1.SelectedRow.Cells[13].Text.ToString(); this.TextBox14.Text

this.GridView1.SelectedRow.Cells[14].Text.ToString(); this.TextBox15.Text

this.GridView1.SelectedRow.Cells[15].Text.ToString(); this.TextBox16.Text

this.GridView1.SelectedRow.Cells[16].Text.ToString(); this.TextBox17.Text

this.GridView1.SelectedRow.Cells[17].Text.ToString(); } }

3.业务资料管理

82

= = = = = = = = = = =

山东理工大学管理学院信管2008管理信息系统课程设计

在此模块中,作为用户可以进行,标题的输入,资料编号的输入,资料类别的输入,资料标题的查询,同时也包含着补充说明,内容摘要,使查询更加精确,同时还可以上传处理好的文件,供以后查询,同时在查询出的资料中我们仍然可以进行,选择与删除的操作 核心代码:

//文件名:ManualForm.aspx.cs using System;

using System.Data;

using System.Configuration; using System.Collections; using System.Web;

using System.Web.Security; using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;

public partial class CompanyManage_ManualForm : System.Web.UI.Page {

protected void Page_Load(object sender, EventArgs e) {

string MyForbidString = Session[\"MyForbid\"].ToString(); if (MyForbidString.IndexOf(\"A3\") > 1) {

Server.Transfer(\"~/SystemManage/AllErrorHelp.aspx\");

83

山东理工大学管理学院信管2008管理信息系统课程设计

} }

protected void btnUpload_Click(object sender, EventArgs e) {//上传指定资料文件

string MyFileName = this.FileUpload1.FileName; if (MyFileName == \"\") {

house.notnull(); } else {

TextBox7.Text = MyFileName.ToString(); string MyTargetFile = System.IO.Path.Combine(HttpContext.Current.Server.MapPath(\"~/FileData/\"), MyFileName);

this.FileUpload1.PostedFile.SaveAs(MyTargetFile); } }

protected void Button2_Click(object sender, EventArgs e) {//新增业务资料信息

if (this.TextBox2.Text != \"\" && this.TextBox3.Text != \"\" && this.TextBox4.Text != \"\" && this.TextBox5.Text != \"\" && this.TextBox6.Text != \"\" && this.TextBox7.Text != \"\") {

this.SqlDataSource1.Insert(); } else

house.notnull(); }

protected void Button3_Click(object sender, EventArgs e) {//修改业务资料信息

this.SqlDataSource1.Update(); }

protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)

{//弹出删除操作确认对话框

if (e.Row.RowType == DataControlRowType.DataRow) {

Button MyButton = (Button)e.Row.FindControl(\"Button1\");

MyButton.OnClientClick = \"return confirm('是否确认删除当前选择的记录?')\"; } }

84

山东理工大学管理学院信管2008管理信息系统课程设计

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)

{//在控件中显示选择的记录 this.TextBox2.Text = this.GridView1.SelectedRow.Cells[2].Text.ToString(); this.TextBox3.Text = this.GridView1.SelectedRow.Cells[3].Text.ToString(); this.TextBox4.Text = this.GridView1.SelectedRow.Cells[4].Text.ToString(); this.TextBox5.Text = this.GridView1.SelectedRow.Cells[5].Text.ToString(); this.TextBox6.Text = this.GridView1.SelectedRow.Cells[6].Text.ToString(); this.TextBox7.Text = this.GridView1.SelectedRow.Cells[7].Text.ToString(); }

protected void Button4_Click(object sender, EventArgs e) {//显示指定资料文件

string MyPath = HttpContext.Current.Server.MapPath(\"~/FileData/\") + this.TextBox7.Text;

System.Diagnostics.Process.Start(MyPath); } }

4.广告发布管理

85

山东理工大学管理学院信管2008管理信息系统课程设计

在此模块中,可以进行广告相对应的信息的输入和查询,还有经办人员的选择,资料类型的选择,编号的输入,媒体名称的输入,发布期号,截止日期,价格的输入,进而进行查询和选择,删除的操作 核心代码:、

//文件名:AdvertisementForm.aspx.cs using System;

using System.Data;

using System.Configuration; using System.Collections; using System.Web;

using System.Web.Security; using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;

using System.Data.SqlClient;

public partial class ContractManage_AdvertisementForm : System.Web.UI.Page {

protected void Page_Load(object sender, EventArgs e) {

string MyForbidString = Session[\"MyForbid\"].ToString(); if (MyForbidString.IndexOf(\"D1\") > 1) {

Server.Transfer(\"~/SystemManage/AllErrorHelp.aspx\"); }

if (!IsPostBack) {

String MySQLConnectionString = ConfigurationManager.ConnectionStrings[\"MyHouseDBConnectionString\"].ConnectionString;

SqlConnection MyConnection = new SqlConnection(MySQLConnectionString);

string MySQL = \"Select * From 职员信息\";

DataTable MyPersonnelTable = new DataTable();

SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection);

MyAdapter.Fill(MyPersonnelTable); string MyName = \"职员姓名\";

string MyValue = MyPersonnelTable.Rows[0][MyName].ToString(); foreach (DataRow MyRow in MyPersonnelTable.Rows) {

this.DropDownList1.Items.Add(MyRow[MyName].ToString()); }

86

山东理工大学管理学院信管2008管理信息系统课程设计

if (MyConnection.State == ConnectionState.Open) {

MyConnection.Close(); } } }

protected void Button2_Click(object sender, EventArgs e) {//新增广告发布信息

if (this.TextBox4.Text != \"\" && this.TextBox6.Text != \"\" && this.TextBox7.Text != \"\" && this.TextBox8.Text != \"\" && this.TextBox9.Text != \"\" && this.TextBox10.Text != \"\" && this.TextBox11.Text != \"\" && this.TextBox12.Text != \"\" && this.TextBox13.Text != \"\") {

this.SqlDataSource1.Insert(); } else

house.notnull(); }

protected void Button3_Click(object sender, EventArgs e) {//修改广告发布信息

this.SqlDataSource1.Update(); }

protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)

{//弹出删除操作确认对话框

if (e.Row.RowType == DataControlRowType.DataRow) {

Button MyButton = (Button)e.Row.FindControl(\"Button1\");

MyButton.OnClientClick = \"return confirm('是否确认删除当前选择的记录?')\"; } }

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)

{//在控件中显示选择的记录 this.TextBox4.Text = this.GridView1.SelectedRow.Cells[2].Text.ToString(); this.DropDownList1.SelectedValue = this.GridView1.SelectedRow.Cells[3].Text.ToString(); this.DropDownList2.SelectedValue = this.GridView1.SelectedRow.Cells[4].Text.ToString(); this.TextBox6.Text = this.GridView1.SelectedRow.Cells[5].Text.ToString();

87

山东理工大学管理学院信管2008管理信息系统课程设计

this.TextBox7.Text

this.GridView1.SelectedRow.Cells[6].Text.ToString(); this.TextBox8.Text

this.GridView1.SelectedRow.Cells[7].Text.ToString(); this.TextBox9.Text

this.GridView1.SelectedRow.Cells[8].Text.ToString(); this.TextBox10.Text

this.GridView1.SelectedRow.Cells[9].Text.ToString(); this.TextBox11.Text

this.GridView1.SelectedRow.Cells[10].Text.ToString(); this.TextBox12.Text

this.GridView1.SelectedRow.Cells[11].Text.ToString(); this.TextBox13.Text

this.GridView1.SelectedRow.Cells[12].Text.ToString(); } }

= = = = = = =

5.经济跟进管理

在此模块中的操作和广告发布模块中的相同,同样是为了达到便于查询,选择,删除的操作。 核心代码:

//文件名:TraceForm.aspx.cs using System;

using System.Data;

using System.Configuration; using System.Collections;

88

山东理工大学管理学院信管2008管理信息系统课程设计

using System.Web;

using System.Web.Security; using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;

using System.Data.SqlClient;

public partial class ContractManage_TraceForm : System.Web.UI.Page {

protected void Page_Load(object sender, EventArgs e) {

string MyForbidString = Session[\"MyForbid\"].ToString(); if (MyForbidString.IndexOf(\"D2\") > 1) {

Server.Transfer(\"~/SystemManage/AllErrorHelp.aspx\"); }

if (!IsPostBack) {

String MySQLConnectionString = ConfigurationManager.ConnectionStrings[\"MyHouseDBConnectionString\"].ConnectionString;

string MySQL = \"Select * From 其他参数 Where 自编号='CQ001'\"; SqlConnection MyConnection = new SqlConnection(MySQLConnectionString); MyConnection.Open();

DataTable MyHouseTable = new DataTable();

SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection);

MyAdapter.Fill(MyHouseTable); string MyName = \"跟进方式\";

string MyValue = MyHouseTable.Rows[0][MyName].ToString(); String[] MyDistData = MyValue.Split(new char[1] { '、' }); foreach (String MyString in MyDistData) {

this.DropDownList3.Items.Add(MyString); }

MySQL = \"Select * From 职员信息\";

DataTable MyPersonnelTable = new DataTable();

MyAdapter = new SqlDataAdapter(MySQL, MyConnection); MyAdapter.Fill(MyPersonnelTable); MyName = \"职员姓名\";

MyValue = MyPersonnelTable.Rows[0][MyName].ToString(); foreach (DataRow MyRow in MyPersonnelTable.Rows)

89

山东理工大学管理学院信管2008管理信息系统课程设计

{

this.DropDownList1.Items.Add(MyRow[MyName].ToString()); }

if (MyConnection.State == ConnectionState.Open) {

MyConnection.Close(); } } }

protected void Button2_Click(object sender, EventArgs e) {//新增经纪跟进信息

if (this.TextBox4.Text != \"\" && this.TextBox6.Text != \"\" && this.TextBox7.Text != \"\" && this.TextBox9.Text != \"\" && this.TextBox10.Text != \"\") {

this.SqlDataSource1.Insert(); } else

house.notnull(); }

protected void Button3_Click(object sender, EventArgs e) {//修改经纪跟进信息

this.SqlDataSource1.Update(); }

protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)

{//弹出删除操作确认对话框

if (e.Row.RowType == DataControlRowType.DataRow) {

Button MyButton = (Button)e.Row.FindControl(\"Button1\");

MyButton.OnClientClick = \"return confirm('是否确认删除当前选择的记录?')\"; } }

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)

{//在控件中显示选择的记录 this.TextBox4.Text = this.GridView1.SelectedRow.Cells[2].Text.ToString(); this.DropDownList1.SelectedValue = this.GridView1.SelectedRow.Cells[3].Text.ToString(); this.DropDownList2.SelectedValue = this.GridView1.SelectedRow.Cells[4].Text.ToString();

90

山东理工大学管理学院信管2008管理信息系统课程设计

this.TextBox6.Text

this.GridView1.SelectedRow.Cells[5].Text.ToString(); this.TextBox7.Text

this.GridView1.SelectedRow.Cells[6].Text.ToString(); this.DropDownList3.SelectedValue

this.GridView1.SelectedRow.Cells[7].Text.ToString(); this.TextBox9.Text

this.GridView1.SelectedRow.Cells[8].Text.ToString(); this.TextBox10.Text

this.GridView1.SelectedRow.Cells[9].Text.ToString(); } }

= = = = =

5.7 其他模块 1.查询用户密码

可以通过在空处输入用户名,和验证答案,来重新获取密码 2.修改用户密码

91

山东理工大学管理学院信管2008管理信息系统课程设计

通过原密码的输入,和新密码的输入两个过程,来最终确认新密码,来达到修改密码的结果,可以进行,修改密码和取消修改的操作。

3.分配用户权限

在此模块中,我们可以进行,用户名称,用户姓名,所在部门,联系电话,职责说明的操作,并且可以进行修改和新增;于此同时,还可以对与用户的职责进行单项或者是多项的选择。同样,也可以对与查询到的信息进行选择和删除的操作。

92

山东理工大学管理学院信管2008管理信息系统课程设计

核心代码:

//文件名:OperatorForm.aspx.cs using System;

using System.Data;

using System.Configuration; using System.Collections; using System.Web;

using System.Web.Security; using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;

public partial class System_OperatorForm : System.Web.UI.Page {

protected void Page_Load(object sender, EventArgs e) {

string MyForbidString = Session[\"MyForbid\"].ToString(); if (MyForbidString.IndexOf(\"E1\") > 1) {

Server.Transfer(\"~/SystemManage/AllErrorHelp.aspx\"); } }

protected void Button1_Click(object sender, EventArgs e) {//新增管理系统操作用户信息

this.SqlDataSource2.Insert(); }

protected void Button2_Click(object sender, EventArgs e) {//修改管理系统操作用户信息

this.SqlDataSource2.Update(); }

protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)

{//弹出删除操作确认对话框

if (e.Row.RowType == DataControlRowType.DataRow) {

Button MyButton = (Button)e.Row.FindControl(\"Button1\");

MyButton.OnClientClick = \"return confirm('是否确认删除当前选择的记录?')\"; } }

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)

{//在控件中显示选择的记录

93

山东理工大学管理学院信管2008管理信息系统课程设计

this.DropDownList1.Text = this.GridView1.SelectedRow.Cells[2].Text.ToString(); this.TextBox1.Text = this.GridView1.SelectedRow.Cells[3].Text.ToString(); this.TextBox2.Text = this.GridView1.SelectedRow.Cells[4].Text.ToString(); this.TextBox3.Text = this.GridView1.SelectedRow.Cells[5].Text.ToString(); this.TextBox4.Text = this.GridView1.SelectedRow.Cells[6].Text.ToString(); this.CheckBox1.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[7].Text.ToString()) == 1) ? true : false;

this.CheckBox2.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[8].Text.ToString()) == 1) ? true : false;

this.CheckBox3.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[9].Text.ToString()) == 1) ? true : false;

this.CheckBox4.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[10].Text.ToString()) == 1) ? true : false;

this.CheckBox5.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[11].Text.ToString()) == 1) ? true : false;

this.CheckBox6.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[12].Text.ToString()) == 1) ? true : false;

this.CheckBox7.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[13].Text.ToString()) == 1) ? true : false;

this.CheckBox8.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[14].Text.ToString()) == 1) ? true : false;

this.CheckBox9.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[15].Text.ToString()) == 1) ? true : false;

this.CheckBox10.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[16].Text.ToString()) == 1) ? true : false;

this.CheckBox11.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[17].Text.ToString()) == 1) ? true : false;

this.CheckBox12.Checked =

94

山东理工大学管理学院信管2008管理信息系统课程设计

(Convert.ToInt16(this.GridView1.SelectedRow.Cells[18].Text.ToString()) == 1) ? true : false;

this.CheckBox13.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[19].Text.ToString()) == 1) ? true : false;

this.CheckBox14.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[20].Text.ToString()) == 1) ? true : false;

this.CheckBox15.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[21].Text.ToString()) == 1) ? true : false;

this.CheckBox16.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[22].Text.ToString()) == 1) ? true : false;

this.CheckBox17.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[23].Text.ToString()) == 1) ? true : false;

this.CheckBox18.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[24].Text.ToString()) == 1) ? true : false; } }

95

山东理工大学管理学院信管2008管理信息系统课程设计

第六章 调试与总结

本设计主要分为页面、数据访问类、数据库,调用关系为窗体代码隐藏页->类文件->数据库里的存储过程,采用的是结构化程序设计方法,系统是由二大模块组成,各模块又由各小模块组成,且各模块之间是相互独立的。因此调试过程是先调试各个模块,各个模块调试好后再联调,以解决模块间的接口问题。在调试过程中存在程序运行时屏幕中多余显示信息的清除,循环、条件语句的转移,循环的退出及各子程序的返回等问题。以上问题均需在调试过程中一一加以注意,加以解决,达到自己的设计构想。经过调试,程序基本上通过了运行。

该系统界面简洁,操作方便,常用的功能齐全,但美中不足就是现在这个系统仍然还是C/S结构的,可能会给一些大的中介公司带来一定的麻烦,因为还要到每台机器上安装才可以实现网上买卖房屋,如果要是B/S结构的话,所有用户就可以通过web来实现买卖,这一点是有待完善的。

经过这次毕业设计,我已经初步了解了程序设计的基本方法和设计步骤,对编辑时需要注意的问题及对数据库的管理和应用有了较深的认识,并有了一定的实践经验。为我在今后的学习和工作中能够更好地运用所学到的计算机知识打下了基础。本房屋中介管理信息系统经过多次调试运行,基本上达到了用户的要求。由于本人的学识水平和经验不足,系统中可能有些问题没有考虑到。今后,我将不断努力学习,提高自己的学识水平和工作能力。

96

山东理工大学管理学院信管2008管理信息系统课程设计

结束语

经过近一个月的设计和开发,房屋中介管理信息系统基本开发完毕。其功能基本符合用户需求,能够完成信息的存储和查询,并提供部分系统维护功能,使用户方便进行数据备份和恢复、数据删除。对于数据的一致性的问题也通过程序进行了有效的解决。但是由于毕业设计时间较短,所以该系统还有许多不尽如人意的地方,比如用户只简单列了几个,成交的程序不够完善等几个方面的问题,这些都有待进一步改善。

97

山东理工大学管理学院信管2008管理信息系统课程设计

参考文献

[1] Timothy A. Budd.An Introduction to Object-Oriented Programming[M]. [2] Martin Kalin,孙艳春译.面向对象程序设计(Object-Oriented Programming in Java)[M].

[3] Stephen R . Schach.软件工程面向对象和传统的方法英文版[M]. [4] Simon Robinson, Christian Nagel, Karli Watson, Jay Glynn, Morgan Skinner, Bill Evjen.Professional C#[M].

[5] Geetanjali Arora(美).C#专业项目实例开发[M].北京:中国水利水电出版社,2003.

[6] 萨师煊,王珊.数据库系统概论[M].北京:高等教育出版社,2000. [7] 刘晓华.SQL Server 2000数据库应用开发[M].北京:电子工业出版社,2001.

[8] James Huddleston,杨浩译.C#数据库入门经典[M].北京:清华大学出版社,2006.

[9] 彭澎,饶简元,吴震瑞.边用边学C#[M].北京:清华大学出版社. [10] 杨树林,胡洁萍.C#程序设计与案例教程[M].北京:清华大学出版社.

98

因篇幅问题不能全部显示,请点此查看更多更全内容

Top