1.来访、来电、线索、客户明细
从界面上可以看到我们这里用到的控件有
控件名称 | 说明 |
标注(Label) | 控件可以在工具箱直接拖动至窗体,拖至窗体后右击属性可以修改控件的样式和各种属性,还可以编辑事件。 |
选项卡(TabControl) | |
下拉框(ComboBox) | |
文本(TextBox) | |
按钮(Button) | |
菜单(ToolStripMenuItem) | |
工具栏(ToolStrip) | |
图片列表(ImageList) | |
复选框(CheckBox) | |
表格(DataGridView) |
功能实现:
第一步:数据库
1、表与关系
表1: 房间资源表(dbo.SYS_RoomResource)
Primary Key(主键): RoomResourcesID
非主键ID值均是外键
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
RoomResourcesID | int - Identity |
| No | 房间资源ID
|
FloorID | int |
| Yes | 楼栋信息表,楼栋ID
|
TheCodeModelID | int |
| Yes | 属性明细表,代码模式ID
|
Number | nchar (10) |
| Yes | 编号
|
UnitNumberID | int |
| Yes | 单元表,单元ID
|
FloorStotey | nchar (10) |
| Yes | 楼层
|
RoomCategoryID | int |
| Yes | 属性明细表,房间类别ID
|
TowardID | int |
| Yes | 属性明细表,朝向ID
|
DoorModelID | int |
| Yes | 属性明细表,户型ID
|
RoomTypeID | int |
| Yes | 属性明细表,房间类型ID
|
RoomLandScapeID | int |
| Yes | 属性明细表,房间景观ID
|
RoomSpecialID | int |
| Yes | 属性明细表,房间特殊ID
|
ConstructionArea | decimal (18, 2) |
| Yes | 建筑面积
|
PricateArea | decimal (18, 2) |
| Yes | 私有面积
|
PublicArea | decimal (18, 2) |
| Yes | 公摊面积
|
Usage | decimal (18, 2) |
| Yes | 使用率
|
TheUnitPrice | decimal (18, 2) |
| Yes | 标价单价
|
BidPrice | decimal (18, 2) |
| Yes | 标价总价
|
NumberOfPrice | nchar (10) |
| Yes | 价格次数
|
SalesStatusID | int | ((102)) | Yes | 属性明细表,销售状态ID
|
BriefNote | nchar (30) |
| Yes | 简要备注
|
SchematicDiagram | image |
| Yes | 示意图
|
Chart | image |
| Yes | 效果图
|
表2: 项目信息表(dbo.SYS_ProjectInformation)
Primary Key(主键): ProjectID
非主键ID值均是外键
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
ProjectID | int - Identity |
| No | 项目ID
|
SortNumber | int |
| Yes | 排序号
|
ProjectAreaID | int |
| Yes | 属性明细表,项目区域ID
|
Project_FatherlID | int |
| Yes | 项目信息表,项目级别ID
|
ProjectName | nchar (20) |
| Yes | 项目名称
|
PropertyRightProjectName | nchar (20) |
| Yes | 产权项目名称
|
ProjectCompanyName | nchar (20) |
| Yes | 项目公司名称
|
ProjectAddress | nchar (50) |
| Yes | 项目座落地址
|
CaseWhether | bit |
| Yes | 是否结案
|
CancelWhether | bit | ((0)) | Yes | 有效否
|
表3: 房源保留表(dbo.PW_RoomSelect_Keep)
Primary Key(主键): KeepID
非主键ID值均是外键
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
KeepID | int - Identity |
| No | 保留ID
|
FloorID | int |
| Yes | 楼栋信息表,楼栋ID
|
RoomResourcesID | int |
| Yes | 房间资源ID,房间ID
|
UnitPrice | decimal (18, 2) |
| Yes | 单价
|
Price | decimal (18, 2) |
| Yes | 售价
|
KeepPeople | int |
| Yes | 保留人
|
Note | nchar (300) |
| Yes | 说明
|
StartDate | datetime |
| Yes | 开始时间
|
KeepTime | nchar (10) |
| Yes | 保留时长
|
KeepDate | nchar (10) |
| Yes | 保留天数
|
OperatingPerson | int |
| Yes | 经办人员
|
IncalidOr | bit | ((0)) | Yes | 作废否
|
表4: 客户信息表 (dbo.PW_ClientInformation)
Primary Key(主键): ClientID
非主键ID值均是外键
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
ClientID | int - Identity |
| No | 客户ID
|
ProjectID | int |
| Yes | 项目信息表,项目ID
|
ClientNumber | nchar (10) |
| Yes | 客户编号
|
ClientName | nchar (10) |
| Yes | 客户名称
|
EarlyVisitIntention | nchar (10) |
| Yes | 初访意向
|
Gender | nchar (10) |
| Yes | 性别
|
MaritalStatus | nchar (10) |
| Yes | 婚否
|
ClientRegistrationWayID | int |
| Yes | 属性明细表,客户登记方式ID
|
RelationPhone | nchar (15) |
| Yes | 联系电话
|
ElectronMail | nchar (30) |
| Yes | 电子邮箱
|
HomeBuyerConsultantID | int |
| Yes | 员工表,置业顾问ID
|
DateOfVisit | datetime |
| Yes | 来访日期
|
CommunicationAddress | nchar (50) |
| Yes | 通讯地址
|
Postcode | nchar (10) |
| Yes | 邮编
|
IDentityCard | nchar (30) |
| Yes | 身份证号
|
BirthDay | date |
| Yes | 出生日期
|
Age | nchar (20) |
| Yes | 年龄
|
Professional | nchar (20) |
| Yes | 职业
|
NowLivingArea | nchar (20) |
| Yes | 现居住区域
|
LearnTheWayToTheCase | nchar (20) |
| Yes | 获取本案途径
|
VisitConstitute | nchar (20) |
| Yes | 来客构成
|
Traffic | nchar (20) |
| Yes | 交通
|
RealEstateSituation | nchar (20) |
| Yes | 置业状况
|
ResidentialMortgageLoans | nchar (20) |
| Yes | 住宅按揭贷款
|
HomesBuyersPurpose | nchar (20) |
| Yes | 置业目的
|
PlanTorealEstatePrice | nchar (20) |
| Yes | 计划置业价格
|
DemandArea | nchar (20) |
| Yes | 需求面积
|
PaymentWay | nchar (20) |
| Yes | 付款方式ID
|
BuyingConsideration | nchar (20) |
| Yes | 买房考虑因素
|
IncalidOr | bit | ((0)) | Yes | 作废否
|
表5: 预定表 (dbo.PW_ReserveUnit)
Primary Key(主键): ReserveUnitID
非主键ID值均是外键
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
ReserveUnitID | int - Identity |
| No | 预订单元ID
|
ClientID | int |
| Yes | 客户表,客户ID
|
FloorID | int |
| Yes | 楼栋信息表,楼栋ID
|
UnitNumberID | int |
| Yes | 单元表,单元ID
|
RoomNumeral | nchar (10) |
| Yes | 房间排号
|
PresalseArea | nchar (10) |
| Yes | 预售面积
|
ReservationPrice | money |
| Yes | 预收单价
|
BookingReservationPrice | money |
| Yes | 预定总价
|
AccountsReceivableBookingGoid | money |
| Yes | 应收预约金
|
BookingDate | datetime |
| Yes | 预定日期
|
ValidDate | datetime |
| Yes | 有效日期
|
BriefNote | nchar (20) |
| Yes | 简要备注
|
AuditDate | date |
| Yes | 审核日期
|
NewReserveUnitID | int |
| Yes | 预定表,新预定ID
|
ChangeReason | int |
| Yes | 属性明细表,变更原因ID
|
IncalidOr | bit | ((0)) | Yes | 作废否
|
表6: 预留表 (dbo. PW_SeserveUnit)
Primary Key(主键): SeserveUnitID
非主键ID值均是外键
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
SeserveUnitID | int - Identity |
| No | 预留单元ID
|
ClientID | int |
| Yes | 客户信息表,客户ID
|
FloorID | int |
| Yes | 楼栋信息表,楼栋ID
|
UnitNumberID | int |
| Yes | 房间资源表,房间单元ID
|
RoomNumeral | nchar (10) |
| Yes | 房间排号
|
PresalseArea | decimal (18, 2) |
| Yes | 预售面积
|
SeservationUnitPrice | decimal (18, 2) |
| Yes | 预留单价
|
BookingSeservationPrice | decimal (18, 2) |
| Yes | 预留总价
|
AccountsReceivableBookingGoid | money |
| Yes | 应收预约金
|
SeservatingDate | datetime |
| Yes | 预留日期
|
ValidDate | datetime |
| Yes | 有效日期
|
BriefNote | nchar (100) |
| Yes | 简要备注
|
AuditDate | datetime |
| Yes | 审核日期
|
NewSeserveUnitID | int |
| Yes | 预留表,新的预留ID
|
ChangeReason | int |
| Yes | 变更原因
|
IncalidOr | bit | ((0)) | Yes | 作废否
|
表7: 认购表 (dbo. PW_SubscribeUnit)
Primary Key(主键): SubscribeUnitID
非主键ID值均是外键
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
SubscribeUnitID | int - Identity |
| No | 认购单元ID
|
SalesChangeID | int |
| Yes | 销售便更表,销售变更ID
|
SubscriptioNumber | nchar (20) |
| Yes | 认购单编号
|
SubscribeToDate | datetime |
| Yes | 认购日期
|
AnticipatedDateSigned | datetime |
| Yes | 预计签约日期
|
ContractArea | nchar (10) |
| Yes | 合同面积
|
TypeOfPanymentID | int |
| Yes | 付款方式表,付款方式ID
|
PaymentDetailsOfNameID | int |
| Yes | 付款方式明细表,付款名称细目ID
|
SalesAreaOfWayID | int |
| Yes | 属性明细表,销售面积方式ID
|
FsvorableDiscount | decimal (18, 2) |
| Yes | 优惠折扣
|
ClinchADealUnitPrice | money |
| Yes | 成交单价
|
ClinchADealThePrice | money |
| Yes | 成交总价
|
ClientID | int |
| Yes | 客户信息表,客户ID
|
AgentID | int |
| Yes | 员工表,经办人ID
|
BriefNote | nchar (20) |
| Yes | 简要备注
|
ReviewWhether | bit | ((0)) | Yes | 审核否
|
CancelWhether | bit | ((0)) | Yes | 作废否
|
ChangeOfAuditStatusID | int |
| Yes | 属性明细表,变更审核状态ID
|
RoomResourcesID | int |
| Yes | 房间资源表,房源ID
|
AfterUpdateID | int |
| Yes | 认购表,修改后的认购ID
|
表8: 认筹表 (dbo. PW_ClientConfessToRaise)
Primary Key(主键): ClientConfessToRaiseID
非主键ID值均是外键
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
ClientConfessToRaiseID | int - Identity |
| No | 客户认筹ID
|
ClientID | int |
| Yes | 客户信息表,客户ID
|
RaiseNumeralRecognition | nchar (10) |
| Yes | 认筹排号
|
TheOrderNumber | nchar (10) |
| Yes | 订单号
|
ConfessToRaiseClassificationID | int |
| Yes | 属性明细表,筹卡分类ID
|
AccountsReceivableAppointmentGold | money |
| Yes | 应收预约金
|
ConfesstoraiseDate | datetime |
| Yes | 认筹日期
|
EffectiveDate | datetime |
| Yes | 有效日期
|
IntentionUnitInstructions | nchar (10) |
| Yes | 意向单元说明
|
Note | nchar (30) |
| Yes | 备注
|
ToSeserve | bit | ((0)) | Yes | 转预留否
|
SeserveID | int |
| Yes | 预留表,预留ID
|
AuditWhether | bit | ((0)) | Yes | 审核否
|
IncalidWhether | bit | ((0)) | Yes | 作废否
|
AfterUpdateID | int |
| Yes | 认筹表,修改后ID
|
表9: 员工表 (dbo. SYS_Staff)
Primary Key(主键): StaffID
非主键ID值均是外键
列名 | 数据类型 | Nulls? | 说明 |
StaffID | int - Identity | No | 员工ID
|
StaffNumber | nchar (10) | Yes | 员工编号
|
StaffName | nchar (10) | Yes | 员工姓名
|
DepartMentID | int | Yes | 所属部门
|
GenderID | int | Yes | 属性明细表,性别ID
|
Age | int | Yes | 年龄
|
EducationBackgroundID | int | Yes | 属性明细表,学历ID
|
MarryWhether | bit | Yes | 婚否
|
Position | nchar (10) | Yes | 职位
|
ContactPhoneNumber | nchar (15) | Yes | 联系电话
|
ContactAddress | nchar (20) | Yes | 联系地址
|
Notes | nchar (100) | Yes | 备注
|
StaffImage | image | Yes | 员工照片
|
表10: 属性明细表(dbo.SYS_AttributeDetails)
Primary Key(主键): AttributeDetailsID
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
AttributeDetailsID | int - Identity |
| No | 属性明细ID
|
AuttributeSetID | int |
| Yes | 属性集合表,属性集合ID
|
AuttributeDetailsName | nchar (10) |
| Yes | 属性明细名称
|
EffectiveWhether | bit | ((1)) | Yes | 有效否
|
2、具体代码实现
第一步:数据库存储过程
if(@type='frmMarketManagement_CustomerManagement_btnSelectProject_Click')--查询
begin
SELECT ProjectID, RTRIM(SortNumber) as 排序号, RTRIM(ProjectName) as 项目名称
FROM SYS_ProjectInformation
end
if(@type='CustomerManagement_Load_cboHomeBuyersConsultant')--查询置业顾问,用来绑定cboHomeBuyersConsultant
begin
SELECT StaffID, RTRIM(StaffNumber) as 序号, RTRIM(StaffName) AS 置业顾问
FROM SYS_Staff
end
if(@type='CustomerManagement_btnSelect_Click_SelectClientDetail')--查询客户详细信息
begin
SELECT PW_ClientInformation.ClientID, PW_ClientInformation.ProjectID, RTRIM(PW_ClientInformation.ClientNumber) as 客户号,
RTRIM(PW_ClientInformation.ClientName) as 客户名称, RTRIM(PW_ClientInformation.EarlyVisitIntention) 意向程度,
RTRIM(PW_ClientInformation.Gender) as 性别, RTRIM(PW_ClientInformation.MaritalStatus) 婚否, PW_ClientInformation.ClientRegistrationWayID,
RTRIM(PW_ClientInformation.RelationPhone) as 联系电话, RTRIM(PW_ClientInformation.ElectronMail) AS Email,
PW_ClientInformation.HomeBuyerConsultantID, PW_ClientInformation.DateOfVisit as 来访时间,RTRIM(PW_ClientInformation.CommunicationAddress) as 通讯地址,
RTRIM(PW_ClientInformation.Postcode) as 邮编,RTRIM(PW_ClientInformation.IDentityCard) as 身份证号,
RTRIM(SYS_AttributeDetails.AuttributeDetailsName) as 来访方式, RTRIM(SYS_Staff.StaffName) as 置业顾问
FROM PW_ClientInformation INNER JOIN
SYS_AttributeDetails ON PW_ClientInformation.ClientRegistrationWayID = SYS_AttributeDetails.AttributeDetailsID INNER JOIN
SYS_Staff ON PW_ClientInformation.HomeBuyerConsultantID = SYS_Staff.StaffID and PW_ClientInformation.IncalidOr=0
end
if(@type='CustomerManagement_btnSelect_Click_SelectClientDetailNew')--根据登记方式查询客户信息
begin
SELECT PW_ClientInformation.ClientID, PW_ClientInformation.ProjectID, PW_ClientInformation.ClientNumber as 客户号,
RTRIM(PW_ClientInformation.ClientName) as 客户名称, RTRIM(PW_ClientInformation.EarlyVisitIntention) 意向程度,
RTRIM(PW_ClientInformation.Gender) as 性别, RTRIM(PW_ClientInformation.MaritalStatus) 婚否, PW_ClientInformation.ClientRegistrationWayID,
RTRIM(PW_ClientInformation.RelationPhone) as 联系电话, RTRIM(PW_ClientInformation.ElectronMail) AS Email,
PW_ClientInformation.HomeBuyerConsultantID, PW_ClientInformation.DateOfVisit as 来访时间,RTRIM(PW_ClientInformation.CommunicationAddress) as 通讯地址,
RTRIM(PW_ClientInformation.Postcode) as 邮编,RTRIM(PW_ClientInformation.IDentityCard) as 身份证号,
RTRIM(SYS_AttributeDetails.AuttributeDetailsName) as 来访方式, RTRIM(SYS_Staff.StaffName) as 置业顾问
FROM PW_ClientInformation INNER JOIN
SYS_AttributeDetails ON PW_ClientInformation.ClientRegistrationWayID = SYS_AttributeDetails.AttributeDetailsID INNER JOIN
SYS_Staff ON PW_ClientInformation.HomeBuyerConsultantID = SYS_Staff.StaffID
WHERE PW_ClientInformation.ClientRegistrationWayID=@ClientRegistrationWayID and PW_ClientInformation.IncalidOr=0
end
if(@type='CustomerManagement_btnSelect_Click_MultiSelect')--不定条件查询相关客户信息
begin
declare @sql varchar(1000)='where PW_ClientInformation.IncalidOr = 0 '
if @ClientRegistrationWayID !=''
set @sql+=' and PW_ClientInformation.ClientRegistrationWayID = ' + rtrim(@ClientRegistrationWayID)
if @sqlProjectID !=''
set @sql+=' and PW_ClientInformation.ProjectID = ' + rtrim(@sqlProjectID)
if @sqlClientType !=''
begin
if @sqlClientType ='未购有效'
set @sql+=' and (PW_ClientInformation.ClientID in(SELECT ClientID
FROM PW_ClientConfessToRaise where PW_ClientConfessToRaise.IncalidWhether=0)
or PW_ClientInformation.ClientID in(SELECT ClientID
FROM PW_ReserveUnit where PW_ReserveUnit.IncalidOr=0 )
or PW_ClientInformation.ClientID in(SELECT ClientID
FROM PW_SeserveUnit where PW_SeserveUnit.IncalidOr=0 )
or PW_ClientInformation.ClientID in(SELECT KeepPeople
FROM PW_RoomSelect_Keep
where PW_RoomSelect_Keep.IncalidOr=0) ) ' ---条件的拼接
if @sqlClientType ='未购'
set @sql+=' and (PW_ClientInformation.ClientID not in(SELECT ClientID
FROM PW_ClientConfessToRaise where PW_ClientConfessToRaise.IncalidWhether=0)
and PW_ClientInformation.ClientID not in(SELECT ClientID
FROM PW_ReserveUnit where PW_ReserveUnit.IncalidOr=0 )
and PW_ClientInformation.ClientID not in(SELECT ClientID
FROM PW_SeserveUnit where PW_SeserveUnit.IncalidOr=0 )
and PW_ClientInformation.ClientID not in(SELECT KeepPeople
FROM PW_RoomSelect_Keep
where PW_RoomSelect_Keep.IncalidOr=0)
and PW_ClientInformation.ClientID not in(SELECT ClientID
FROM PW_SubscribeUnit
where PW_SubscribeUnit.CancelWhether=0) ) '
if @sqlClientType ='已购'
set @sql+=' and PW_ClientInformation.ClientID in(SELECT RoomResourcesID
FROM PW_SubscribeUnit
where PW_SubscribeUnit.CancelWhether=0) '
end
if @sqlIntention !=''
set @sql+=' and PW_ClientInformation.EarlyVisitIntention = ''' + rtrim(@sqlIntention)+''''
if @sqlHomeBuyerConsultantID !=''
set @sql+=' and PW_ClientInformation.HomeBuyerConsultantID = ' + rtrim(@sqlHomeBuyerConsultantID)
if @sqlBeignDate !=''
set @sql+=' and PW_ClientInformation.DateOfVisit between ''' + rtrim(@sqlBeignDate) + ''' and '''+ rtrim(@sqlEndDate)+''''
exec('SELECT PW_ClientInformation.ClientID, PW_ClientInformation.ProjectID, PW_ClientInformation.ClientNumber as 客户号,
RTRIM(PW_ClientInformation.ClientName) as 客户名称, RTRIM(PW_ClientInformation.EarlyVisitIntention) 意向程度,
RTRIM(PW_ClientInformation.Gender) as 性别, RTRIM(PW_ClientInformation.MaritalStatus) 婚否, PW_ClientInformation.ClientRegistrationWayID,
RTRIM(PW_ClientInformation.RelationPhone) as 联系电话, RTRIM(PW_ClientInformation.ElectronMail) AS Email,
PW_ClientInformation.HomeBuyerConsultantID, PW_ClientInformation.DateOfVisit as 来访时间,RTRIM(PW_ClientInformation.CommunicationAddress) as 通讯地址,
RTRIM(PW_ClientInformation.Postcode) as 邮编,RTRIM(PW_ClientInformation.IDentityCard) as 身份证号,
RTRIM(SYS_AttributeDetails.AuttributeDetailsName) as 来访方式, RTRIM(SYS_Staff.StaffName) as 置业顾问
FROM PW_ClientInformation INNER JOIN
SYS_AttributeDetails ON PW_ClientInformation.ClientRegistrationWayID = SYS_AttributeDetails.AttributeDetailsID INNER JOIN
SYS_Staff ON PW_ClientInformation.HomeBuyerConsultantID = SYS_Staff.StaffID ' + @sql) --执行相应代码
return
end
if(@type='tsbtnDelete_Click_SelectClient')-- 删除客户信息前条件查询
begin
SELECT ClientID, rtrim(ClientName) as ClientName
FROM PW_ClientInformation
where (PW_ClientInformation.ClientID not in(SELECT ClientID
FROM PW_ClientConfessToRaise where PW_ClientConfessToRaise.IncalidWhether=0)
and PW_ClientInformation.ClientID not in(SELECT ClientID
FROM PW_ReserveUnit where PW_ReserveUnit.IncalidOr=0 )
and PW_ClientInformation.ClientID not in(SELECT ClientID
FROM PW_SeserveUnit where PW_SeserveUnit.IncalidOr=0 )
and PW_ClientInformation.ClientID not in(SELECT KeepPeople
FROM PW_RoomSelect_Keep
where PW_RoomSelect_Keep.IncalidOr=0)
and PW_ClientInformation.ClientID not in(SELECT ClientID
FROM PW_SubscribeUnit
where PW_SubscribeUnit.CancelWhether=0)) and PW_ClientInformation.ClientID = @ClientID and PW_ClientInformation.IncalidOr=0 --当要删除的客户没有相关交易才能查询出来
end
if(@type='tsbtnDelete_Click_DeleteClientMsg')--修改客户信息里边的作废否,实现删除
begin
UPDATE PW_ClientInformation
SET IncalidOr = 1
where PW_ClientInformation.ClientID = @ClientID
end
第二步:逻辑层(BLL)里边的代码
DALPublic.DALPublic myDALPublic = new DALPublic.DALPublic();
[OperationContract]
#region
public DataSet frmMarketManagement_CustomerManagement_btnSelectProject_Click()
{
SqlParameter[] SQLCMDpas = { new SqlParameter("@type", SqlDbType.Char),
};
SQLCMDpas[0].Value = "frmMarketManagement_CustomerManagement_btnSelectProject_Click";
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_CustomerManagement", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 绑定cbo置业顾问
public DataSet CustomerManagement_Load_cboHomeBuyersConsultant()
{
SqlParameter[] SQLCMDpas = { new SqlParameter("@type", SqlDbType.Char),
};
SQLCMDpas[0].Value = "CustomerManagement_Load_cboHomeBuyersConsultant";
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_CustomerManagement", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region
public DataSet CustomerManagement_btnSelect_Click_SelectClientDetail()
{
SqlParameter[] SQLCMDpas = { new SqlParameter("@type", SqlDbType.Char),
};
SQLCMDpas[0].Value = "CustomerManagement_btnSelect_Click_SelectClientDetail";
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_CustomerManagement", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region
public DataSet CustomerManagement_btnSelect_Click_SelectClientDetailNew(int intClientRegistrationWayID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@type", SqlDbType.Char),
new SqlParameter("@ClientRegistrationWayID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "CustomerManagement_btnSelect_Click_SelectClientDetailNew";
SQLCMDpas[1].Value = intClientRegistrationWayID.ToString();
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_CustomerManagement", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 多条件查询
public DataSet CustomerManagement_btnSelect_Click_MultiSelect(string strClientRegistrationWayID, string strProjectID, string strIntention, string strHomeBuyerConsultantID, string strBeginDate, string strEndDate,string strsqlClientType)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@type", SqlDbType.Char),
new SqlParameter("@ClientRegistrationWayID", SqlDbType.Char),
new SqlParameter("@sqlProjectID", SqlDbType.Char),
new SqlParameter("@sqlIntention", SqlDbType.Char),
new SqlParameter("@sqlHomeBuyerConsultantID", SqlDbType.Char),
new SqlParameter("@sqlBeignDate", SqlDbType.Char),
new SqlParameter("@sqlEndDate", SqlDbType.Char),
new SqlParameter("@sqlClientType", SqlDbType.Char),
};
SQLCMDpas[0].Value = "CustomerManagement_btnSelect_Click_MultiSelect";
SQLCMDpas[1].Value = strClientRegistrationWayID;
SQLCMDpas[2].Value = strProjectID;
SQLCMDpas[3].Value = strIntention;
SQLCMDpas[4].Value = strHomeBuyerConsultantID;
SQLCMDpas[5].Value = strBeginDate;
SQLCMDpas[6].Value = strEndDate;
SQLCMDpas[7].Value = strsqlClientType;
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_CustomerManagement", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 验证数据是否符合要求
public DataSet tsbtnDelete_Click_SelectClient(int intClientID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@type", SqlDbType.Char),
new SqlParameter("@ClientID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "tsbtnDelete_Click_SelectClient";
SQLCMDpas[1].Value = intClientID;
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_CustomerManagement", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 删除客户信息
public int tsbtnDelete_Click_DeleteClientMsg(int intClientID)
{
SqlParameter[] SQLCMDpas ={
new SqlParameter("@type",SqlDbType.Char),
new SqlParameter("@ClientID",SqlDbType.Int),
};
SQLCMDpas[0].Value = "tsbtnDelete_Click_DeleteClientMsg";
SQLCMDpas[1].Value = intClientID;
return myDALPublic.DAL_OPTableDB_Par("frmMarketManagement_CustomerManagement", SQLCMDpas);
}
#endregion
第三步:界面层(UIL)具体相关事件和代码
frmMain frmmain;//声明主界面
public frmMarketManagement_CustomerManagement(frmMain frm)//窗体传值
{
frmmain = frm;//将传过来的界面赋给声明的那个主界面
InitializeComponent();
}
BLL新锐房地产销售系统.MarketManagement.frmMarketManagement_CustomerManagement.frmMarketManagement_CustomerManagementClient myfrmMarketManagement_CustomerManagementClient = new
BLL新锐房地产销售系统.MarketManagement.frmMarketManagement_CustomerManagement.frmMarketManagement_CustomerManagementClient();//实例化BLL
private void tsbtnExit_Click(object sender, EventArgs e)//点击退出按钮时发生
{
this.Close();
}
DataTable dtClientDetail;//声明一个表
private void frmMarketManagement_CustomerManagement_FormClosing(object sender, FormClosingEventArgs e)//在窗体关闭的时候
{
frmmain.RemoveTabPage();
}
private void frmMarketManagement_CustomerManagement_Load(object sender, EventArgs e)//窗体加载事件
{
dgvClientDetail.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;//行标题宽度调整
DataTable dtProject = new DataTable();
dtProject = myfrmMarketManagement_CustomerManagementClient.frmMarketManagement_CustomerManagement_btnSelectProject_Click().Tables[0];//查询项目表
DataTable dtHomeBuyersConsultant = myfrmMarketManagement_CustomerManagementClient.CustomerManagement_Load_cboHomeBuyersConsultant().Tables[0];//查询置业顾问表
DataRow dr = dtHomeBuyersConsultant.NewRow();//声明一个置业顾问表的数据行
dr["StaffID"] = 0;//设定自定义的行的值
dr["序号"] = "000";
dr["置业顾问"] = "全部";
dtHomeBuyersConsultant.Rows.InsertAt(dr, 0);//将声明并赋值的行添加到置业顾问表
PublicMethod.SettingComboBox(cboHomeBuyersConsultant, dtHomeBuyersConsultant, "StaffID", "置业顾问", true);//调用静态类里边的自定义公用方法
dtClientDetail = myfrmMarketManagement_CustomerManagementClient.CustomerManagement_btnSelect_Click_SelectClientDetail().Tables[0];//查询客户明细
dgvClientDetail.DataSource = dtClientDetail;//绑定dgvClientDetail的数据源是表dtClientDetail
dgvProject.DataSource = dtProject;//同理绑定数据源
dgvClientDetail.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;//设置dgv列标题单元格默认对齐样式
dgvClientDetail.RowsDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;//设置dgv行单元格默认对齐样式
dgvClientDetail.ReadOnly = false;//设置属性只读否
string[] strDegree = { "全部", "弱", "中", "强" };//声明并赋初始值一个数组
cboDegree.Items.AddRange(strDegree);//把数组添加到cboDegree的项集合里边
cboDegree.SelectedIndex = 0;//指定选择的项未第一项
string[] strType = { "全部", "未购有效", "未购", "已购" };
cboType.Items.AddRange(strType);
cboType.SelectedIndex = 0;
}
private void btnSelectProject_Click(object sender, EventArgs e)//项目选择按钮的单击事件
{
dgvProject.Visible = true;
}
int intProjectID = 0;//声明全局变量
private void dgvProject_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)//双击dgvProject的事件来选择项目
{
txtProjectName.Text = dgvProject.CurrentRow.Cells["项目名称"].Value.ToString();
intProjectID = (int)dgvProject.CurrentRow.Cells["ProjectID"].Value;
strProjectID = dgvProject.CurrentRow.Cells["ProjectID"].Value.ToString();
BindingdgvClientDetail(strClientRegistrationWayID, strProjectID, strIntention, strHomeBuyerConsultantID, strBeginDate, strEndDate, strsqlClientType);//
dgvProject.Visible = false;
}
private void btnVisitingClientDetails_Click(object sender, EventArgs e)//
{
strClientRegistrationWayID = "32";
BindingdgvClientDetail(strClientRegistrationWayID, strProjectID, strIntention, strHomeBuyerConsultantID, strBeginDate, strEndDate, strsqlClientType);
}
private void btnCallingClientDetails_Click(object sender, EventArgs e)
{
strClientRegistrationWayID = "33";
BindingdgvClientDetail(strClientRegistrationWayID, strProjectID, strIntention, strHomeBuyerConsultantID, strBeginDate, strEndDate, strsqlClientType);
}
private void btnCulesClientDetails_Click(object sender, EventArgs e)
{
strClientRegistrationWayID = "34";
BindingdgvClientDetail(strClientRegistrationWayID, strProjectID, strIntention, strHomeBuyerConsultantID, strBeginDate, strEndDate, strsqlClientType);
}
/// <summary>
/// 构造函数,上边我一直说是自定义方法的都是构造函数,(自定义方法一直是自己平时的习惯叫法,构造函数比较标准)
/// </summary>
/// <param name="strClientRegistrationWayID">客户登记方式ID</param>
/// <param name="strProjectID">项目ID</param>
/// <param name="strIntention">意向</param>
/// <param name="strHomeBuyerConsultantID">置业顾问ID</param>
/// <param name="strBeginDate">开始时间</param>
/// <param name="strEndDate">结束时间</param>
/// <param name="strsqlClientType">客户类型</param>
void BindingdgvClientDetail(string strClientRegistrationWayID, string strProjectID, string strIntention, string strHomeBuyerConsultantID, string strBeginDate, string strEndDate, string strsqlClientType)
{
DataTable dtClientDetail = myfrmMarketManagement_CustomerManagementClient.CustomerManagement_btnSelect_Click_MultiSelect(strClientRegistrationWayID, strProjectID, strIntention, strHomeBuyerConsultantID, strBeginDate, strEndDate, strsqlClientType).Tables[0];//多条件查询
dgvClientDetail.DataSource = dtClientDetail;
}
private void dgvProject_MouseLeave(object sender, EventArgs e)//鼠标离开dgvProject时发生
{
dgvProject.Visible = false;//设置dgvProject的可见性
}
string strClientRegistrationWayID = "";
string strProjectID = "";
string strIntention = "";
string strHomeBuyerConsultantID = "";
string strBeginDate = "";
string strEndDate = "";
string strsqlClientType = "";
private void txtProjectName_TextChanged(object sender, EventArgs e)//txtProjectName文本改变事件
{
if (txtProjectName.Text.ToString() == "")//什么也没有输入的时候
{
strProjectID = "";
}
}
private void cboType_SelectionChangeCommitted(object sender, EventArgs e)
{
int sqlClientTypeIndex = cboType.SelectedIndex;//获取客户类型
switch (sqlClientTypeIndex)
{
case 0:
strsqlClientType = "";
break;
case 1:
strsqlClientType = "未购有效";
break;
case 2:
strsqlClientType = "未购";
break;
case 3:
strsqlClientType = "已购";
break;
}
BindingdgvClientDetail(strClientRegistrationWayID, strProjectID, strIntention, strHomeBuyerConsultantID, strBeginDate, strEndDate, strsqlClientType);
}
private void cboDegree_SelectionChangeCommitted(object sender, EventArgs e)//根据cboDegree选定的值来赋值给strIntention
{
int intIntentionIndex = cboDegree.SelectedIndex;
switch (intIntentionIndex)
{
case 0:
strIntention = "";
break;
case 1:
strIntention = "弱";
break;
case 2:
strIntention = "中";
break;
case 3:
strIntention = "强";
break;
}
BindingdgvClientDetail(strClientRegistrationWayID, strProjectID, strIntention, strHomeBuyerConsultantID, strBeginDate, strEndDate, strsqlClientType);
}
private void cboHomeBuyersConsultant_SelectionChangeCommitted(object sender, EventArgs e)
{
strHomeBuyerConsultantID = cboHomeBuyersConsultant.SelectedValue.ToString();
if ((int)cboHomeBuyersConsultant.SelectedValue == 0)
{
strHomeBuyerConsultantID = "";
}
BindingdgvClientDetail(strClientRegistrationWayID, strProjectID, strIntention, strHomeBuyerConsultantID, strBeginDate, strEndDate, strsqlClientType);
}
private void ckbDate_Click(object sender, EventArgs e)//ckbDate的单击事件
{
if (ckbDate.Checked)//当ckbDate选定的时候
{
dtpStartingDate.Enabled = true;//设置dtpStartingDate的可用性未真
dtpEndingDate.Enabled = true;
btnSelect.Enabled = true;
}
else
{
dtpStartingDate.Enabled = false;//设置dtpStartingDate的可用性未假
dtpEndingDate.Enabled = false;
btnSelect.Enabled = false;
strBeginDate = "";
strEndDate = "";
}
}
private void btnSelect_Click(object sender, EventArgs e)//单击查询按钮事件
{
strBeginDate = dtpStartingDate.Value.ToString();
strEndDate = dtpEndingDate.Value.ToString();
BindingdgvClientDetail(strClientRegistrationWayID, strProjectID, strIntention, strHomeBuyerConsultantID, strBeginDate, strEndDate, strsqlClientType);//执行不定条件查询构造函数
}
private void tsbtnInsert_Click(object sender, EventArgs e)
{
frmMarketManagement_ClientRegistrtion_PubRegistration myfrmMarketManagement_ClientRegistrtion_PubRegistration = new frmMarketManagement_ClientRegistrtion_PubRegistration(this);//实例化公共新增窗体
myfrmMarketManagement_ClientRegistrtion_PubRegistration.ShowDialog();
}
int intClientId = 0;
private void tsbtnUpdate_Click(object sender, EventArgs e)//点击修改
{
if (intClientId == 0)//判断是否选中一行
{
MessageBox.Show("亲,请点击一行数据后继续!!!","提示");
return;
}
frmMarketManagement_ClientRegistrtion_NewClientRegistration myfrmMarketManagement_ClientRegistrtion_NewClientRegistration = new frmMarketManagement_ClientRegistrtion_NewClientRegistration(this, intClientId);
myfrmMarketManagement_ClientRegistrtion_NewClientRegistration.ShowDialog();
}
private void tsbtnDelete_Click(object sender, EventArgs e)//点击删除事件
{
dgvClientDetail.EndEdit();//dgvClientDetail结束编辑
int intSelectCount = 0;
int intSuccessCount = 0;
foreach (DataGridViewRow dgvr in dgvClientDetail.Rows)//循环遍历
{
if (Convert.ToBoolean(dgvr.Cells["选择"].FormattedValue))
{
intSelectCount++;
int intCustomerID = (int)dgvr.Cells["ClientID"].Value;
DataTable dtConditionClient = myfrmMarketManagement_CustomerManagementClient.tsbtnDelete_Click_SelectClient(intCustomerID).Tables[0];//根据客户ID来查询没有交易的客户
if (dtConditionClient.Rows.Count > 0)
{
myfrmMarketManagement_CustomerManagementClient.tsbtnDelete_Click_DeleteClientMsg(intCustomerID);//当满足条件就删除
intSuccessCount++;
}
}
}
MessageBox.Show("一共选择" + intSelectCount + "条数据!!!\n成功删除" + intSuccessCount + "条数据!!!\n有" + (intSelectCount - intSuccessCount) + "条数据由于产生交易而无法删除!!!", "提示");
BindingdgvClientDetail(strClientRegistrationWayID, strProjectID, strIntention, strHomeBuyerConsultantID, strBeginDate, strEndDate, strsqlClientType);
}
private void dgvClientDetail_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)//dgvClientDetail鼠标单击事件选择客户
{
intClientId = (int)dgvClientDetail.CurrentRow.Cells["ClientID"].Value;
}
private void btnExchangeHomeBuyerConsultant_Click(object sender, EventArgs e)//更改置业顾问单击事件
{
int intHomeBuyer = (int)dgvClientDetail.CurrentRow.Cells["HomeBuyerConsultantID"].Value;
int intClien = (int)dgvClientDetail.CurrentRow.Cells["ClientID"].Value;
frmMarketManagement_CustomerManagement_Exchange myfrmMarketManagement_CustomerManagement_Exchange = new frmMarketManagement_CustomerManagement_Exchange(intClien, intHomeBuyer,this);//实例化置业顾问变更窗体
myfrmMarketManagement_CustomerManagement_Exchange.ShowDialog();
}
private void dgvClientDetail_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)//设置dgvClientDetail单元格样式时发生
{
DataGridView dgv = sender as DataGridView;
DataGridViewRow CurrentRow = dgv.Rows[e.RowIndex];
CurrentRow.HeaderCell.Value = Convert.ToString(e.RowIndex + 1);
}
public void tsbtnRefresh_Click(object sender, EventArgs e)//刷新界面
{
BindingdgvClientDetail(strClientRegistrationWayID, strProjectID, strIntention, strHomeBuyerConsultantID, strBeginDate, strEndDate, strsqlClientType);
}
2.添加客户
在这里的存储过程和逻辑层都是直接调用新客登记那边的,这里边的新增客户和客户登记的代码也是大同小异。只需理解客户登记即可
从界面上可以看到我们这里用到的控件有
控件名称 | 说明 |
标注(Label) | 控件可以在工具箱直接拖动至窗体,拖至窗体后右击属性可以修改控件的样式和各种属性,还可以编辑事件。 |
选项卡(TabControl) | |
复选框(CheckBox) | |
单选按钮(RadioButton) | |
文本(TextBox) | |
按钮(Button) | |
日期控件(DateTimePicker) | |
下拉框(ComboBox) |
功能实现:
第一步:数据库
1、表与关系
表1: 项目信息表(dbo.SYS_ProjectInformation)
Primary Key(主键): ProjectID
非主键ID值均是外键
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
ProjectID | int - Identity |
| No | 项目ID
|
SortNumber | int |
| Yes | 排序号
|
ProjectAreaID | int |
| Yes | 属性明细表,项目区域ID
|
Project_FatherlID | int |
| Yes | 项目信息表,项目级别ID
|
ProjectName | nchar (20) |
| Yes | 项目名称
|
PropertyRightProjectName | nchar (20) |
| Yes | 产权项目名称
|
ProjectCompanyName | nchar (20) |
| Yes | 项目公司名称
|
ProjectAddress | nchar (50) |
| Yes | 项目座落地址
|
CaseWhether | bit |
| Yes | 是否结案
|
CancelWhether | bit | ((0)) | Yes | 有效否
|
表2: 客户信息 (dbo.PW_ClientInformation)
Primary Key(主键): ClientID
非主键ID值均是外键
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
ClientID | int - Identity |
| No | 客户ID
|
ProjectID | int |
| Yes | 项目信息表,项目ID
|
ClientNumber | nchar (10) |
| Yes | 客户编号
|
ClientName | nchar (10) |
| Yes | 客户名称
|
EarlyVisitIntention | nchar (10) |
| Yes | 初访意向
|
Gender | nchar (10) |
| Yes | 性别
|
MaritalStatus | nchar (10) |
| Yes | 婚否
|
ClientRegistrationWayID | int |
| Yes | 属性明细表,客户登记方式ID
|
RelationPhone | nchar (15) |
| Yes | 联系电话
|
ElectronMail | nchar (30) |
| Yes | 电子邮箱
|
HomeBuyerConsultantID | int |
| Yes | 员工表,置业顾问ID
|
DateOfVisit | datetime |
| Yes | 来访日期
|
CommunicationAddress | nchar (50) |
| Yes | 通讯地址
|
Postcode | nchar (10) |
| Yes | 邮编
|
IDentityCard | nchar (30) |
| Yes | 身份证号
|
BirthDay | date |
| Yes | 出生日期
|
Age | nchar (20) |
| Yes | 年龄
|
Professional | nchar (20) |
| Yes | 职业
|
NowLivingArea | nchar (20) |
| Yes | 现居住区域
|
LearnTheWayToTheCase | nchar (20) |
| Yes | 获取本案途径
|
VisitConstitute | nchar (20) |
| Yes | 来客构成
|
Traffic | nchar (20) |
| Yes | 交通
|
RealEstateSituation | nchar (20) |
| Yes | 置业状况
|
ResidentialMortgageLoans | nchar (20) |
| Yes | 住宅按揭贷款
|
HomesBuyersPurpose | nchar (20) |
| Yes | 置业目的
|
PlanTorealEstatePrice | nchar (20) |
| Yes | 计划置业价格
|
DemandArea | nchar (20) |
| Yes | 需求面积
|
PaymentWay | nchar (20) |
| Yes | 付款方式ID
|
BuyingConsideration | nchar (20) |
| Yes | 买房考虑因素
|
IncalidOr | bit | ((0)) | Yes | 作废否
|
表3: 员工表 (dbo. SYS_Staff)
Primary Key(主键): StaffID
非主键ID值均是外键
列名 | 数据类型 | Nulls? | 说明 |
StaffID | int - Identity | No | 员工ID
|
StaffNumber | nchar (10) | Yes | 员工编号
|
StaffName | nchar (10) | Yes | 员工姓名
|
DepartMentID | int | Yes | 所属部门
|
GenderID | int | Yes | 属性明细表,性别ID
|
Age | int | Yes | 年龄
|
EducationBackgroundID | int | Yes | 属性明细表,学历ID
|
MarryWhether | bit | Yes | 婚否
|
Position | nchar (10) | Yes | 职位
|
ContactPhoneNumber | nchar (15) | Yes | 联系电话
|
ContactAddress | nchar (20) | Yes | 联系地址
|
Notes | nchar (100) | Yes | 备注
|
StaffImage | image | Yes | 员工照片
|
表4: 属性明细表(dbo.SYS_AttributeDetails)
Primary Key(主键): AttributeDetailsID
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
AttributeDetailsID | int - Identity |
| No | 属性明细ID
|
AuttributeSetID | int |
| Yes | 属性集合表,属性集合ID
|
AuttributeDetailsName | nchar (10) |
| Yes | 属性明细名称
|
EffectiveWhether | bit | ((1)) | Yes | 有效否
|
2、具体代码实现
第一步:数据库存储过程
if(@type='frmXiaoShouGuanLi_XinKeDengJi_Load_BindingHomebuyersconsultant')--查询置业顾问
begin
SELECT SYS_Staff.StaffID, RTRIM(SYS_Staff.StaffName) as StaffName, RTRIM(SYS_AttributeDetails.AuttributeDetailsName) as AuttributeDetailsName
FROM SYS_Staff INNER JOIN
SYS_AttributeDetails ON SYS_Staff.DepartMentID = SYS_AttributeDetails.AttributeDetailsID
WHERE SYS_AttributeDetails.AttributeDetailsID=23 --只查是置业顾问的员工
end
if(@type='NewClientRegistration_btnSaveAndInsert_Click')--新增客户
begin
insert into PW_ClientInformation(ClientNumber, ClientName, EarlyVisitIntention, Gender, MaritalStatus,
ClientRegistrationWayID, RelationPhone, ElectronMail, HomeBuyerConsultantID, DateOfVisit, CommunicationAddress,
Postcode, IDentityCard, BirthDay,ProjectID,Age, Professional, NowLivingArea, LearnTheWayToTheCase,
VisitConstitute, Traffic, RealEstateSituation, ResidentialMortgageLoans, HomesBuyersPurpose,
PlanTorealEstatePrice, DemandArea,PaymentWay, BuyingConsideration)
values (@ClientNumber,@ClientName,@EarlyVisitIntention,@Gender,@MaritalStatus,@ClientRegistrationWayID,
@RelationPhone,@ElectronMail,@HomeBuyerConsultantID,@DateOfVisit,@CommunicationAddress,
@Postcode,@IDentityCard,@BirthDay,@ProjectID,@Age,@Professional,@NowLivingArea,@LearnTheWayToTheCase,
@VisitConstitute,@Traffic,@RealEstateSituation,@ResidentialMortgageLoans,@HomesBuyersPurpose,
@PlanTorealEstatePrice,@DemandArea,@PaymentWay,@BuyingConsideration)
end
if @type='NewClientRegistration_Load_SelectSortNumber'--查询客户表里边的总行数,用来绑定序号
begin
SELECT COUNT(*)
FROM PW_ClientInformation
end
第二步:逻辑层(BLL)相关代码
[OperationContract]
#region 绑定下拉框置业顾问
public DataSet frmXiaoShouGuanLi_XinKeDengJi_Load_BindingHomebuyersconsultant()
{
SqlParameter[] SQLCMDpas = { new SqlParameter("@type", SqlDbType.Char),
};
SQLCMDpas[0].Value = "frmXiaoShouGuanLi_XinKeDengJi_Load_BindingHomebuyersconsultant";
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_ClientRegistrtion_NewClientRegistration", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 查询总行数,用来绑定序号
public DataSet NewClientRegistration_Load_SelectSortNumber()
{
SqlParameter[] SQLCMDpas = { new SqlParameter("@type", SqlDbType.Char),
};
SQLCMDpas[0].Value = "NewClientRegistration_Load_SelectSortNumber";
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_ClientRegistrtion_NewClientRegistration", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 新增客户
public int NewClientRegistration_btnSaveAndInsert_Click(string strClientNumber, string strClientName, string strEarlyVisitIntention, string strGender, string strMaritalStatus,
int intClientRegistrationWayID,string strRelationPhone,string strElectronMail,int intHomeBuyerConsultantID,DateTime dtDateOfVisit,string strCommunicationAddress,
string strPostcode, string strIDentityCard, DateTime dtBirthDay, int intProjectID,
string strAge,string strProfessional, string strNowLivingArea, string strLearnTheWayToTheCase,
string strVisitConstitute, string strTraffic,string strRealEstateSituation,string strResidentialMortgageLoans, string strHomesBuyersPurpose,
string strPlanTorealEstatePrice, string strDemandArea, string strPaymentWay, string strBuyingConsideration)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@ClientNumber", SqlDbType.Char),
new SqlParameter("@ClientName", SqlDbType.Char),
new SqlParameter("@EarlyVisitIntention", SqlDbType.Char),
new SqlParameter("@Gender", SqlDbType.Char),
new SqlParameter("@MaritalStatus", SqlDbType.Char),
new SqlParameter("@ClientRegistrationWayID", SqlDbType.Int),
new SqlParameter("@RelationPhone", SqlDbType.Char),
new SqlParameter("@ElectronMail", SqlDbType.Char),
new SqlParameter("@HomeBuyerConsultantID", SqlDbType.Int),
new SqlParameter("@DateOfVisit", SqlDbType.DateTime),
new SqlParameter("@CommunicationAddress", SqlDbType.Char),
new SqlParameter("@Postcode", SqlDbType.Char),
new SqlParameter("@IDentityCard", SqlDbType.Char),
new SqlParameter("@BirthDay", SqlDbType.DateTime),
new SqlParameter("@ProjectID", SqlDbType.Int),
new SqlParameter("@Age", SqlDbType.Char),
new SqlParameter("@Professional", SqlDbType.Char),
new SqlParameter("@NowLivingArea", SqlDbType.Char),
new SqlParameter("@LearnTheWayToTheCase", SqlDbType.Char),
new SqlParameter("@VisitConstitute", SqlDbType.Char),
new SqlParameter("@Traffic", SqlDbType.Char),
new SqlParameter("@RealEstateSituation", SqlDbType.Char),
new SqlParameter("@ResidentialMortgageLoans", SqlDbType.Char),
new SqlParameter("@HomesBuyersPurpose", SqlDbType.Char),
new SqlParameter("@PlanTorealEstatePrice", SqlDbType.Char),
new SqlParameter("@DemandArea", SqlDbType.Char),
new SqlParameter("@PaymentWay", SqlDbType.Char),
new SqlParameter("@BuyingConsideration", SqlDbType.Char),
};
SQLCMDpas[0].Value = "NewClientRegistration_btnSaveAndInsert_Click";
SQLCMDpas[1].Value = strClientNumber;
SQLCMDpas[2].Value = strClientName;
SQLCMDpas[3].Value = strEarlyVisitIntention;
SQLCMDpas[4].Value = strGender;
SQLCMDpas[5].Value = strMaritalStatus;
SQLCMDpas[6].Value = intClientRegistrationWayID;
SQLCMDpas[7].Value = strRelationPhone;
SQLCMDpas[8].Value = strElectronMail;
SQLCMDpas[9].Value = intHomeBuyerConsultantID;
SQLCMDpas[10].Value = dtDateOfVisit;
SQLCMDpas[11].Value = strCommunicationAddress;
SQLCMDpas[12].Value = strPostcode;
SQLCMDpas[13].Value = strIDentityCard;
SQLCMDpas[14].Value = dtBirthDay;
SQLCMDpas[15].Value = intProjectID;
SQLCMDpas[16].Value = strAge;
SQLCMDpas[17].Value = strProfessional;
SQLCMDpas[18].Value = strNowLivingArea;
SQLCMDpas[19].Value = strLearnTheWayToTheCase;
SQLCMDpas[20].Value = strVisitConstitute;
SQLCMDpas[21].Value = strTraffic;
SQLCMDpas[22].Value = strRealEstateSituation;
SQLCMDpas[23].Value = strResidentialMortgageLoans;
SQLCMDpas[24].Value = strHomesBuyersPurpose;
SQLCMDpas[25].Value = strPlanTorealEstatePrice;
SQLCMDpas[26].Value = strDemandArea;
SQLCMDpas[27].Value = strPaymentWay;
SQLCMDpas[28].Value = strBuyingConsideration;
return myDALPublic.DAL_OPTableDB_Par("frmMarketManagement_ClientRegistrtion_NewClientRegistration", SQLCMDpas);
}
#endregion
第三步:界面层(UIL)
frmMarketManagement_SubscribeToSign_InsertSubcribe Frm;
int intProjectID = 0;
public frmMarketManagement_ClientRegistrtion_PubRegistration(frmMarketManagement_SubscribeToSign_InsertSubcribe frm,int intProject)//窗体传值
{
Frm = frm;
intProjectID = intProject;
InitializeComponent();
}
frmMarketManagement_ReserveManagement_InsertReserve FrmInsertReserve;
public frmMarketManagement_ClientRegistrtion_PubRegistration(frmMarketManagement_ReserveManagement_InsertReserve frm, int intProject)
{
FrmInsertReserve = frm;
intProjectID = intProject;
InitializeComponent();
}
frmMarketManagement_ConfessToRaiseManagement_ConfessToRaiseEdit FrmConfessToRaiseEdit;
public frmMarketManagement_ClientRegistrtion_PubRegistration(frmMarketManagement_ConfessToRaiseManagement_ConfessToRaiseEdit frm)
{
FrmConfessToRaiseEdit = frm;
InitializeComponent();
}
frmMarketManagement_CustomerManagement FrmCustomerManagement;
bool bolCustomerManagement = false;
public frmMarketManagement_ClientRegistrtion_PubRegistration(frmMarketManagement_CustomerManagement frm)
{
FrmCustomerManagement = frm;
bolCustomerManagement = true;
InitializeComponent();
}
BLL新锐房地产销售系统.MarketManagement.frmMarketManagement_ClientRegistrtion_NewClientRegistration.frmMarketManagement_ClientRegistrtion_NewClientRegistrationClient myfrmMarketManagement_ClientRegistrtion_NewClientRegistrationClient =
new BLL新锐房地产销售系统.MarketManagement.frmMarketManagement_ClientRegistrtion_NewClientRegistration.frmMarketManagement_ClientRegistrtion_NewClientRegistrationClient();//实例化BLL
int intClientRegistrationWayID = 32;
private void frmMarketManagement_ClientRegistrtion_PubRegistration_Load(object sender, EventArgs e)//窗体加载事件
{
DataTable dtProject = myfrmMarketManagement_ClientRegistrtion_NewClientRegistrationClient.frmXiaoShouGuanLi_BindingProjectName().Tables[0];
PublicMethod.SettingComboBox(cboProject, dtProject, "ProjectID", "项目名称");//绑定dgv
cboProject.SelectedValue = intProjectID;
radClues.Checked =true;
if (PublicStaticClass.blOpening == 1)
{
this.Text = "来电客户添加";
PublicStaticClass.blOpening = 0;
radCalling.Checked = true;
intClientRegistrationWayID = 33;
}
else if (PublicStaticClass.blOpening == 2)
{
this.Text = "线索客户添加";
PublicStaticClass.blOpening = 0;
radClues.Checked = true;
intClientRegistrationWayID = 34;
}
string[] strEarlyVisitIntention = { "弱", "中", "强" };
string[] strGender = { "男", "女" };
string[] strMaritalstatus = { "未婚", "已婚" };
if (PublicStaticClass.blOpening == 4)
{
radVisiting.Checked = true;
intClientRegistrationWayID = 32;
}
cboEarlyVisitIntention.Items.AddRange(strEarlyVisitIntention);
cboGender.Items.AddRange(strGender);
cboMaritalstatus.Items.AddRange(strMaritalstatus);
cboEarlyVisitIntention.SelectedIndex = 0;
cboGender.SelectedIndex = 0;
cboMaritalstatus.SelectedIndex = 0;
DataTable dtHomebuyersconsultant = myfrmMarketManagement_ClientRegistrtion_NewClientRegistrationClient.frmXiaoShouGuanLi_XinKeDengJi_Load_BindingHomebuyersconsultant().Tables[0];
PublicMethod.SettingComboBox(cboHomebuyersconsultant, dtHomebuyersconsultant, "StaffID", "StaffName", true);
int intSortNumber = Convert.ToInt32(myfrmMarketManagement_ClientRegistrtion_NewClientRegistrationClient.NewClientRegistration_Load_SelectSortNumber().Tables[0].Rows[0][0]);
txtSerialNumber.Text = Convert.ToString(intSortNumber + 1);
if (intProjectID == 0)
{
cboProject.Enabled = true;
cboProject.SelectedIndex = 0;
}
}
private void btnSaveAndInsert_Click(object sender, EventArgs e)//新增客户
{
Judage();//判断CheckBox是否选定
string strClientNumber = txtSerialNumber.Text.ToString().Trim();
string strClientName = txtClientName.Text.ToString().Trim();
if (txtClientName.Text == "")
{
MessageBox.Show("请填写客户姓名后继续!", "提示");
}
string strEarlyVisitIntention = cboEarlyVisitIntention.Text.ToString().Trim();
string strGender = cboGender.Text.ToString().Trim();
string strMaritalStatus = cboMaritalstatus.Text.ToString().Trim();
string strRelationPhone = txtContactPhoneNumber.Text.ToString().Trim();
if (txtContactPhoneNumber.Text == "")
{
MessageBox.Show("请填写联系电话后继续!", "提示");
}
string strElectronMail = txtEmail.Text.ToString().Trim();
if (txtEmail.Text == "")
{
MessageBox.Show("请填写E-Mail后继续!", "提示");
}
int intHomeBuyerConsultantID = (int)cboHomebuyersconsultant.SelectedValue;
DateTime dtDateOfVisit = Convert.ToDateTime(dtpVisitingDate.Text);
string strCommunicationAddress = txtCorrspondenceAddress.Text.ToString().Trim();
if (txtCorrspondenceAddress.Text == "")
{
MessageBox.Show("请填写通讯地址后继续!", "提示");
}
string strPostcode = txtZipCode.Text.ToString().Trim();
if (txtCorrspondenceAddress.Text == "")
{
MessageBox.Show("请填写邮编后继续!", "提示");
}
string strIDentityCard = txtIDNumber.Text.ToString().Trim();
if (txtCorrspondenceAddress.Text == "")
{
MessageBox.Show("请填写身份证号后继续!", "提示");
}
DateTime dtBirthDay = Convert.ToDateTime(dtpBirthDate.Text);
int intProject = (int)cboProject.SelectedValue;
int intSaveSuccess = myfrmMarketManagement_ClientRegistrtion_NewClientRegistrationClient.NewClientRegistration_btnSaveAndInsert_Click(strClientNumber, strClientName,
strEarlyVisitIntention, strGender, strMaritalStatus, intClientRegistrationWayID, strRelationPhone, strElectronMail, intHomeBuyerConsultantID, dtDateOfVisit,
strCommunicationAddress, strPostcode, strIDentityCard, dtBirthDay, intProject,
strAge, strProfessional, strNowLivingArea, strLearnTheWayToTheCase,
strVisitConstitute, strTraffic, strRealEstateSituation, strResidentialMortgageLoans, strHomesBuyersPurpose,
strPlanTorealEstatePrice, strDemandArea, strPaymentWay, strBuyingConsideration);//新增客户
if (intSaveSuccess > 0)
{
if (MessageBox.Show("新增成功,是否继续新增?\n点击'是继续新增',点击‘否’退出", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
ClearData();
}
else
{
if (bolCustomerManagement == true)
FrmCustomerManagement.tsbtnRefresh_Click(null,null);
this.Dispose();
}
}
else if (MessageBox.Show("很遗憾,新增失败,请正确录入数据后再新增数据", "是否退出界面", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
{
this.Dispose();
}
else
{
return;
}
}
void ClearData()//清空界面的数据
{
txtClientName.Text = "";
cboEarlyVisitIntention.SelectedIndex = 0;
cboGender.SelectedIndex = 0;
cboMaritalstatus.SelectedIndex = 0;
txtSerialNumber.Text = (Convert.ToInt32(txtSerialNumber.Text) + 1).ToString();
txtContactPhoneNumber.Text = "";
txtEmail.Text = "";
cboHomebuyersconsultant.SelectedIndex = 0;
txtCorrspondenceAddress.Text = "";
txtZipCode.Text = "";
txtIDNumber.Text = "";
dtpVisitingDate.Value = DateTime.Now;
dtpBirthDate.Value = DateTime.Now;
strAge = "";
strProfessional = "";
strNowLivingArea = "";
strLearnTheWayToTheCase = "";
strVisitConstitute = "";
strTraffic = "";
strRealEstateSituation = "";
strResidentialMortgageLoans = "";
strHomesBuyersPurpose = "";
strPlanTorealEstatePrice = "";
strDemandArea = "";
strPaymentWay = "";
strBuyingConsideration = "";
foreach (CheckBox chb in pnlAge.Controls)
{
chb.Checked = false;
}
foreach (CheckBox chb in pnlProfessional.Controls)
{
chb.Checked = false;
}
foreach (CheckBox chb in pnlNowLivingArea.Controls)
{
chb.Checked = false;
}
foreach (CheckBox chb in pnlLearnTheWayToTheCase.Controls)
{
chb.Checked = false;
}
foreach (CheckBox chb in pnlVisitConstitute.Controls)
{
chb.Checked = false;
}
foreach (CheckBox chb in pnlTraffic.Controls)
{
chb.Checked = false;
}
foreach (CheckBox chb in pnlRealEstateSituation.Controls)
{
chb.Checked = false;
}
foreach (CheckBox chb in pnlResidentialMortgageLoans.Controls)
{
chb.Checked = false;
}
foreach (CheckBox chb in pnlHomesBuyersPurpose.Controls)
{
chb.Checked = false;
}
foreach (CheckBox chb in pnlPlanTorealEstatePrice.Controls)
{
chb.Checked = false;
}
foreach (CheckBox chb in pnlDemandArea.Controls)
{
chb.Checked = false;
}
foreach (CheckBox chb in pnlPaymentWay.Controls)
{
chb.Checked = false;
}
foreach (CheckBox chb in pnlBuyingConsideration.Controls)
{
chb.Checked = false;
}
}
private void btnReturn_Click(object sender, EventArgs e)
{
this.Close();
}
void Judage()//判断是否已经全部选定CheckBox
{
if (strAge == "")
{
MessageBox.Show("请在‘年龄’处勾上相应的信息!!!", "提示");
return;
}
if (strProfessional == "")
{
MessageBox.Show("请在‘职业’处勾上相应的信息!!!", "提示");
return;
}
if (strNowLivingArea == "")
{
MessageBox.Show("请在‘现居住区域’处勾上相应的信息!!!", "提示");
return;
}
if (strLearnTheWayToTheCase == "")
{
MessageBox.Show("请在‘获取本案途径’处勾上相应的信息!!!", "提示");
return;
}
if (strVisitConstitute == "")
{
MessageBox.Show("请在‘来客登记’处勾上相应的信息!!!", "提示");
return;
}
if (strTraffic == "")
{
MessageBox.Show("请在‘交通’处勾上相应的信息!!!", "提示");
return;
}
if (strRealEstateSituation == "")
{
MessageBox.Show("请在‘置业状况’处勾上相应的信息!!!", "提示");
return;
}
if (strResidentialMortgageLoans == "")
{
MessageBox.Show("请在‘住宅按揭贷款’处勾上相应的信息!!!", "提示");
return;
}
if (strHomesBuyersPurpose == "")
{
MessageBox.Show("请在‘置业目的’处勾上相应的信息!!!", "提示");
return;
}
if (strPlanTorealEstatePrice == "")
{
MessageBox.Show("请在‘计划置业价格’处勾上相应的信息!!!", "提示");
return;
}
if (strDemandArea == "")
{
MessageBox.Show("请在‘需求面积’处勾上相应的信息!!!", "提示");
return;
}
if (strPaymentWay == "")
{
MessageBox.Show("请在‘付款方式’处勾上相应的信息!!!", "提示");
return;
}
if (strBuyingConsideration == "")
{
MessageBox.Show("请在‘买房考虑因素’处勾上相应的信息!!!", "提示");
return;
}
}
string strAge = "";
string strProfessional = "";
string strNowLivingArea = "";
string strLearnTheWayToTheCase = "";
string strVisitConstitute = "";
string strTraffic = "";
string strRealEstateSituation = "";
string strResidentialMortgageLoans = "";
string strHomesBuyersPurpose = "";
string strPlanTorealEstatePrice = "";
string strDemandArea = "";
string strPaymentWay = "";
string strBuyingConsideration = "";
private void Pubrad_Click(object sender, EventArgs e)//一个公用的RadioButton单击事件
{
if (radVisiting.Checked)//根据选定的登记方式不同来赋登记方式ID
{
intClientRegistrationWayID = 32;
}
if (radCalling.Checked)
{
intClientRegistrationWayID = 33;
}
if (radClues.Checked)
{
intClientRegistrationWayID = 34;
}
}
private void checkBox1_Click(object sender, EventArgs e)//一个公用的CheckBox单击事件,具体可以参考客户登记
{
CheckBox ch1 = sender as CheckBox;
Control cl = ch1.Parent;
string strControlName = ch1.Parent.Name;
foreach (CheckBox ch in cl.Controls)
{
if (ch1.Checked == true)
{
if (ch != ch1)
{
ch.Checked = false;
}
else
{
switch (strControlName)
{
case "pnlAge":
strAge = ch1.Text.ToString();
break;
case "pnlProfessional":
strProfessional = ch1.Text.ToString();
break;
case "pnlNowLivingArea":
strNowLivingArea = ch1.Text.ToString();
break;
case "pnlLearnTheWayToTheCase":
strLearnTheWayToTheCase = ch1.Text.ToString();
break;
case "pnlVisitConstitute":
strVisitConstitute = ch1.Text.ToString();
break;
case "pnlTraffic":
strTraffic = ch1.Text.ToString();
break;
case "pnlRealEstateSituation":
strRealEstateSituation = ch1.Text.ToString();
break;
case "pnlResidentialMortgageLoans":
strResidentialMortgageLoans = ch1.Text.ToString();
break;
case "pnlHomesBuyersPurpose":
strHomesBuyersPurpose = ch1.Text.ToString();
break;
case "pnlPlanTorealEstatePrice":
strPlanTorealEstatePrice = ch1.Text.ToString();
break;
case "pnlDemandArea":
strDemandArea = ch1.Text.ToString();
break;
case "pnlPaymentWay":
strPaymentWay = ch1.Text.ToString();
break;
case "pnlBuyingConsideration":
strBuyingConsideration = ch1.Text.ToString();
break;
}
}
}
}
}
3.客户信息修改
从界面上可以看到我们这里用到的控件有
控件名称 | 说明 |
标注(Label) | 控件可以在工具箱直接拖动至窗体,拖至窗体后右击属性可以修改控件的样式和各种属性,还可以编辑事件。 |
选项卡(TabControl) | |
复选框(CheckBox) | |
单选按钮(RadioButton) | |
文本(TextBox) | |
按钮(Button) | |
日期控件(DateTimePicker) | |
下拉框(ComboBox) |
功能实现:
第一步:数据库
1、表与关系
表1: 项目信息表(dbo.SYS_ProjectInformation)
Primary Key(主键): ProjectID
非主键ID值均是外键
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
ProjectID | int - Identity |
| No | 项目ID
|
SortNumber | int |
| Yes | 排序号
|
ProjectAreaID | int |
| Yes | 属性明细表,项目区域ID
|
Project_FatherlID | int |
| Yes | 项目信息表,项目级别ID
|
ProjectName | nchar (20) |
| Yes | 项目名称
|
PropertyRightProjectName | nchar (20) |
| Yes | 产权项目名称
|
ProjectCompanyName | nchar (20) |
| Yes | 项目公司名称
|
ProjectAddress | nchar (50) |
| Yes | 项目座落地址
|
CaseWhether | bit |
| Yes | 是否结案
|
CancelWhether | bit | ((0)) | Yes | 有效否
|
表2: 客户信息 (dbo.PW_ClientInformation)
Primary Key(主键): ClientID
非主键ID值均是外键
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
ClientID | int - Identity |
| No | 客户ID
|
ProjectID | int |
| Yes | 项目信息表,项目ID
|
ClientNumber | nchar (10) |
| Yes | 客户编号
|
ClientName | nchar (10) |
| Yes | 客户名称
|
EarlyVisitIntention | nchar (10) |
| Yes | 初访意向
|
Gender | nchar (10) |
| Yes | 性别
|
MaritalStatus | nchar (10) |
| Yes | 婚否
|
ClientRegistrationWayID | int |
| Yes | 属性明细表,客户登记方式ID
|
RelationPhone | nchar (15) |
| Yes | 联系电话
|
ElectronMail | nchar (30) |
| Yes | 电子邮箱
|
HomeBuyerConsultantID | int |
| Yes | 员工表,置业顾问ID
|
DateOfVisit | datetime |
| Yes | 来访日期
|
CommunicationAddress | nchar (50) |
| Yes | 通讯地址
|
Postcode | nchar (10) |
| Yes | 邮编
|
IDentityCard | nchar (30) |
| Yes | 身份证号
|
BirthDay | date |
| Yes | 出生日期
|
Age | nchar (20) |
| Yes | 年龄
|
Professional | nchar (20) |
| Yes | 职业
|
NowLivingArea | nchar (20) |
| Yes | 现居住区域
|
LearnTheWayToTheCase | nchar (20) |
| Yes | 获取本案途径
|
VisitConstitute | nchar (20) |
| Yes | 来客构成
|
Traffic | nchar (20) |
| Yes | 交通
|
RealEstateSituation | nchar (20) |
| Yes | 置业状况
|
ResidentialMortgageLoans | nchar (20) |
| Yes | 住宅按揭贷款
|
HomesBuyersPurpose | nchar (20) |
| Yes | 置业目的
|
PlanTorealEstatePrice | nchar (20) |
| Yes | 计划置业价格
|
DemandArea | nchar (20) |
| Yes | 需求面积
|
PaymentWay | nchar (20) |
| Yes | 付款方式ID
|
BuyingConsideration | nchar (20) |
| Yes | 买房考虑因素
|
IncalidOr | bit | ((0)) | Yes | 作废否
|
表3: 员工表 (dbo. SYS_Staff)
Primary Key(主键): StaffID
非主键ID值均是外键
列名 | 数据类型 | Nulls? | 说明 |
StaffID | int - Identity | No | 员工ID
|
StaffNumber | nchar (10) | Yes | 员工编号
|
StaffName | nchar (10) | Yes | 员工姓名
|
DepartMentID | int | Yes | 所属部门
|
GenderID | int | Yes | 属性明细表,性别ID
|
Age | int | Yes | 年龄
|
EducationBackgroundID | int | Yes | 属性明细表,学历ID
|
MarryWhether | bit | Yes | 婚否
|
Position | nchar (10) | Yes | 职位
|
ContactPhoneNumber | nchar (15) | Yes | 联系电话
|
ContactAddress | nchar (20) | Yes | 联系地址
|
Notes | nchar (100) | Yes | 备注
|
StaffImage | image | Yes | 员工照片
|
表4: 属性明细表(dbo.SYS_AttributeDetails)
Primary Key(主键): AttributeDetailsID
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
AttributeDetailsID | int - Identity |
| No | 属性明细ID
|
AuttributeSetID | int |
| Yes | 属性集合表,属性集合ID
|
AuttributeDetailsName | nchar (10) |
| Yes | 属性明细名称
|
EffectiveWhether | bit | ((1)) | Yes | 有效否
|
2、具体代码实现
第一步:数据库存储过程
if @type='UpdateClient_Load_SelectClientMsg'--查询将要被修改的客户的信息
begin
SELECT ClientID, ProjectID, rtrim(ClientNumber) as ClientNumber, rtrim(ClientName) as ClientName, rtrim(EarlyVisitIntention) as EarlyVisitIntention,
rtrim(Gender) as Gender, rtrim(MaritalStatus) as MaritalStatus, ClientRegistrationWayID, rtrim(RelationPhone) as RelationPhone,
rtrim(ElectronMail) as ElectronMail, HomeBuyerConsultantID, DateOfVisit,
rtrim(CommunicationAddress) as CommunicationAddress, rtrim(Postcode) as Postcode, rtrim(IDentityCard) as IDentityCard,
BirthDay, rtrim(Age) as Age, rtrim(Professional) as Professional, rtrim(NowLivingArea) as NowLivingArea,
rtrim(LearnTheWayToTheCase) as LearnTheWayToTheCase, rtrim(VisitConstitute) as VisitConstitute,rtrim(Traffic) as Traffic,
rtrim(RealEstateSituation) as RealEstateSituation, rtrim(ResidentialMortgageLoans) as ResidentialMortgageLoans,
rtrim(HomesBuyersPurpose) as HomesBuyersPurpose, rtrim(PlanTorealEstatePrice) as PlanTorealEstatePrice, rtrim(DemandArea) as DemandArea,
rtrim(PaymentWay) as PaymentWay, rtrim(BuyingConsideration) as BuyingConsideration
FROM PW_ClientInformation
where PW_ClientInformation.ClientID=@ClientID
end
if(@type='NewClientRegistration_btnSaveAndUpdate_Click')--修改某一客户的相关信息
begin
UPDATE PW_ClientInformation
SET ProjectID =@ProjectID, ClientNumber =@ClientNumber, ClientName =@ClientName, EarlyVisitIntention =@EarlyVisitIntention, Gender =@Gender,
MaritalStatus =@MaritalStatus, ClientRegistrationWayID =@ClientRegistrationWayID, RelationPhone =@RelationPhone, ElectronMail =@ElectronMail,
HomeBuyerConsultantID =@HomeBuyerConsultantID, DateOfVisit =@DateOfVisit,
CommunicationAddress =@CommunicationAddress, Postcode =@Postcode, IDentityCard =@IDentityCard, BirthDay =@BirthDay, Age =@Age,
Professional =@Professional, NowLivingArea =@NowLivingArea, LearnTheWayToTheCase =@LearnTheWayToTheCase, VisitConstitute =@VisitConstitute,
Traffic =@Traffic, RealEstateSituation =@RealEstateSituation,
ResidentialMortgageLoans =@ResidentialMortgageLoans, HomesBuyersPurpose =@HomesBuyersPurpose, PlanTorealEstatePrice =@PlanTorealEstatePrice,
DemandArea =@DemandArea, PaymentWay =@PaymentWay, BuyingConsideration =@BuyingConsideration
where PW_ClientInformation.ClientID=@ClientID
第二步:逻辑层(BLL)具体代码
[OperationContract]
#region 在修改前绑定客户信息
public DataSet UpdateClient_Load_SelectClientMsg(int intClientID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@type", SqlDbType.Char),
new SqlParameter("@ClientID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "UpdateClient_Load_SelectClientMsg";
SQLCMDpas[1].Value = intClientID;
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_ClientRegistrtion_NewClientRegistration", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 修改客户信息
public int NewClientRegistration_btnSaveAndUpdate_Click(string strClientNumber, string strClientName, string strEarlyVisitIntention, string strGender, string strMaritalStatus,
int intClientRegistrationWayID, string strRelationPhone, string strElectronMail, int intHomeBuyerConsultantID, DateTime dtDateOfVisit, string strCommunicationAddress,
string strPostcode, string strIDentityCard, DateTime dtBirthDay, int intProjectID,
string strAge, string strProfessional, string strNowLivingArea, string strLearnTheWayToTheCase,
string strVisitConstitute, string strTraffic, string strRealEstateSituation, string strResidentialMortgageLoans, string strHomesBuyersPurpose,
string strPlanTorealEstatePrice, string strDemandArea, string strPaymentWay, string strBuyingConsideration,int intClientID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@ClientNumber", SqlDbType.Char),
new SqlParameter("@ClientName", SqlDbType.Char),
new SqlParameter("@EarlyVisitIntention", SqlDbType.Char),
new SqlParameter("@Gender", SqlDbType.Char),
new SqlParameter("@MaritalStatus", SqlDbType.Char),
new SqlParameter("@ClientRegistrationWayID", SqlDbType.Int),
new SqlParameter("@RelationPhone", SqlDbType.Char),
new SqlParameter("@ElectronMail", SqlDbType.Char),
new SqlParameter("@HomeBuyerConsultantID", SqlDbType.Int),
new SqlParameter("@DateOfVisit", SqlDbType.DateTime),
new SqlParameter("@CommunicationAddress", SqlDbType.Char),
new SqlParameter("@Postcode", SqlDbType.Char),
new SqlParameter("@IDentityCard", SqlDbType.Char),
new SqlParameter("@BirthDay", SqlDbType.DateTime),
new SqlParameter("@ProjectID", SqlDbType.Int),
new SqlParameter("@Age", SqlDbType.Char),
new SqlParameter("@Professional", SqlDbType.Char),
new SqlParameter("@NowLivingArea", SqlDbType.Char),
new SqlParameter("@LearnTheWayToTheCase", SqlDbType.Char),
new SqlParameter("@VisitConstitute", SqlDbType.Char),
new SqlParameter("@Traffic", SqlDbType.Char),
new SqlParameter("@RealEstateSituation", SqlDbType.Char),
new SqlParameter("@ResidentialMortgageLoans", SqlDbType.Char),
new SqlParameter("@HomesBuyersPurpose", SqlDbType.Char),
new SqlParameter("@PlanTorealEstatePrice", SqlDbType.Char),
new SqlParameter("@DemandArea", SqlDbType.Char),
new SqlParameter("@PaymentWay", SqlDbType.Char),
new SqlParameter("@BuyingConsideration", SqlDbType.Char),
new SqlParameter("@ClientID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "NewClientRegistration_btnSaveAndUpdate_Click";
SQLCMDpas[1].Value = strClientNumber;
SQLCMDpas[2].Value = strClientName;
SQLCMDpas[3].Value = strEarlyVisitIntention;
SQLCMDpas[4].Value = strGender;
SQLCMDpas[5].Value = strMaritalStatus;
SQLCMDpas[6].Value = intClientRegistrationWayID;
SQLCMDpas[7].Value = strRelationPhone;
SQLCMDpas[8].Value = strElectronMail;
SQLCMDpas[9].Value = intHomeBuyerConsultantID;
SQLCMDpas[10].Value = dtDateOfVisit;
SQLCMDpas[11].Value = strCommunicationAddress;
SQLCMDpas[12].Value = strPostcode;
SQLCMDpas[13].Value = strIDentityCard;
SQLCMDpas[14].Value = dtBirthDay;
SQLCMDpas[15].Value = intProjectID;
SQLCMDpas[16].Value = strAge;
SQLCMDpas[17].Value = strProfessional;
SQLCMDpas[18].Value = strNowLivingArea;
SQLCMDpas[19].Value = strLearnTheWayToTheCase;
SQLCMDpas[20].Value = strVisitConstitute;
SQLCMDpas[21].Value = strTraffic;
SQLCMDpas[22].Value = strRealEstateSituation;
SQLCMDpas[23].Value = strResidentialMortgageLoans;
SQLCMDpas[24].Value = strHomesBuyersPurpose;
SQLCMDpas[25].Value = strPlanTorealEstatePrice;
SQLCMDpas[26].Value = strDemandArea;
SQLCMDpas[27].Value = strPaymentWay;
SQLCMDpas[28].Value = strBuyingConsideration;
SQLCMDpas[29].Value = intClientID;
return myDALPublic.DAL_OPTableDB_Par("frmMarketManagement_ClientRegistrtion_NewClientRegistration", SQLCMDpas);
}
#endregion
第三步:界面层(UIL)具体相关事件和代码
void UpdateClient_Load(int intClientID)//自定义的方法,用来绑定将要修改信息的客户的详细信息
{
this.Text = "客户信息修改";
DataTable dtClientMsg = myfrmMarketManagement_ClientRegistrtion_NewClientRegistrationClient.UpdateClient_Load_SelectClientMsg(intClientID).Tables[0];
txtClientName.Text = dtClientMsg.Rows[0]["ClientName"].ToString().Trim();
switch (dtClientMsg.Rows[0]["EarlyVisitIntention"].ToString().Trim())
{// "弱", "中", "强"
case "弱":
cboEarlyVisitIntention.SelectedIndex = 0;
break;
case "中":
cboEarlyVisitIntention.SelectedIndex = 1;
break;
case "强":
cboEarlyVisitIntention.SelectedIndex = 2;
break;
}
switch (dtClientMsg.Rows[0]["Gender"].ToString().Trim())
{
case "男":
cboGender.SelectedIndex = 0;
break;
case "女":
cboGender.SelectedIndex = 1;
break;
}
switch (dtClientMsg.Rows[0]["MaritalStatus"].ToString().Trim())
{
case "未婚":
cboMaritalstatus.SelectedIndex = 0;
break;
case "已婚":
cboMaritalstatus.SelectedIndex = 1;
break;
}
txtSerialNumber.Text = dtClientMsg.Rows[0]["ClientNumber"].ToString().Trim();
switch ((int)dtClientMsg.Rows[0]["ClientRegistrationWayID"])
{// "弱", "中", "强"
case 32:// 来访
radVisiting.Checked = true;
intClientRegistrationWayID = 32;
break;
case 33:// 来电
radCalling.Checked = true;
intClientRegistrationWayID = 33;
break;
case 34:// 线索
radClues.Checked = true;
intClientRegistrationWayID = 34;
break;
}
txtContactPhoneNumber.Text = dtClientMsg.Rows[0]["RelationPhone"].ToString().Trim();
txtEmail.Text = dtClientMsg.Rows[0]["ElectronMail"].ToString().Trim();
cboHomebuyersconsultant.SelectedValue = (int)dtClientMsg.Rows[0]["HomeBuyerConsultantID"];
dtpVisitingDate.Value = Convert.ToDateTime(dtClientMsg.Rows[0]["DateOfVisit"]);
txtCorrspondenceAddress.Text = dtClientMsg.Rows[0]["CommunicationAddress"].ToString().Trim();
txtZipCode.Text = dtClientMsg.Rows[0]["Postcode"].ToString().Trim();
txtIDNumber.Text = dtClientMsg.Rows[0]["IDentityCard"].ToString().Trim();
dtpBirthDate.Value = Convert.ToDateTime(dtClientMsg.Rows[0]["BirthDay"]);
string strOldAge = dtClientMsg.Rows[0]["Age"].ToString().Trim();
string strOldProfessional = dtClientMsg.Rows[0]["Professional"].ToString().Trim();
string strOldNowLivingArea = dtClientMsg.Rows[0]["NowLivingArea"].ToString().Trim();
string strOldLearnTheWayToTheCase = dtClientMsg.Rows[0]["LearnTheWayToTheCase"].ToString().Trim();
string strOldVisitConsitute = dtClientMsg.Rows[0]["VisitConstitute"].ToString().Trim();
string strOldTraffic = dtClientMsg.Rows[0]["Traffic"].ToString().Trim();
string strOldRealEstateSituation = dtClientMsg.Rows[0]["RealEstateSituation"].ToString().Trim();
string strOldResidentionalMortgageLoans = dtClientMsg.Rows[0]["ResidentialMortgageLoans"].ToString().Trim();
string strOldHomesBuyersPurpose = dtClientMsg.Rows[0]["HomesBuyersPurpose"].ToString().Trim();
string strOldPlanTorealEastatePrice = dtClientMsg.Rows[0]["PlanTorealEstatePrice"].ToString().Trim();
string strOldDemandArea = dtClientMsg.Rows[0]["DemandArea"].ToString().Trim();
string strOldPaymentWay = dtClientMsg.Rows[0]["PaymentWay"].ToString().Trim();
string strOldBuyingConsideration = dtClientMsg.Rows[0]["BuyingConsideration"].ToString().Trim();
foreach (CheckBox ckb in pnlAge.Controls)//循环容器pnlAge里边的CheckBox控件,把原来客户选择的那个选择上
{
if (ckb.Text == strOldAge)
{
ckb.Checked = true;
strAge = strOldAge;
break;
}
}
foreach (CheckBox ckb in pnlProfessional.Controls)//同理上面
{
if (ckb.Text == strOldProfessional)
{
ckb.Checked = true;
strProfessional = strOldProfessional;
break;
}
}
foreach (CheckBox ckb in pnlNowLivingArea.Controls)//同理上面
{
if (ckb.Text == strOldNowLivingArea)
{
ckb.Checked = true;
strNowLivingArea = strOldNowLivingArea;
break;
}
}
foreach (CheckBox ckb in pnlLearnTheWayToTheCase.Controls)//同理上面
{
if (ckb.Text == strOldLearnTheWayToTheCase)
{
ckb.Checked = true;
strLearnTheWayToTheCase = strOldLearnTheWayToTheCase;
break;
}
}
foreach (CheckBox ckb in pnlVisitConstitute.Controls)//同理上面
{
if (ckb.Text == strOldVisitConsitute)
{
ckb.Checked = true;
strVisitConstitute = strOldVisitConsitute;
break;
}
}
foreach (CheckBox ckb in pnlTraffic.Controls)//同理上面
{
if (ckb.Text == strOldTraffic)
{
ckb.Checked = true;
strTraffic = strOldTraffic;
break;
}
}
foreach (CheckBox ckb in pnlRealEstateSituation.Controls)//同理上面
{
if (ckb.Text == strOldRealEstateSituation)
{
ckb.Checked = true;
strRealEstateSituation = strOldRealEstateSituation;
break;
}
}
foreach (CheckBox ckb in pnlResidentialMortgageLoans.Controls)//同理上面
{
if (ckb.Text == strOldResidentionalMortgageLoans)
{
ckb.Checked = true;
strResidentialMortgageLoans = strOldResidentionalMortgageLoans;
break;
}
}
foreach (CheckBox ckb in pnlHomesBuyersPurpose.Controls)//同理上面
{
if (ckb.Text == strOldHomesBuyersPurpose)
{
ckb.Checked = true;
strHomesBuyersPurpose = strOldHomesBuyersPurpose;
break;
}
}
foreach (CheckBox ckb in pnlPlanTorealEstatePrice.Controls)//同理上面
{
if (ckb.Text == strOldPlanTorealEastatePrice)
{
ckb.Checked = true;
strPlanTorealEstatePrice = strOldPlanTorealEastatePrice;
break;
}
}
foreach (CheckBox ckb in pnlDemandArea.Controls)//同理上面
{
if (ckb.Text == strOldDemandArea)
{
ckb.Checked = true;
strDemandArea = strOldDemandArea;
break;
}
}
foreach (CheckBox ckb in pnlPaymentWay.Controls)//同理上面
{
if (ckb.Text == strOldPaymentWay)
{
ckb.Checked = true;
strPaymentWay = strOldPaymentWay;
break;
}
}
foreach (CheckBox ckb in pnlBuyingConsideration.Controls)//同理上面
{
if (ckb.Text == strOldBuyingConsideration)
{
ckb.Checked = true;
strBuyingConsideration = strOldBuyingConsideration;
break;
}
}
btnSaveAndInsert.Visible = false;//设置按钮的可见性
btnSaveAndUpdate.Visible = true;
}
void Judage()
{
if (strAge == "")//判断在年龄里边是否已经选择
{
MessageBox.Show("请在‘年龄’处勾上相应的信息!!!", "提示");
return;
}
if (strProfessional == "")//判断在职业里边是否已经选择
{
MessageBox.Show("请在‘职业’处勾上相应的信息!!!", "提示");
return;
}
if (strNowLivingArea == "")//判断在现居住区域里边是否已经选择
{
MessageBox.Show("请在‘现居住区域’处勾上相应的信息!!!", "提示");
return;
}
if (strLearnTheWayToTheCase == "")//判断在获取本案途径里边是否已经选择
{
MessageBox.Show("请在‘获取本案途径’处勾上相应的信息!!!", "提示");
return;
}
if (strVisitConstitute == "")//判断在来客登记里边是否已经选择
{
MessageBox.Show("请在‘来客登记’处勾上相应的信息!!!", "提示");
return;
}
if (strTraffic == "")//判断在交通里边是否已经选择
{
MessageBox.Show("请在‘交通’处勾上相应的信息!!!", "提示");
return;
}
if (strRealEstateSituation == "")//判断在置业状况里边是否已经选择
{
MessageBox.Show("请在‘置业状况’处勾上相应的信息!!!", "提示");
return;
}
if (strResidentialMortgageLoans == "")//判断在住宅按揭贷款里边是否已经选择
{
MessageBox.Show("请在‘住宅按揭贷款’处勾上相应的信息!!!", "提示");
return;
}
if (strHomesBuyersPurpose == "")//判断在置业目的里边是否已经选择
{
MessageBox.Show("请在‘置业目的’处勾上相应的信息!!!", "提示");
return;
}
if (strPlanTorealEstatePrice == "")//判断在计划置业价格里边是否已经选择
{
MessageBox.Show("请在‘计划置业价格’处勾上相应的信息!!!", "提示");
return;
}
if (strDemandArea == "")//判断在需求面积里边是否已经选择
{
MessageBox.Show("请在‘需求面积’处勾上相应的信息!!!", "提示");
return;
}
if (strPaymentWay == "")//判断在付款方式里边是否已经选择
{
MessageBox.Show("请在‘付款方式’处勾上相应的信息!!!", "提示");
return;
}
if (strBuyingConsideration == "")//判断在买房考虑因素里边是否已经选择
{
MessageBox.Show("请在‘买房考虑因素’处勾上相应的信息!!!", "提示");
return;
}
}
string strAge = "";
string strProfessional = "";
string strNowLivingArea = "";
string strLearnTheWayToTheCase = "";
string strVisitConstitute = "";
string strTraffic = "";
string strRealEstateSituation = "";
string strResidentialMortgageLoans = "";
string strHomesBuyersPurpose = "";
string strPlanTorealEstatePrice = "";
string strDemandArea = "";
string strPaymentWay = "";
string strBuyingConsideration = "";
private void checkBox1_Click(object sender, EventArgs e)//一个自定义的公用方法,用来只能在一个panel里边只能有一个CheckBox是选定的
{
CheckBox ch1 = sender as CheckBox;
Control cl = ch1.Parent;
string strControlName = ch1.Parent.Name;
foreach (CheckBox ch in cl.Controls)//循环一个容器里边的所有CheckBox控件
{
if (ch1.Checked == true)//如果某一个是已经选择,则其他的变为未选择
{
if (ch != ch1)
{
ch.Checked = false;
}
else
{
switch (strControlName)
{
case "pnlAge":
strAge = ch1.Text.ToString();//获取选择的CheckBox的文本
break;
case "pnlProfessional":
strProfessional = ch1.Text.ToString();
break;
case "pnlNowLivingArea":
strNowLivingArea = ch1.Text.ToString();
break;
case "pnlLearnTheWayToTheCase":
strLearnTheWayToTheCase = ch1.Text.ToString();
break;
case "pnlVisitConstitute":
strVisitConstitute = ch1.Text.ToString();
break;
case "pnlTraffic":
strTraffic = ch1.Text.ToString();
break;
case "pnlRealEstateSituation":
strRealEstateSituation = ch1.Text.ToString();
break;
case "pnlResidentialMortgageLoans":
strResidentialMortgageLoans = ch1.Text.ToString();
break;
case "pnlHomesBuyersPurpose":
strHomesBuyersPurpose = ch1.Text.ToString();
break;
case "pnlPlanTorealEstatePrice":
strPlanTorealEstatePrice = ch1.Text.ToString();
break;
case "pnlDemandArea":
strDemandArea = ch1.Text.ToString();
break;
case "pnlPaymentWay":
strPaymentWay = ch1.Text.ToString();
break;
case "pnlBuyingConsideration":
strBuyingConsideration = ch1.Text.ToString();
break;
}
}
}
}
}
private void btnSaveAndUpdate_Click(object sender, EventArgs e)
{
Judage();
string strClientNumber = txtSerialNumber.Text.ToString().Trim();
string strClientName = txtClientName.Text.ToString().Trim();
string strEarlyVisitIntention = cboEarlyVisitIntention.Text.ToString().Trim();
string strGender = cboGender.Text.ToString().Trim();
string strMaritalStatus = cboMaritalstatus.Text.ToString().Trim();
string strRelationPhone = txtContactPhoneNumber.Text.ToString().Trim();
string strElectronMail = txtEmail.Text.ToString().Trim();
int intHomeBuyerConsultantID = (int)cboHomebuyersconsultant.SelectedValue;
DateTime dtDateOfVisit = Convert.ToDateTime(dtpVisitingDate.Text);
string strCommunicationAddress = txtCorrspondenceAddress.Text.ToString().Trim();
string strPostcode = txtZipCode.Text.ToString().Trim();
string strIDentityCard = txtIDNumber.Text.ToString().Trim();
DateTime dtBirthDay = Convert.ToDateTime(dtpBirthDate.Text);
int intProject = Convert.ToInt32(FrmCustomerManagement.dgvClientDetail.CurrentRow.Cells["ProjectID1"].Value);
int intSaveSuccess = myfrmMarketManagement_ClientRegistrtion_NewClientRegistrationClient.NewClientRegistration_btnSaveAndUpdate_Click(strClientNumber, strClientName,
strEarlyVisitIntention, strGender, strMaritalStatus, intClientRegistrationWayID, strRelationPhone, strElectronMail, intHomeBuyerConsultantID, dtDateOfVisit,
strCommunicationAddress, strPostcode, strIDentityCard, dtBirthDay, intProject,
strAge, strProfessional, strNowLivingArea, strLearnTheWayToTheCase,
strVisitConstitute, strTraffic, strRealEstateSituation, strResidentialMortgageLoans, strHomesBuyersPurpose,
strPlanTorealEstatePrice, strDemandArea, strPaymentWay, strBuyingConsideration, intOldClientID);
if (intSaveSuccess > 0)
{
MessageBox.Show("修改成功!!!");
FrmCustomerManagement.tsbtnRefresh_Click(null,null);
this.Dispose();
}
else if (MessageBox.Show("很遗憾,修改失败,请正确操作数据后再点击修改", "是否退出界面", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
{
this.Dispose();
}
else
{
return;
}
}
4.置业顾问调换
从界面上可以看到我们这里用到的控件有
控件名称 | 说明 |
标注(Label) | 控件可以在工具箱直接拖动至窗体,拖至窗体后右击属性可以修改控件的样式和各种属性,还可以编辑事件。 |
列表展示容器(ListView) | |
文本(TextBox) | |
按钮(Button) | |
组容器(GroupBox) | |
下拉框(ComboBox) |
功能实现:
第一步:数据库
1、表与关系
表1: 房间资源表(dbo.SYS_RoomResource)
Primary Key(主键): RoomResourcesID
非主键ID值均是外键
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
RoomResourcesID | int - Identity |
| No | 房间资源ID
|
FloorID | int |
| Yes | 楼栋信息表,楼栋ID
|
TheCodeModelID | int |
| Yes | 属性明细表,代码模式ID
|
Number | nchar (10) |
| Yes | 编号
|
UnitNumberID | int |
| Yes | 单元表,单元ID
|
FloorStotey | nchar (10) |
| Yes | 楼层
|
RoomCategoryID | int |
| Yes | 属性明细表,房间类别ID
|
TowardID | int |
| Yes | 属性明细表,朝向ID
|
DoorModelID | int |
| Yes | 属性明细表,户型ID
|
RoomTypeID | int |
| Yes | 属性明细表,房间类型ID
|
RoomLandScapeID | int |
| Yes | 属性明细表,房间景观ID
|
RoomSpecialID | int |
| Yes | 属性明细表,房间特殊ID
|
ConstructionArea | decimal (18, 2) |
| Yes | 建筑面积
|
PricateArea | decimal (18, 2) |
| Yes | 私有面积
|
PublicArea | decimal (18, 2) |
| Yes | 公摊面积
|
Usage | decimal (18, 2) |
| Yes | 使用率
|
TheUnitPrice | decimal (18, 2) |
| Yes | 标价单价
|
BidPrice | decimal (18, 2) |
| Yes | 标价总价
|
NumberOfPrice | nchar (10) |
| Yes | 价格次数
|
SalesStatusID | int | ((102)) | Yes | 属性明细表,销售状态ID
|
BriefNote | nchar (30) |
| Yes | 简要备注
|
SchematicDiagram | image |
| Yes | 示意图
|
Chart | image |
| Yes | 效果图
|
表2: 房源保留表(dbo.PW_RoomSelect_Keep)
Primary Key(主键): KeepID
非主键ID值均是外键
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
KeepID | int - Identity |
| No | 保留ID
|
FloorID | int |
| Yes | 楼栋信息表,楼栋ID
|
RoomResourcesID | int |
| Yes | 房间资源ID,房间ID
|
UnitPrice | decimal (18, 2) |
| Yes | 单价
|
Price | decimal (18, 2) |
| Yes | 售价
|
KeepPeople | int |
| Yes | 保留人
|
Note | nchar (300) |
| Yes | 说明
|
StartDate | datetime |
| Yes | 开始时间
|
KeepTime | nchar (10) |
| Yes | 保留时长
|
KeepDate | nchar (10) |
| Yes | 保留天数
|
OperatingPerson | int |
| Yes | 经办人员
|
IncalidOr | bit | ((0)) | Yes | 作废否
|
表3: 客户信息表 (dbo.PW_ClientInformation)
Primary Key(主键): ClientID
非主键ID值均是外键
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
ClientID | int - Identity |
| No | 客户ID
|
ProjectID | int |
| Yes | 项目信息表,项目ID
|
ClientNumber | nchar (10) |
| Yes | 客户编号
|
ClientName | nchar (10) |
| Yes | 客户名称
|
EarlyVisitIntention | nchar (10) |
| Yes | 初访意向
|
Gender | nchar (10) |
| Yes | 性别
|
MaritalStatus | nchar (10) |
| Yes | 婚否
|
ClientRegistrationWayID | int |
| Yes | 属性明细表,客户登记方式ID
|
RelationPhone | nchar (15) |
| Yes | 联系电话
|
ElectronMail | nchar (30) |
| Yes | 电子邮箱
|
HomeBuyerConsultantID | int |
| Yes | 员工表,置业顾问ID
|
DateOfVisit | datetime |
| Yes | 来访日期
|
CommunicationAddress | nchar (50) |
| Yes | 通讯地址
|
Postcode | nchar (10) |
| Yes | 邮编
|
IDentityCard | nchar (30) |
| Yes | 身份证号
|
BirthDay | date |
| Yes | 出生日期
|
Age | nchar (20) |
| Yes | 年龄
|
Professional | nchar (20) |
| Yes | 职业
|
NowLivingArea | nchar (20) |
| Yes | 现居住区域
|
LearnTheWayToTheCase | nchar (20) |
| Yes | 获取本案途径
|
VisitConstitute | nchar (20) |
| Yes | 来客构成
|
Traffic | nchar (20) |
| Yes | 交通
|
RealEstateSituation | nchar (20) |
| Yes | 置业状况
|
ResidentialMortgageLoans | nchar (20) |
| Yes | 住宅按揭贷款
|
HomesBuyersPurpose | nchar (20) |
| Yes | 置业目的
|
PlanTorealEstatePrice | nchar (20) |
| Yes | 计划置业价格
|
DemandArea | nchar (20) |
| Yes | 需求面积
|
PaymentWay | nchar (20) |
| Yes | 付款方式ID
|
BuyingConsideration | nchar (20) |
| Yes | 买房考虑因素
|
IncalidOr | bit | ((0)) | Yes | 作废否
|
表4: 预定表 (dbo.PW_ReserveUnit)
Primary Key(主键): ReserveUnitID
非主键ID值均是外键
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
ReserveUnitID | int - Identity |
| No | 预订单元ID
|
ClientID | int |
| Yes | 客户表,客户ID
|
FloorID | int |
| Yes | 楼栋信息表,楼栋ID
|
UnitNumberID | int |
| Yes | 单元表,单元ID
|
RoomNumeral | nchar (10) |
| Yes | 房间排号
|
PresalseArea | nchar (10) |
| Yes | 预售面积
|
ReservationPrice | money |
| Yes | 预收单价
|
BookingReservationPrice | money |
| Yes | 预定总价
|
AccountsReceivableBookingGoid | money |
| Yes | 应收预约金
|
BookingDate | datetime |
| Yes | 预定日期
|
ValidDate | datetime |
| Yes | 有效日期
|
BriefNote | nchar (20) |
| Yes | 简要备注
|
AuditDate | date |
| Yes | 审核日期
|
NewReserveUnitID | int |
| Yes | 预定表,新预定ID
|
ChangeReason | int |
| Yes | 属性明细表,变更原因ID
|
IncalidOr | bit | ((0)) | Yes | 作废否
|
表5: 预留表 (dbo. PW_SeserveUnit)
Primary Key(主键): SeserveUnitID
非主键ID值均是外键
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
SeserveUnitID | int - Identity |
| No | 预留单元ID
|
ClientID | int |
| Yes | 客户信息表,客户ID
|
FloorID | int |
| Yes | 楼栋信息表,楼栋ID
|
UnitNumberID | int |
| Yes | 房间资源表,房间单元ID
|
RoomNumeral | nchar (10) |
| Yes | 房间排号
|
PresalseArea | decimal (18, 2) |
| Yes | 预售面积
|
SeservationUnitPrice | decimal (18, 2) |
| Yes | 预留单价
|
BookingSeservationPrice | decimal (18, 2) |
| Yes | 预留总价
|
AccountsReceivableBookingGoid | money |
| Yes | 应收预约金
|
SeservatingDate | datetime |
| Yes | 预留日期
|
ValidDate | datetime |
| Yes | 有效日期
|
BriefNote | nchar (100) |
| Yes | 简要备注
|
AuditDate | datetime |
| Yes | 审核日期
|
NewSeserveUnitID | int |
| Yes | 预留表,新的预留ID
|
ChangeReason | int |
| Yes | 变更原因
|
IncalidOr | bit | ((0)) | Yes | 作废否
|
表6: 认购表 (dbo. PW_SubscribeUnit)
Primary Key(主键): SubscribeUnitID
非主键ID值均是外键
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
SubscribeUnitID | int - Identity |
| No | 认购单元ID
|
SalesChangeID | int |
| Yes | 销售便更表,销售变更ID
|
SubscriptioNumber | nchar (20) |
| Yes | 认购单编号
|
SubscribeToDate | datetime |
| Yes | 认购日期
|
AnticipatedDateSigned | datetime |
| Yes | 预计签约日期
|
ContractArea | nchar (10) |
| Yes | 合同面积
|
TypeOfPanymentID | int |
| Yes | 付款方式表,付款方式ID
|
PaymentDetailsOfNameID | int |
| Yes | 付款方式明细表,付款名称细目ID
|
SalesAreaOfWayID | int |
| Yes | 属性明细表,销售面积方式ID
|
FsvorableDiscount | decimal (18, 2) |
| Yes | 优惠折扣
|
ClinchADealUnitPrice | money |
| Yes | 成交单价
|
ClinchADealThePrice | money |
| Yes | 成交总价
|
ClientID | int |
| Yes | 客户信息表,客户ID
|
AgentID | int |
| Yes | 员工表,经办人ID
|
BriefNote | nchar (20) |
| Yes | 简要备注
|
ReviewWhether | bit | ((0)) | Yes | 审核否
|
CancelWhether | bit | ((0)) | Yes | 作废否
|
ChangeOfAuditStatusID | int |
| Yes | 属性明细表,变更审核状态ID
|
RoomResourcesID | int |
| Yes | 房间资源表,房源ID
|
AfterUpdateID | int |
| Yes | 认购表,修改后的认购ID
|
表7: 认筹表 (dbo. PW_ClientConfessToRaise)
Primary Key(主键): ClientConfessToRaiseID
非主键ID值均是外键
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
ClientConfessToRaiseID | int - Identity |
| No | 客户认筹ID
|
ClientID | int |
| Yes | 客户信息表,客户ID
|
RaiseNumeralRecognition | nchar (10) |
| Yes | 认筹排号
|
TheOrderNumber | nchar (10) |
| Yes | 订单号
|
ConfessToRaiseClassificationID | int |
| Yes | 属性明细表,筹卡分类ID
|
AccountsReceivableAppointmentGold | money |
| Yes | 应收预约金
|
ConfesstoraiseDate | datetime |
| Yes | 认筹日期
|
EffectiveDate | datetime |
| Yes | 有效日期
|
IntentionUnitInstructions | nchar (10) |
| Yes | 意向单元说明
|
Note | nchar (30) |
| Yes | 备注
|
ToSeserve | bit | ((0)) | Yes | 转预留否
|
SeserveID | int |
| Yes | 预留表,预留ID
|
AuditWhether | bit | ((0)) | Yes | 审核否
|
IncalidWhether | bit | ((0)) | Yes | 作废否
|
AfterUpdateID | int |
| Yes | 认筹表,修改后ID
|
表8: 员工表 (dbo. SYS_Staff)
Primary Key(主键): StaffID
非主键ID值均是外键
列名 | 数据类型 | Nulls? | 说明 |
StaffID | int - Identity | No | 员工ID
|
StaffNumber | nchar (10) | Yes | 员工编号
|
StaffName | nchar (10) | Yes | 员工姓名
|
DepartMentID | int | Yes | 所属部门
|
GenderID | int | Yes | 属性明细表,性别ID
|
Age | int | Yes | 年龄
|
EducationBackgroundID | int | Yes | 属性明细表,学历ID
|
MarryWhether | bit | Yes | 婚否
|
Position | nchar (10) | Yes | 职位
|
ContactPhoneNumber | nchar (15) | Yes | 联系电话
|
ContactAddress | nchar (20) | Yes | 联系地址
|
Notes | nchar (100) | Yes | 备注
|
StaffImage | image | Yes | 员工照片
|
2、具体代码实现
第一步:数据库存储过程
if(@type='Exchange_Load_BindingcboClientAttribute')--查询客户属性
begin
SELECT AttributeDetailsID, rtrim(AuttributeDetailsName) as AuttributeDetailsName
FROM SYS_AttributeDetails
where SYS_AttributeDetails.AuttributeSetID=41
end
if(@type='Exchange_Load_BindingcboChangeWay')--查询表更方式
begin
SELECT AttributeDetailsID, rtrim(AuttributeDetailsName) as AuttributeDetailsName
FROM SYS_AttributeDetails
where SYS_AttributeDetails.AuttributeSetID=42
end
if(@type='btnSave_Click_UpdateHomeBuyerConsultant')--修改客户的置业顾问
begin
UPDATE PW_ClientInformation
SET HomeBuyerConsultantID = @HomeBuyerConsultantID
where PW_ClientInformation.ClientID = @ClientID
end
if(@type='btnSave_Click_InsertHomeBuyerConsultantExchangeRecord')--新增客户置业顾问记录
begin
INSERT INTO PW_HomeBuyerConsultantExchange
(ClientID, ClientAttributeID, ExchangeWayID, OldHomeBuyerConsultantID, NewHomeBuyerConsultantID, ExchangeNote, ExchangeDate)
VALUES (@ClientID, @ClientAttributeID, @ExchangeWayID, @OldHomeBuyerConsultantID, @NewHomeBuyerConsultantID, @ExchangeNote, GETDATE())
end
if(@type='JudgeClientAttribute') -- 判断客户属性
begin
with CTE as
(SELECT PW_ClientInformation.ClientID, rtrim(PW_ClientInformation.ClientName) as ClientName, rtrim(SYS_RoomResources.Number) as Number,
rtrim(SYS_FloorInformation.FloorName) AS FloorName, PW_ReserveUnit.BookingDate as 日期,'已预定' as RoomStatus
FROM PW_ClientInformation INNER JOIN
PW_ReserveUnit ON PW_ClientInformation.ClientID = PW_ReserveUnit.ClientID INNER JOIN
SYS_FloorInformation ON PW_ReserveUnit.FloorID = SYS_FloorInformation.FloorID INNER JOIN
SYS_RoomResources ON PW_ReserveUnit.UnitNumberID = SYS_RoomResources.RoomResourcesID
where PW_ClientInformation.IncalidOr=0 and PW_ReserveUnit.IncalidOr=0
union
SELECT PW_ClientInformation.ClientID, RTRIM(PW_ClientInformation.ClientName) AS ClientName, RTRIM(SYS_RoomResources.Number) AS Number,
RTRIM(SYS_FloorInformation.FloorName) AS FloorName, PW_RoomSelect_Keep.StartDate as 日期,'已保留' as RoomStatus
FROM PW_RoomSelect_Keep INNER JOIN
SYS_FloorInformation ON PW_RoomSelect_Keep.FloorID = SYS_FloorInformation.FloorID INNER JOIN
PW_ClientInformation ON PW_RoomSelect_Keep.KeepPeople = PW_ClientInformation.ClientID INNER JOIN
SYS_RoomResources ON PW_RoomSelect_Keep.RoomResourcesID = SYS_RoomResources.RoomResourcesID
WHERE PW_ClientInformation.IncalidOr = 0 and PW_RoomSelect_Keep.IncalidOr=0
union
SELECT PW_ClientInformation.ClientID, RTRIM(PW_ClientInformation.ClientName) AS ClientName, RTRIM(SYS_RoomResources.Number) AS Number,
RTRIM(SYS_FloorInformation.FloorName) AS FloorName, PW_SeserveUnit.SeservatingDate as 日期,'已预留' as RoomStatus
FROM SYS_FloorInformation INNER JOIN
PW_SeserveUnit ON SYS_FloorInformation.FloorID = PW_SeserveUnit.FloorID INNER JOIN
PW_ClientInformation ON PW_SeserveUnit.ClientID = PW_ClientInformation.ClientID INNER JOIN
SYS_RoomResources ON PW_SeserveUnit.UnitNumberID = SYS_RoomResources.RoomResourcesID
WHERE (PW_ClientInformation.IncalidOr = 0 and PW_SeserveUnit.IncalidOr=0)
union
SELECT PW_ClientInformation.ClientID, RTRIM(PW_ClientInformation.ClientName) AS ClientName, RTRIM(SYS_RoomResources.Number) AS Number,
RTRIM(SYS_FloorInformation.FloorName) AS FloorName, PW_SubscribeUnit.SubscribeToDate as 日期,'已认购' as RoomStatus
FROM PW_SubscribeUnit INNER JOIN
PW_ClientInformation ON PW_SubscribeUnit.ClientID = PW_ClientInformation.ClientID INNER JOIN
SYS_RoomResources ON PW_SubscribeUnit.RoomResourcesID = SYS_RoomResources.RoomResourcesID INNER JOIN
SYS_FloorInformation ON SYS_RoomResources.FloorID = SYS_FloorInformation.FloorID
WHERE (PW_ClientInformation.IncalidOr = 0 and PW_SubscribeUnit.CancelWhether=0)
union
SELECT PW_ClientInformation.ClientID, RTRIM(PW_ClientInformation.ClientName) AS ClientName, '未选定房源' as Number,
'未选定楼栋' as FloorName , PW_ClientConfessToRaise.ConfesstoraiseDate as 日期,'已认筹' as RoomStatus
FROM PW_ClientConfessToRaise INNER JOIN
PW_ClientInformation ON PW_ClientConfessToRaise.ClientID = PW_ClientInformation.ClientID
WHERE (PW_ClientInformation.IncalidOr = 0 and PW_ClientConfessToRaise.IncalidWhether=0 and PW_ClientConfessToRaise.ToSeserve=0)
)
select ClientID,Number,ClientName,FloorName ,CONVERT (nchar(10),日期,20) as 日期,RoomStatus
from CTE
where ClientID=@ClientID
第二步:逻辑层(BLL)的代码
[OperationContract]
#region 绑定cbo客户属性
public DataSet Exchange_Load_BindingcboClientAttribute()
{
SqlParameter[] SQLCMDpas = { new SqlParameter("@type", SqlDbType.Char),
};
SQLCMDpas[0].Value = "Exchange_Load_BindingcboClientAttribute";
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_CustomerManagement", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 绑定cbo变更方式
public DataSet Exchange_Load_BindingcboChangeWay()
{
SqlParameter[] SQLCMDpas = { new SqlParameter("@type", SqlDbType.Char),
};
SQLCMDpas[0].Value = "Exchange_Load_BindingcboChangeWay";
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_CustomerManagement", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 修改原置业顾问ID
public int btnSave_Click_UpdateHomeBuyerConsultant(int intHomeBuyerConsultantID, int intClientID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@type", SqlDbType.Char),
new SqlParameter("@HomeBuyerConsultantID", SqlDbType.Int),
new SqlParameter("@ClientID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "btnSave_Click_UpdateHomeBuyerConsultant";
SQLCMDpas[1].Value = intHomeBuyerConsultantID;
SQLCMDpas[2].Value = intClientID;
return myDALPublic.DAL_OPTableDB_Par("frmMarketManagement_CustomerManagement", SQLCMDpas);
}
#endregion
[OperationContract]
#region 新增置业顾问变更记录
public int btnSave_Click_InsertHomeBuyerConsultantExchangeRecord(int intClientID, int intClientAttributeID, int intExchangeWayID, int intOldHomeBuyerConsultantID, int intNewHomeBuyerConsultantID, string strExchangeNote)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@type", SqlDbType.Char),
new SqlParameter("@ClientID", SqlDbType.Int),
new SqlParameter("@ClientAttributeID", SqlDbType.Int),
new SqlParameter("@ExchangeWayID", SqlDbType.Int),
new SqlParameter("@OldHomeBuyerConsultantID", SqlDbType.Int),
new SqlParameter("@NewHomeBuyerConsultantID", SqlDbType.Int),
new SqlParameter("@ExchangeNote", SqlDbType.NChar),
};
SQLCMDpas[0].Value = "btnSave_Click_InsertHomeBuyerConsultantExchangeRecord";
SQLCMDpas[1].Value = intClientID;
SQLCMDpas[2].Value = intClientAttributeID;
SQLCMDpas[3].Value = intExchangeWayID;
SQLCMDpas[4].Value = intOldHomeBuyerConsultantID;
SQLCMDpas[5].Value = intNewHomeBuyerConsultantID;
SQLCMDpas[6].Value = strExchangeNote;
return myDALPublic.DAL_OPTableDB_Par("frmMarketManagement_CustomerManagement", SQLCMDpas);
}
#endregion
[OperationContract]
#region 判断客户属性的依据
public DataSet JudgeClientAttribute(int intClientID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@type", SqlDbType.Char),
new SqlParameter("@ClientID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "JudgeClientAttribute";
SQLCMDpas[1].Value = intClientID;
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_CustomerManagement", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
第三步:界面层(UIL)的相关事件和代码
int intClientID = 0;//声明全局变量
int intHomeBuyerID = 0;
frmMarketManagement_CustomerManagement Frm;
public frmMarketManagement_CustomerManagement_Exchange(int intClient,int intHomeBuyer,frmMarketManagement_CustomerManagement frm)//窗体之间的传值
{
intClientID = intClient;
intHomeBuyerID = intHomeBuyer;
Frm = frm;
InitializeComponent();
}
private void btnReturn_Click(object sender, EventArgs e)//返回按钮的单击事件
{
this.Close();
}
BLL新锐房地产销售系统.MarketManagement.frmMarketManagement_CustomerManagement.frmMarketManagement_CustomerManagementClient myfrmMarketManagement_CustomerManagementClient = new BLL新锐房地产销售系统.MarketManagement.frmMarketManagement_CustomerManagement.frmMarketManagement_CustomerManagementClient();//实例化逻辑层
private void frmMarketManagement_CustomerManagement_Exchange_Load(object sender, EventArgs e)//窗体加载事件
{
DataTable dtClientAttribute = myfrmMarketManagement_CustomerManagementClient.Exchange_Load_BindingcboClientAttribute().Tables[0];
DataTable dtChangeWay = myfrmMarketManagement_CustomerManagementClient.Exchange_Load_BindingcboChangeWay().Tables[0];
DataTable dtOldHomeBuyersConsultant = myfrmMarketManagement_CustomerManagementClient.CustomerManagement_Load_cboHomeBuyersConsultant().Tables[0];
DataTable dtNewHomeBuyersConsultant = myfrmMarketManagement_CustomerManagementClient.CustomerManagement_Load_cboHomeBuyersConsultant().Tables[0];
PublicMethod.SettingComboBox(cboClientAttribute, dtClientAttribute, "AttributeDetailsID", "AuttributeDetailsName");//绑定ComboBox数据源
PublicMethod.SettingComboBox(cboChangeWay, dtChangeWay, "AttributeDetailsID", "AuttributeDetailsName");
PublicMethod.SettingComboBox(cboOldHomeBuyersConsultant, dtOldHomeBuyersConsultant, "StaffID", "置业顾问");
PublicMethod.SettingComboBox(cboNewHomeBuyersConsultant, dtNewHomeBuyersConsultant, "StaffID", "置业顾问");
cboOldHomeBuyersConsultant.SelectedValue = intHomeBuyerID;
BindingcboClientAttribute(intClientID);//绑定客户属性
}
int BindingcboClientAttribute(int intClientID)//构造函数
{
int intStatus = 0;
DataTable dtMsg = myfrmMarketManagement_CustomerManagementClient.JudgeClientAttribute(intClientID).Tables[0];
if (dtMsg.Rows.Count > 0)
{
if (dtMsg.Rows.Count == 1)
{
string strRoomStatus = dtMsg.Rows[0]["RoomStatus"].ToString().Trim();
switch (strRoomStatus)
{
case "已认筹":
intStatus = 172;
break;
case "已认购":
intStatus = 176;
break;
case "已预留":
intStatus = 173;
break;
case "已保留":
intStatus = 174;
break;
case "已预定":
intStatus = 175;
break;
}
}
else
{
intStatus = 177;
}
}
else
{
intStatus = 170;
}
for (int count = 0; count < dtMsg.Rows.Count; count++)
{
string strMsg = dtMsg.Rows[count]["FloorName"].ToString() + "-" + dtMsg.Rows[count]["Number"].ToString() + ", " + dtMsg.Rows[count]["ClientName"].ToString() + ", " + dtMsg.Rows[count]["日期"].ToString() + ", " + dtMsg.Rows[count]["RoomStatus"].ToString();//绑定ListView的节点
TreeNode tn = new TreeNode();
tn.Text = strMsg;
tvwClientUnitSelect.Nodes.Add(tn);
}
return intStatus;
}
private void btnSave_Click(object sender, EventArgs e)//点击保存
{
int intClientAttributeID=(int)cboClientAttribute.SelectedValue;
int intExchangeWayID=(int)cboChangeWay.SelectedValue;
int intOldHomeBuyerConsultantID=(int)cboOldHomeBuyersConsultant.SelectedValue;
int intNewHomeBuyerConsultantID=(int)cboNewHomeBuyersConsultant.SelectedValue;
string strExchangeNote=txtChangeInstructions.Text.ToString();
int myop = myfrmMarketManagement_CustomerManagementClient.btnSave_Click_InsertHomeBuyerConsultantExchangeRecord(intClientID, intClientAttributeID, intExchangeWayID, intOldHomeBuyerConsultantID, intNewHomeBuyerConsultantID, strExchangeNote);//新增置业顾问调换记录
if (myop > 0)
{
myfrmMarketManagement_CustomerManagementClient.btnSave_Click_UpdateHomeBuyerConsultant(intNewHomeBuyerConsultantID, intClientID);
PublicMethod.Pub_InsertClientEventRecord(intClientID, DateTime.Now, "置业顾问调换", "客户要求调换置业顾问");
MessageBox.Show("修改成功!", "提示");
Frm.tsbtnRefresh_Click(null,null);
this.Close();
}
else
{
MessageBox.Show("修改失败!", "提示");
return;
}
}
以上仅供学习用途,
如用于商业用途,
后果自负