1.认购签约主界面
从界面上可以看到我们这里用到的控件有
控件名称 | 说明 |
标注(Label) | 控件可以在工具箱直接拖动至窗体,拖至窗体后右击属性可以修改控件的样式和各种属性,还可以编辑事件。 |
选项卡(TabControl) | |
树状图(TreeView) | |
文本(TextBox) | |
按钮(Button) | |
菜单(ToolStripMenuItem) | |
复选框(CheckBox) | |
工具栏(ToolStrip) | |
图片列表(ImageList) | |
表格(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_FloorInformation)
Primary Key(主键): FloorID
非主键ID值均是外键
(这里因为在这个表里边没有设置有默认值,所以没有默认值的那一列)
列名 | 数据类型 | Nulls? | 说明 |
FloorID | int - Identity | No | 楼栋ID
|
ProjectID | int | Yes | 项目信息表,项目ID
|
FloorStructureID | int | Yes | 属性明细表,楼栋结构ID
|
OpenBatchID | int | Yes | 属性明细表,开盘批次ID
|
LaunchSituationID | int | Yes | 属性明细表,推出情况ID
|
OpeningSituationID | int | Yes | 属性明细表,开盘情况ID
|
FloorLevelID | int | Yes | 楼栋级别ID
|
SortNumber | nchar (10) | Yes | 序号
|
FloorName | nchar (20) | Yes | 楼栋名称
|
PropertyRightFloorName | nchar (20) | Yes | 产权楼栋名称
|
FloorStorey | nchar (10) | Yes | 楼栋层数
|
LaunchDate | datetime | Yes | 推出日期
|
DoMortgageDate | datetime | Yes | 具备办按揭日期
|
CapsDate | datetime | Yes | 封顶日期
|
AccumulationFundDate | datetime | Yes | 具备办公积金日期
|
ExpectedPayDate | datetime | Yes | 预计交房日期
|
PropertyRightDate | datetime | Yes | 具备办产权日期
|
MakingRoomDate | datetime | 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. 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 | 员工照片
|
表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
|
2、具体的代码实现
第一步:数据库的存储过程
if @Type='SubscribeToSign_Load_BindingdgvProject'--查询项目
begin
SELECT ProjectID,RTRIM( ProjectName) as ProjectName
FROM SYS_ProjectInformation
end
if @Type='dgvProject_CellDoubleClick_BindtvwFloor'--查询楼栋信息
begin
SELECT FloorID, RTRIM( FloorName) as FloorName
FROM SYS_FloorInformation
where SYS_FloorInformation.ProjectID=@ProjectID
end
if @Type='dgvProject_CellDoubleClick_BindtvwRoom'--查询房源信息
begin
SELECT RoomResourcesID, RTRIM( Number) as Number
FROM SYS_RoomResources
where SYS_RoomResources.FloorID=@FloorID
end
if @Type='Load_SelectAllSubscribeUnitMsg'--查询所有的房源信息
begin
SELECT PW_SubscribeUnit.SubscribeUnitID, SYS_RoomResources.RoomResourcesID, RTRIM(SYS_RoomResources.Number) AS Number, PW_ClientInformation.ClientID,
RTRIM(PW_ClientInformation.ClientName) AS ClientName, SYS_Staff.StaffID, RTRIM(SYS_Staff.StaffName) AS StaffName, RTRIM(SYS_AttributeDetails.AuttributeDetailsName) AS SalesAreaOfWay,
RTRIM(PW_SubscribeUnit.SubscriptioNumber) AS SubscriptioNumber, PW_SubscribeUnit.SubscribeToDate, PW_SubscribeUnit.AnticipatedDateSigned, RTRIM(PW_SubscribeUnit.ContractArea)
AS ContractArea, RTRIM(PW_SubscribeUnit.ClinchADealUnitPrice) AS ClinchADealUnitPrice, RTRIM(PW_SubscribeUnit.ClinchADealThePrice) AS ClinchADealThePrice,
RTRIM(PW_SubscribeUnit.BriefNote) AS BriefNote, (case when PW_SubscribeUnit.ReviewWhether = 0 then '未审核'
when PW_SubscribeUnit.ReviewWhether = 1 then '已审核' END) as 审核否
FROM PW_SubscribeUnit INNER JOIN
SYS_RoomResources ON PW_SubscribeUnit.RoomResourcesID = SYS_RoomResources.RoomResourcesID INNER JOIN
PW_ClientInformation ON PW_SubscribeUnit.ClientID = PW_ClientInformation.ClientID INNER JOIN
SYS_Staff ON PW_SubscribeUnit.AgentID = SYS_Staff.StaffID INNER JOIN
SYS_AttributeDetails ON PW_SubscribeUnit.SalesAreaOfWayID = SYS_AttributeDetails.AttributeDetailsID
end
if @Type='tvwSubscribeUnit_NodeMouseClick_SelectMsg'--查询某一楼栋里边的详细信息
begin
SELECT PW_SubscribeUnit.SubscribeUnitID, SYS_RoomResources.RoomResourcesID, RTRIM(SYS_RoomResources.Number) AS Number, PW_ClientInformation.ClientID,
RTRIM(PW_ClientInformation.ClientName) AS ClientName, SYS_Staff.StaffID, RTRIM(SYS_Staff.StaffName) AS StaffName, RTRIM(SYS_AttributeDetails.AuttributeDetailsName) AS SalesAreaOfWay,
RTRIM(PW_SubscribeUnit.SubscriptioNumber) AS SubscriptioNumber, PW_SubscribeUnit.SubscribeToDate, PW_SubscribeUnit.AnticipatedDateSigned, RTRIM(PW_SubscribeUnit.ContractArea)
AS ContractArea, RTRIM(PW_SubscribeUnit.ClinchADealUnitPrice) AS ClinchADealUnitPrice, RTRIM(PW_SubscribeUnit.ClinchADealThePrice) AS ClinchADealThePrice,
RTRIM(PW_SubscribeUnit.BriefNote) AS BriefNote, (case when PW_SubscribeUnit.ReviewWhether = 0 then '未审核'
when PW_SubscribeUnit.ReviewWhether = 1 then '已审核' END) as 审核否
FROM PW_SubscribeUnit INNER JOIN
SYS_RoomResources ON PW_SubscribeUnit.RoomResourcesID = SYS_RoomResources.RoomResourcesID INNER JOIN
PW_ClientInformation ON PW_SubscribeUnit.ClientID = PW_ClientInformation.ClientID INNER JOIN
SYS_Staff ON PW_SubscribeUnit.AgentID = SYS_Staff.StaffID INNER JOIN
SYS_AttributeDetails ON PW_SubscribeUnit.SalesAreaOfWayID = SYS_AttributeDetails.AttributeDetailsID
where SYS_RoomResources.FloorID=@FloorID
end
if @Type='tsbtnAudit_Click_Update'--修改审核否
begin
UPDATE PW_SubscribeUnit
SET ReviewWhether = 1, AuditDate = GETDATE()
where PW_SubscribeUnit.SubscribeUnitID=@SubscribeUnitID
end
第二步:逻辑层(BLL)相关代码
[ServiceContract]
public class frmMarketManagement_SubscribeToSign
{
DALPublic.DALPublic myDALPublic = new DALPublic.DALPublic();
[OperationContract]
#region 绑定dgv项目
public DataSet SubscribeToSign_Load_BindingdgvProject()
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
};
SQLCMDpas[0].Value = "SubscribeToSign_Load_BindingdgvProject";
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_SubscribeToSign", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 绑定所有认购信息
public DataSet Load_SelectAllSubscribeUnitMsg()
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
};
SQLCMDpas[0].Value = "Load_SelectAllSubscribeUnitMsg";
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_SubscribeToSign", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 绑定树状图楼栋
public DataSet dgvProject_CellDoubleClick_BindtvwFloor(int intProjectID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@ProjectID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "dgvProject_CellDoubleClick_BindtvwFloor";
SQLCMDpas[1].Value = intProjectID;
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_SubscribeToSign", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 绑定树状图房间
public DataSet dgvProject_CellDoubleClick_BindtvwRoom(int intFloorID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@FloorID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "dgvProject_CellDoubleClick_BindtvwRoom";
SQLCMDpas[1].Value = intFloorID;
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_SubscribeToSign", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 绑定dgv预订信息
public DataSet tvwSubscribeUnit_NodeMouseClick_SelectMsg(int intFloorID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@FloorID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "tvwSubscribeUnit_NodeMouseClick_SelectMsg";
SQLCMDpas[1].Value = intFloorID;
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_SubscribeToSign", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 审核认购
public int tsbtnAudit_Click_Update(int intSubscribeUnitID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@SubscribeUnitID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "tsbtnAudit_Click_Update";
SQLCMDpas[1].Value = intSubscribeUnitID;
return myDALPublic.DAL_OPTableDB_Par("frmMarketManagement_SubscribeToSign", SQLCMDpas);
}
#endregion
}
第三步:界面层(UIL)相关代码及说明
public partial class frmMarketManagement_SubscribeToSign : Form
{
frmMain frmmain;
public frmMarketManagement_SubscribeToSign(frmMain frm)
{
frmmain = frm;
InitializeComponent();
}
private void tsbtnExit_Click(object sender, EventArgs e)
{
this.Close();
}
private void frmMarketManagement_SubscribeToSign_FormClosing(object sender, FormClosingEventArgs e)
{
frmmain.RemoveTabPage();
}
BLL新锐房地产销售系统.MarketManagement.frmMarketManagement_SubscribeToSign.frmMarketManagement_SubscribeToSignClient myfrmMarketManagement_SubscribeToSignClient = new BLL新锐房地产销售系统.MarketManagement.frmMarketManagement_SubscribeToSign.frmMarketManagement_SubscribeToSignClient();
private void frmMarketManagement_SubscribeToSign_Load(object sender, EventArgs e)
{
tvwSubscribeUnit.Nodes.Clear();
dgvProject.DataSource = myfrmMarketManagement_SubscribeToSignClient.SubscribeToSign_Load_BindingdgvProject().Tables[0];
DataTable dtSubscirbe = myfrmMarketManagement_SubscribeToSignClient.Load_SelectAllSubscribeUnitMsg().Tables[0];
dgvSubscribeToSign.DataSource = dtSubscirbe;
}
private void btnSelect_Click(object sender, EventArgs e)
{
dgvProject.Visible = true;
}
private void dgvProject_MouseLeave(object sender, EventArgs e)
{
dgvProject.Visible = false;
}
public int intProjectID = 0;
private void dgvProject_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
{
txtProjectName.Text = dgvProject.CurrentRow.Cells["项目名称"].Value.ToString().Trim();
intProjectID = Convert.ToInt32(dgvProject.CurrentRow.Cells["项目ID"].Value);
dgvProject.Visible = false;
DataTable dtFloor = myfrmMarketManagement_SubscribeToSignClient.dgvProject_CellDoubleClick_BindtvwFloor(intProjectID).Tables[0];
BindtvwFloor_FullProject(dtFloor);
}
void BindtvwFloor_FullProject(DataTable dt)
{
tvwSubscribeUnit.Nodes.Clear();
for (int i = 0; i < dt.Rows.Count; i++)//遍历绑定顶级节点
{
TreeNode tn = new TreeNode();//实例化节点
tn.Text = dt.Rows[i]["FloorName"].ToString();//指定节点文本
tn.Tag = dt.Rows[i]["FloorID"];//绑定节点数据
tvwSubscribeUnit.Nodes.Add(tn);//将节点添加到树控件
}
}
private void tsbtnInsert_Click(object sender, EventArgs e)
{
if (intProjectID == 0)
{
MessageBox.Show("请选择一个项目后继续!!!");
return;
}
frmMarketManagement_SubscribeToSign_InsertSubcribe myfrmMarketManagement_SubscribeToSign_InsertSubcribe = new frmMarketManagement_SubscribeToSign_InsertSubcribe(this);
myfrmMarketManagement_SubscribeToSign_InsertSubcribe.ShowDialog();
}
private void tvwSubscribeUnit_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
dgvSubscribeToSign.DataSource = myfrmMarketManagement_SubscribeToSignClient.tvwSubscribeUnit_NodeMouseClick_SelectMsg(Convert.ToInt32(e.Node.Tag)).Tables[0];
}
private void tsbtnExchangeRoom_Click(object sender, EventArgs e)
{
}
private void tsbtnUpdate_Click(object sender, EventArgs e)
{
if (intSubscribeUnitID == 0)
{
MessageBox.Show("请选择一条认购信息后继续!!!");
return;
}
if (dgvSubscribeToSign.CurrentRow.Cells["审核否"].Value.ToString() == "已审核")
{
MessageBox.Show("你选择的数据已经审核,如需变更审核请点击‘变更申请’!!!","提示");
return;
}
frmMarketManagement_SubscribeToSign_InsertSubcribe myfrmMarketManagement_SubscribeToSign_InsertSubcribe = new frmMarketManagement_SubscribeToSign_InsertSubcribe(this, intSubscribeUnitID);
myfrmMarketManagement_SubscribeToSign_InsertSubcribe.ShowDialog();
}
public int intSubscribeUnitID = 0;
public int intClientID = 0;
public string strClientName = "";
public int intRoomResourceID = 0;
public string strClinchADealThePrice = "";
private void dgvSubscribeToSign_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
if (dgvSubscribeToSign.CurrentRow!= null )
{
intSubscribeUnitID = (int)dgvSubscribeToSign.CurrentRow.Cells["单元认购ID"].Value;
intClientID = (int)dgvSubscribeToSign.CurrentRow.Cells["客户ID"].Value;
strClientName = dgvSubscribeToSign.CurrentRow.Cells["客户姓名"].Value.ToString().Trim();
intRoomResourceID = (int)dgvSubscribeToSign.CurrentRow.Cells["房间资源ID"].Value;
strClinchADealThePrice = dgvSubscribeToSign.CurrentRow.Cells["成交总价"].Value.ToString().Trim();
}
}
private void tsbtnAudit_Click(object sender, EventArgs e)
{
int intSelectNumber = 0;
int intAuditNumber = 0;
int intAuditedNumber = 0;
dgvSubscribeToSign.EndEdit();
foreach (DataGridViewRow dgvr in dgvSubscribeToSign.Rows)
{
if (Convert.ToBoolean(dgvr.Cells["选择"].FormattedValue))
{
intSelectNumber++;
string strAuditWeather = dgvr.Cells["审核否"].Value.ToString().Trim();
if (strAuditWeather == "未审核")
{
int intSubscribeUnitID = (int)dgvr.Cells["单元认购ID"].Value;
myfrmMarketManagement_SubscribeToSignClient.tsbtnAudit_Click_Update(intSubscribeUnitID);
intAuditNumber++;
}
else
{
intAuditedNumber++;
}
}
}
MessageBox.Show("已选择" + intSelectNumber + "条数据,\n" + "已审核" + intAuditNumber + "条数据,\n" + intAuditedNumber + "条数据不需要重新审核!", "提示");
if (tvwSubscribeUnit.Nodes.Count > 0 && tvwSubscribeUnit.SelectedNode != null)
{
tvwSubscribeUnit_NodeMouseClick(null, null);
}
else
{
frmMarketManagement_SubscribeToSign_Load(null,null);
}
}
private void tsbtnApplyOfChange_Click(object sender, EventArgs e)
{
frmMarketManagement_SubscribeToSign_ApplyOfChange myfrmMarketManagement_SubscribeToSign_ApplyOfChange = new frmMarketManagement_SubscribeToSign_ApplyOfChange(this);
myfrmMarketManagement_SubscribeToSign_ApplyOfChange.Show();
}
private void tsbtnRefresh_Click(object sender, EventArgs e)
{
Refresh();
}
public void Refresh()
{
frmMarketManagement_SubscribeToSign_Load(null, null);
}
}
2.添加认购单元
从界面上可以看到我们这里用到的控件有
控件名称 | 说明 |
标注(Label) | 控件可以在工具箱直接拖动至窗体,拖至窗体后右击属性可以修改控件的样式和各种属性,还可以编辑事件。 |
下拉框(ComboBox) | |
文本(TextBox) | |
按钮(Button) | |
日期控件(DateTimePicker) | |
分组容器(GroupBox) | |
图片列表(ImageList) | |
表格(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_FloorInformation)
Primary Key(主键): FloorID
非主键ID值均是外键
(这里因为在这个表里边没有设置有默认值,所以没有默认值的那一列)
列名 | 数据类型 | Nulls? | 说明 |
FloorID | int - Identity | No | 楼栋ID
|
ProjectID | int | Yes | 项目信息表,项目ID
|
FloorStructureID | int | Yes | 属性明细表,楼栋结构ID
|
OpenBatchID | int | Yes | 属性明细表,开盘批次ID
|
LaunchSituationID | int | Yes | 属性明细表,推出情况ID
|
OpeningSituationID | int | Yes | 属性明细表,开盘情况ID
|
FloorLevelID | int | Yes | 楼栋级别ID
|
SortNumber | nchar (10) | Yes | 序号
|
FloorName | nchar (20) | Yes | 楼栋名称
|
PropertyRightFloorName | nchar (20) | Yes | 产权楼栋名称
|
FloorStorey | nchar (10) | Yes | 楼栋层数
|
LaunchDate | datetime | Yes | 推出日期
|
DoMortgageDate | datetime | Yes | 具备办按揭日期
|
CapsDate | datetime | Yes | 封顶日期
|
AccumulationFundDate | datetime | Yes | 具备办公积金日期
|
ExpectedPayDate | datetime | Yes | 预计交房日期
|
PropertyRightDate | datetime | Yes | 具备办产权日期
|
MakingRoomDate | datetime | Yes | 交房日期 |
表3: 项目信息表(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 | 有效否
|
表4: 房源保留表(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 | 作废否
|
表5: 客户信息 (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 | 作废否
|
表6: 预定表 (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 | 作废否
|
表7: 预留表 (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 | 作废否
|
表8: 认购表 (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
|
表9: 认筹表 (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
|
表10: 员工表 (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 | 员工照片
|
表11: 属性明细表(dbo.SYS_AttributeDetails)
Primary Key(主键): AttributeDetailsID
列名 | 数据类型 | 默认值 | Nulls? | 说明 |
AttributeDetailsID | int - Identity |
| No | 属性明细ID
|
AuttributeSetID | int |
| Yes | 属性集合表,属性集合ID
|
AuttributeDetailsName | nchar (10) |
| Yes | 属性明细名称
|
EffectiveWhether | bit | ((1)) | Yes | 有效否
|
表12: 折扣优惠表 (dbo. SYS_DiscountOfPreferential)
Primary Key(主键): DiscountID
非主键ID值均是外键
列名 | 数据类型 | 默认值 | Nulls? |
DiscountID | int - Identity |
| No |
ProjectID | int |
| Yes |
BuildingNumberIDGather | nvarchar (4000) |
| Yes |
UnitNumberIDGather | nvarchar (4000) |
| Yes |
DiscountName | nchar (50) |
| Yes |
SerialNumber | nchar (20) |
| Yes |
EffectiveDate | datetime |
| Yes |
ExpiryDate | datetime |
| Yes |
PreferentialTyoeID | int |
| Yes |
CaluculationID | int |
| Yes |
CaluculationTypeID | int |
| Yes |
Discount | decimal (18, 2) |
| Yes |
DiscountSum | decimal (18, 2) |
| Yes |
ASingleSetOfHighestDiscountAmount | decimal (18, 2) |
| Yes |
TotalDiscount | decimal (18, 2) |
| Yes |
UsingRangeID | int |
| Yes |
Privilege | nchar (100) |
| Yes |
WhetherenableManagerPermissions | bit |
| No |
CancelWhether | bit | ((0)) | Yes |
表13: 折扣优惠明细表 (dbo. SYS_DiscountOfPreferentialDetail)
Primary Key(主键): DiscountOfPreferentialDetailID
非主键ID值均是外键
列名 | 数据类型 | 默认值 | Nulls? |
DiscountOfPreferentialDetailID | int - Identity |
| No |
DiscountID | int |
| Yes |
FloorID | int |
| Yes |
RoomResourceID | int |
| Yes |
RecordDate | datetime |
| Yes |
IncalidOr | bit | ((0)) | Yes |
2、具体的代码实现
第一步:数据库的存储过程
if @Type='InsertSubcribe_Load_BindingdgvCustomer'----查询客户
begin
SELECT ClientID, RTRIM(ClientName) AS ClientName, RTRIM(RelationPhone) AS RelationPhone, Gender AS 性别,
CommunicationAddress, ClientNumber, IDentityCard, Postcode,
HomeBuyerConsultantID
FROM PW_ClientInformation
where PW_ClientInformation.IncalidOr=0 and PW_ClientInformation.ProjectID=@ProjectID
end
if @Type='InsertSubcribe_Load_BindingcboFloorNumber'--查询楼栋信息
begin
SELECT FloorID, rtrim(FloorName) as FloorName
FROM SYS_FloorInformation
where SYS_FloorInformation.ProjectID=@ProjectID
end
if @Type='InsertSubcribe_Load_BindingcboUnitNumber'--查询房源信息
begin
SELECT RoomResourcesID, RTRIM(Number) AS Number, SalesStatusID
FROM SYS_RoomResources
where SYS_RoomResources.FloorID=@FloorID and SYS_RoomResources.SalesStatusID=102 or SYS_RoomResources.SalesStatusID=100 or SYS_RoomResources.SalesStatusID=99 or SYS_RoomResources.SalesStatusID=98
end
if @Type='InsertSubcribe_Load_BindingcboUnitNumber_WhthUpdate'--查询将要修改的信息
begin
SELECT RoomResourcesID, RTRIM(Number) AS Number, SalesStatusID
FROM SYS_RoomResources
where SYS_RoomResources.FloorID=@FloorID and SYS_RoomResources.SalesStatusID=102
end
if @Type='SubscribeToSign_UpdateSubcribe_Load_BindingcboUnitNumber'--查询某一楼栋里边的所有房源信息
begin
SELECT RoomResourcesID, rtrim(Number) as Number
FROM SYS_RoomResources
where SYS_RoomResources.FloorID=@FloorID
end
if @Type='InsertSubcribe_Load_BindingcboPaymentWay'--查询付款方式
begin
SELECT PayTypeID, rtrim(PayTypementName) as PayTypementName
FROM SYS_TypeOfPayment
end
if @Type='InsertSubcribe_Load_BindingcboPaymentDetailsOfName'--查询付款方式明细名称
begin
SELECT AttributeDetailsID, rtrim(AuttributeDetailsName) as AuttributeDetailsName
FROM SYS_AttributeDetails
where SYS_AttributeDetails.AuttributeSetID=31
end
if @Type='InsertSubcribe_Load_BindingcboDiscount'--查询折扣
begin
SELECT DiscountDetailID, rtrim(Discount) as Discount
FROM SYS_DiscountDetail
end
if @Type='InsertSubcribe_Load_BindingcboHomeBuyersConsultant'--查询置业顾问
begin
SELECT StaffID, rtrim(StaffName) as StaffName
FROM SYS_Staff
end
if @Type='cboUnitNumber_SelectionChangeCommitted'--查询某一房源的详细的信息
begin
SELECT rtrim(SYS_RoomResources.ConstructionArea) as ConstructionArea, rtrim(SYS_RoomResources.PricateArea) as PricateArea, rtrim(SYS_RoomResources.PublicArea) as PublicArea, rtrim(SYS_RoomResources.TheUnitPrice) as TheUnitPrice, rtrim(SYS_RoomResources.BidPrice) as BidPrice,
PW_ReserveUnit.BookingDate, PW_ReserveUnit.ValidDate, rtrim(PW_ReserveUnit.PresalseArea) as PresalseArea, rtrim(PW_ReserveUnit.ReservationPrice) as ReservationPrice, rtrim(PW_ReserveUnit.BookingReservationPrice) as BookingReservationPrice,
rtrim(SYS_RoomResources.NumberOfPrice) as NumberOfPrice, SYS_RoomResources.SalesStatusID
FROM SYS_RoomResources LEFT OUTER JOIN
PW_ReserveUnit ON SYS_RoomResources.RoomResourcesID = PW_ReserveUnit.UnitNumberID
where SYS_RoomResources.RoomResourcesID=@RoomResourcesID
end
if @Type='cboUnitNumber_SelectionChangeCommitted_SelectPreferential'--查询优惠明细
begin
SELECT SYS_DiscountOfPreferentialDetail.DiscountID, SYS_DiscountOfPreferentialDetail.FloorID,
rtrim(SYS_DiscountOfPreferential.DiscountName) as DiscountName, rtrim(SYS_AttributeDetails.AuttributeDetailsName) AS PreferentialType,
rtrim(SYS_AttributeDetails_1.AuttributeDetailsName) AS Caluculation, rtrim(SYS_AttributeDetails_2.AuttributeDetailsName) AS CaluculationType, rtrim(SYS_DiscountOfPreferential.Discount) as Discount,
rtrim(SYS_DiscountOfPreferential.DiscountSum) as DiscountSum, rtrim(SYS_DiscountOfPreferential.Privilege) as Privilege, SYS_DiscountOfPreferentialDetail.RoomResourceID
FROM SYS_AttributeDetails AS SYS_AttributeDetails_1 INNER JOIN
SYS_AttributeDetails INNER JOIN
SYS_DiscountOfPreferential ON SYS_AttributeDetails.AttributeDetailsID = SYS_DiscountOfPreferential.PreferentialTyoeID ON
SYS_AttributeDetails_1.AttributeDetailsID = SYS_DiscountOfPreferential.CaluculationID INNER JOIN
SYS_AttributeDetails AS SYS_AttributeDetails_2 ON SYS_DiscountOfPreferential.CaluculationTypeID = SYS_AttributeDetails_2.AttributeDetailsID LEFT OUTER JOIN
SYS_DiscountOfPreferentialDetail ON SYS_DiscountOfPreferential.DiscountID = SYS_DiscountOfPreferentialDetail.DiscountID
where SYS_DiscountOfPreferentialDetail.RoomResourceID = @RoomResourceID
group by SYS_DiscountOfPreferentialDetail.DiscountID, SYS_DiscountOfPreferentialDetail.FloorID,
SYS_DiscountOfPreferential.DiscountName, SYS_AttributeDetails.AuttributeDetailsName ,
SYS_AttributeDetails_1.AuttributeDetailsName , SYS_AttributeDetails_2.AuttributeDetailsName , SYS_DiscountOfPreferential.Discount,
SYS_DiscountOfPreferential.DiscountSum, SYS_DiscountOfPreferential.Privilege, SYS_DiscountOfPreferentialDetail.RoomResourceID
end
if @Type='btnSaveAndInsert_Click_Insert'--新增认购
begin
begin tran
INSERT INTO PW_SubscribeUnit
(RoomResourcesID, SalesChangeID, SubscriptioNumber, SubscribeToDate, AnticipatedDateSigned, ContractArea, TypeOfPanymentID, PaymentDetailsOfNameID, SalesAreaOfWayID,
FsvorableDiscount, ClinchADealUnitPrice, ClinchADealThePrice, ClientID, AgentID, BriefNote)
VALUES (@RoomResourcesID, @SalesChangeID, @SubscriptioNumber, @SubscribeToDate, @AnticipatedDateSigned, @ContractArea, @TypeOfPanymentID, @PaymentDetailsOfNameID, @SalesAreaOfWayID,
@FsvorableDiscount, @ClinchADealUnitPrice, @ClinchADealThePrice, @ClientID, @AgentID, @BriefNote)
select @@IDENTITY
commit tran
end
if @Type='btnSaveAndInsert_Click_UpdateRoomStatus'--修改房源的销售状态
begin
UPDATE SYS_RoomResources
SET SalesStatusID =97
where SYS_RoomResources.RoomResourcesID=@RoomResourcesID
end
if @Type='btnSaveAndInsert_Click_UpdateEverydayMaximumSubscribeNumber'--修改当日最大认购数
begin
UPDATE EverydayMaximumNumber
SET Subscribe = Subscribe + 1
end
if @Type='SelectSubscribeMaximunNumber'--查询最大认购数
begin
SELECT rtrim(Subscribe) as Subscribe
FROM EverydayMaximumNumber
end
if @Type='SubscribeToSign_UpdateSubcribe_Load'--修改认购
begin
SELECT PW_ClientInformation.ClientID, rtrim(PW_ClientInformation.ClientName) as ClientName, rtrim(PW_ClientInformation.RelationPhone) as RelationPhone, rtrim(PW_ClientInformation.ClientNumber) as ClientNumber, rtrim(PW_ClientInformation.IDentityCard) as IDentityCard,
rtrim(PW_ClientInformation.CommunicationAddress) as CommunicationAddress, rtrim(PW_ClientInformation.Postcode) as Postcode, SYS_Staff.StaffID AS HomeBuyerConsultantID, rtrim(SYS_Staff.StaffName) AS HomeBuyerConsultantName,
SYS_Staff_1.StaffID AS AgentID, rtrim(SYS_Staff_1.StaffName) AS AgentName, SYS_FloorInformation.FloorID, SYS_RoomResources.RoomResourcesID, rtrim(SYS_RoomResources.ConstructionArea) as ConstructionArea,
rtrim(SYS_RoomResources.PricateArea) as PricateArea,rtrim(SYS_RoomResources.PublicArea) as PublicArea, rtrim(SYS_RoomResources.TheUnitPrice) as TheUnitPrice, rtrim(SYS_RoomResources.BidPrice) as BidPrice, rtrim(SYS_RoomResources.NumberOfPrice) as NumberOfPrice,
PW_SubscribeUnit.SubscribeUnitID, rtrim(PW_SubscribeUnit.SubscriptioNumber) as SubscriptioNumber, rtrim(PW_SubscribeUnit.SubscribeToDate) as SubscribeToDate, rtrim(PW_SubscribeUnit.AnticipatedDateSigned) as AnticipatedDateSigned, rtrim(PW_SubscribeUnit.ContractArea) as ContractArea,
PW_SubscribeUnit.TypeOfPanymentID, PW_SubscribeUnit.PaymentDetailsOfNameID, PW_SubscribeUnit.SalesAreaOfWayID, rtrim(PW_SubscribeUnit.FsvorableDiscount) as FsvorableDiscount,
rtrim(PW_SubscribeUnit.ClinchADealUnitPrice) as ClinchADealUnitPrice, rtrim(PW_SubscribeUnit.ClinchADealThePrice) as ClinchADealThePrice, rtrim(PW_SubscribeUnit.BriefNote) as BriefNote, SYS_RoomResources.SalesStatusID
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 INNER JOIN
SYS_Staff AS SYS_Staff_1 ON PW_SubscribeUnit.AgentID = SYS_Staff_1.StaffID INNER JOIN
SYS_Staff ON PW_ClientInformation.HomeBuyerConsultantID = SYS_Staff.StaffID
where PW_SubscribeUnit.SubscribeUnitID=@SubscribeUnitID
end
if @Type='btnSaveAndUpdate_Click_Update'--修改认购房源
begin
UPDATE PW_SubscribeUnit
SET CancelWhether = 1, AfterUpdateID = @AfterUpdateID
where PW_SubscribeUnit.SubscribeUnitID=@SubscribeUnitID
end
if @Type='btnSaveAndInsert_Click_UpdateOldRoomStatus'--修改旧的房源的销售状态
begin
UPDATE SYS_RoomResources
SET SalesStatusID = 102
where SYS_RoomResources.RoomResourcesID=@RoomResourcesID
end
if @Type='btnSaveAndInsert_Click_UpdateReserve'--修改预定房源的销售状态
begin
UPDATE PW_ReserveUnit
SET IncalidOr = 1
where PW_ReserveUnit.ReserveUnitID=@RoomResourcesID and PW_ReserveUnit.IncalidOr=0
end
if @Type='btnSaveAndInsert_Click_UpdateSeserve'--修改预留房源的销售状态
begin
UPDATE PW_SeserveUnit
SET IncalidOr = 1
where PW_SeserveUnit.UnitNumberID=@RoomResourcesID and PW_SeserveUnit.IncalidOr=0
end
if @Type='btnSaveAndInsert_Click_UpdateKeep'--修改保留房源的销售状态
begin
UPDATE PW_RoomSelect_Keep
SET IncalidOr = 1
where PW_RoomSelect_Keep.RoomResourcesID=@RoomResourcesID and PW_RoomSelect_Keep.IncalidOr=0
end
if @Type='InsertSubcribe_Load_BindingdgvSalesOfServiceFloowDetail'--查询销售服务流程明细
begin
SELECT rtrim(PW_SalesOfServiceFloowDetail.BriefNote) as BriefNote, PW_SalesOfServiceFloowDetail.RoomResourceID, rtrim(PW_SalesOfServiceFloowDetail.OperatingType) as OperatingType, rtrim(PW_SalesOfServiceFloowDetail.OperatingTime) as OperatingTime,
rtrim(SYS_Staff.StaffName) as StaffName, rtrim(PW_SalesOfServiceFloowDetail.OperatingPeople) as OperatingPeople, SYS_AttributeDetails.AuttributeDetailsName AS OperatingType
FROM PW_SalesOfServiceFloowDetail INNER JOIN
SYS_Staff ON PW_SalesOfServiceFloowDetail.OperatingPeople = SYS_Staff.StaffID INNER JOIN
SYS_AttributeDetails ON PW_SalesOfServiceFloowDetail.OperatingType = SYS_AttributeDetails.AttributeDetailsID
where PW_SalesOfServiceFloowDetail.RoomResourceID=@RoomResourceID
end
if @Type='cboUnitNumber_SelectionChangeCommitted_SelectClientID'--不定条件查询相关的房源信息
begin
declare @Condition nvarchar(1000)=' where 1=1 '
if @Status='预定'
set @Condition += ' and ClientID in (SELECT ClientID FROM PW_ReserveUnit where PW_ReserveUnit.IncalidOr=0 and PW_ReserveUnit.UnitNumberID = '+ @StrRoomResourceID +')'
if @Status='保留'
set @Condition += ' and ClientID in (SELECT KeepPeople FROM PW_RoomSelect_Keep where PW_RoomSelect_Keep.IncalidOr=0 and PW_RoomSelect_Keep.RoomResourcesID = '+ @StrRoomResourceID +')'
if @Status='预留'
set @Condition += ' and ClientID in (SELECT ClientID FROM PW_SeserveUnit where PW_SeserveUnit.IncalidOr=0 and PW_SeserveUnit.UnitNumberID ='+ @StrRoomResourceID +')'
exec (
'SELECT ClientID, ClientName
FROM PW_ClientInformation ' + @Condition)
return
end
if @Type='SelectClientMsg_OnCondition'--查询某一客户的详细信息
begin
SELECT ClientID, RTRIM(ClientName) AS ClientName, RTRIM(RelationPhone) AS RelationPhone, Gender AS 性别,
RTRIM(CommunicationAddress) AS CommunicationAddress, RTRIM(ClientNumber) AS ClientNumber, RTRIM(IDentityCard) AS IDentityCard, RTRIM(Postcode) AS Postcode,
HomeBuyerConsultantID
FROM PW_ClientInformation
where ClientID=@ClientID
end
第二步:逻辑层(BLL)相关代码
[ServiceContract]
public class frmMarketManagement_SubscribeToSign_InsertSubcribe
{
DALPublic.DALPublic myDALPublic = new DALPublic.DALPublic();
[OperationContract]
#region 绑定dgv客户
public DataSet InsertSubcribe_Load_BindingdgvCustomer(int intProjectID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@ProjectID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "InsertSubcribe_Load_BindingdgvCustomer";
SQLCMDpas[1].Value = intProjectID;
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 条件绑定cbo楼栋
public DataSet InsertSubcribe_Load_BindingcboFloorNumber(int intProjectID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@ProjectID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "InsertSubcribe_Load_BindingcboFloorNumber";
SQLCMDpas[1].Value = intProjectID;
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 条件绑定cbo单元
public DataSet InsertSubcribe_Load_BindingcboUnitNumber(int intFloorID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@FloorID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "InsertSubcribe_Load_BindingcboUnitNumber";
SQLCMDpas[1].Value = intFloorID;
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 修改时候条件绑定cbo单元
public DataSet InsertSubcribe_Load_BindingcboUnitNumber_WhthUpdate(int intFloorID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@FloorID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "InsertSubcribe_Load_BindingcboUnitNumber_WhthUpdate";
SQLCMDpas[1].Value = intFloorID;
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 条件绑定cbo置业顾问
public DataSet InsertSubcribe_Load_BindingcboHomeBuyersConsultant()
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
};
SQLCMDpas[0].Value = "InsertSubcribe_Load_BindingcboHomeBuyersConsultant";
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 条件绑定cbo折扣
public DataSet InsertSubcribe_Load_BindingcboDiscount()
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
};
SQLCMDpas[0].Value = "InsertSubcribe_Load_BindingcboDiscount";
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 绑定付款方式
public DataSet InsertSubcribe_Load_BindingcboPaymentWay()
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
};
SQLCMDpas[0].Value = "InsertSubcribe_Load_BindingcboPaymentWay";
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 绑定付款方式明细
public DataSet InsertSubcribe_Load_BindingcboPaymentDetailsOfName()
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
};
SQLCMDpas[0].Value = "InsertSubcribe_Load_BindingcboPaymentDetailsOfName";
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 绑定房间信息
public DataSet cboUnitNumber_SelectionChangeCommitted(int intRoomResourcesID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@RoomResourcesID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "cboUnitNumber_SelectionChangeCommitted";
SQLCMDpas[1].Value = intRoomResourcesID;
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 绑定优惠折扣列表
public DataSet cboUnitNumber_SelectionChangeCommitted_SelectPreferential(int intRoomResourcesID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@RoomResourceID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "cboUnitNumber_SelectionChangeCommitted_SelectPreferential";
SQLCMDpas[1].Value = intRoomResourcesID;
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 某一楼栋的全部房间
public DataSet SubscribeToSign_UpdateSubcribe_Load_BindingcboUnitNumber(int intFloorID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@FloorID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "SubscribeToSign_UpdateSubcribe_Load_BindingcboUnitNumber";
SQLCMDpas[1].Value = intFloorID;
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 添加认购
public DataSet btnSaveAndInsert_Click_Insert(int intRoomResourcesID, int intSalesChangeID, string strSubscriptioNumber, DateTime dtmSubscribeToDate,
DateTime dtmAnticipatedDateSigned, string strContractArea, int intTypeOfPanymentID, int intPaymentDetailsOfNameID, int intSalesAreaOfWayID,
decimal decFsvorableDiscount, decimal decClinchADealUnitPrice,decimal decClinchADealThePrice, int intClientID, int intAgentID, string strBriefNote)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@RoomResourcesID", SqlDbType.Int),
new SqlParameter("@SalesChangeID", SqlDbType.Int),
new SqlParameter("@SubscriptioNumber", SqlDbType.Char),
new SqlParameter("@SubscribeToDate", SqlDbType.DateTime),
new SqlParameter("@AnticipatedDateSigned", SqlDbType.DateTime),
new SqlParameter("@ContractArea", SqlDbType.Char),
new SqlParameter("@TypeOfPanymentID", SqlDbType.Int),
new SqlParameter("@PaymentDetailsOfNameID", SqlDbType.Int),
new SqlParameter("@SalesAreaOfWayID", SqlDbType.Int),
new SqlParameter("@FsvorableDiscount", SqlDbType.Decimal),
new SqlParameter("@ClinchADealUnitPrice", SqlDbType.Decimal),
new SqlParameter("@ClinchADealThePrice", SqlDbType.Decimal),
new SqlParameter("@ClientID", SqlDbType.Int),
new SqlParameter("@AgentID", SqlDbType.Int),
new SqlParameter("@BriefNote", SqlDbType.Char),
};
SQLCMDpas[0].Value = "btnSaveAndInsert_Click_Insert";
SQLCMDpas[1].Value = intRoomResourcesID;
SQLCMDpas[2].Value = intSalesChangeID;
SQLCMDpas[3].Value = strSubscriptioNumber;
SQLCMDpas[4].Value = dtmSubscribeToDate;
SQLCMDpas[5].Value = dtmAnticipatedDateSigned;
SQLCMDpas[6].Value = strContractArea;
SQLCMDpas[7].Value = intTypeOfPanymentID;
SQLCMDpas[8].Value = intPaymentDetailsOfNameID;
SQLCMDpas[9].Value = intSalesAreaOfWayID;
SQLCMDpas[10].Value = decFsvorableDiscount;
SQLCMDpas[11].Value = decClinchADealUnitPrice;
SQLCMDpas[12].Value = decClinchADealThePrice;
SQLCMDpas[13].Value = intClientID;
SQLCMDpas[14].Value = intAgentID;
SQLCMDpas[15].Value = strBriefNote;
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 修改房间状态
public int btnSaveAndInsert_Click_UpdateRoomStatus(int intRoomResourcesID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@RoomResourcesID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "btnSaveAndInsert_Click_UpdateRoomStatus";
SQLCMDpas[1].Value = intRoomResourcesID;
return myDALPublic.DAL_OPTableDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
}
#endregion
[OperationContract]
#region 查询当日最大认购数
public DataSet SelectSubscribeMaximunNumber()
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
};
SQLCMDpas[0].Value = "SelectSubscribeMaximunNumber";
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 修改时Load事件里要查询的东西
public DataSet SubscribeToSign_UpdateSubcribe_Load(int intSubscribeUnitID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@SubscribeUnitID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "SubscribeToSign_UpdateSubcribe_Load";
SQLCMDpas[1].Value = intSubscribeUnitID;
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 修改原来预购信息
public int btnSaveAndUpdate_Click_Update(int intAfterUpdateID, int intSubscribeUnitID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@AfterUpdateID", SqlDbType.Int),
new SqlParameter("@SubscribeUnitID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "btnSaveAndUpdate_Click_Update"; ;
SQLCMDpas[1].Value = intAfterUpdateID;
SQLCMDpas[2].Value = intSubscribeUnitID;
return myDALPublic.DAL_OPTableDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
}
#endregion
[OperationContract]
#region 当修改后的房间不是原来的房间了,就修改原来的房间状态
public int btnSaveAndInsert_Click_UpdateOldRoomStatus(int intRoomResourcesID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@RoomResourcesID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "btnSaveAndInsert_Click_UpdateOldRoomStatus";
SQLCMDpas[1].Value = intRoomResourcesID;
return myDALPublic.DAL_OPTableDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
}
#endregion
[OperationContract]
#region 修改原预定数据的有效否
public int btnSaveAndInsert_Click_UpdateReserve(int intRoomResourcesID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@RoomResourcesID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "btnSaveAndInsert_Click_UpdateReserve";
SQLCMDpas[1].Value = intRoomResourcesID;
return myDALPublic.DAL_OPTableDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
}
#endregion
[OperationContract]
#region 修改原预留数据的有效否
public int btnSaveAndInsert_Click_UpdateSeserve(int intRoomResourcesID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@RoomResourcesID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "btnSaveAndInsert_Click_UpdateSeserve";
SQLCMDpas[1].Value = intRoomResourcesID;
return myDALPublic.DAL_OPTableDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
}
#endregion
[OperationContract]
#region 修改原保留数据的有效否
public int btnSaveAndInsert_Click_UpdateKeep(int intRoomResourcesID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@RoomResourcesID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "btnSaveAndInsert_Click_UpdateKeep";
SQLCMDpas[1].Value = intRoomResourcesID;
return myDALPublic.DAL_OPTableDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
}
#endregion
[OperationContract]
#region 绑定销售关键流程明细
public DataSet InsertSubcribe_Load_BindingdgvSalesOfServiceFloowDetail(int intRoomResourcesID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@RoomResourceID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "InsertSubcribe_Load_BindingdgvSalesOfServiceFloowDetail";
SQLCMDpas[1].Value = intRoomResourcesID;
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 递增当天的认购数
public int btnSaveAndInsert_Click_UpdateEverydayMaximumSubscribeNumber()
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
};
SQLCMDpas[0].Value = "btnSaveAndInsert_Click_UpdateEverydayMaximumSubscribeNumber";
return myDALPublic.DAL_OPTableDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
}
#endregion
[OperationContract]
#region 当某一房源有过预留、预定、保留之类的交易的时候,根据房源ID查询客户ID
public DataSet cboUnitNumber_SelectionChangeCommitted_SelectClientID(string strStatus, string StrRoomResourceID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@Status", SqlDbType.NVarChar),
new SqlParameter("@StrRoomResourceID", SqlDbType.NVarChar),
};
SQLCMDpas[0].Value = "cboUnitNumber_SelectionChangeCommitted_SelectClientID";
SQLCMDpas[1].Value = strStatus;
SQLCMDpas[2].Value = StrRoomResourceID;
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
[OperationContract]
#region 根据客户ID查询客户信息
public DataSet SelectClientMsg_OnCondition(int intClientID)
{
SqlParameter[] SQLCMDpas = {
new SqlParameter("@Type", SqlDbType.Char),
new SqlParameter("@ClientID", SqlDbType.Int),
};
SQLCMDpas[0].Value = "SelectClientMsg_OnCondition";
SQLCMDpas[1].Value = intClientID;
DataTable myDataTable = myDALPublic.DAL_SelectDB_Par("frmMarketManagement_SubscribeToSign_InsertSubcribe", SQLCMDpas);
DataSet myDataSet = new DataSet();
myDataSet.Tables.Add(myDataTable);
return myDataSet;
}
#endregion
}
第三步:界面层(UIL)相关代码及说明
public partial class frmMarketManagement_SubscribeToSign_InsertSubcribe : Form
{
frmMarketManagement_SubscribeToSign Frm;
public frmMarketManagement_SubscribeToSign_InsertSubcribe(frmMarketManagement_SubscribeToSign frm)
{
Frm = frm;
InitializeComponent();
}
int intSubscribeUnit = 0;
public frmMarketManagement_SubscribeToSign_InsertSubcribe(frmMarketManagement_SubscribeToSign frm, int intSubscribeUnitID)
{
intSubscribeUnit = intSubscribeUnitID;
Frm = frm;
InitializeComponent();
}
frmMarketManagement_HousingQuery FrmHousingQuery;//声明房源查询窗体,用来装房源查询传过来的值
int intprojectID = 0;
/// <summary>
///
/// </summary>
/// <param name="frm">传过来的窗体</param>
/// <param name="intProjectID">传过来的项目ID</param>
public frmMarketManagement_SubscribeToSign_InsertSubcribe(frmMarketManagement_HousingQuery frm,int intProjectID)
{
FrmHousingQuery = frm;//将传过来的值赋给声明的那个全局变量窗体
intprojectID = intProjectID;
InitializeComponent();
}
BLL新锐房地产销售系统.MarketManagement.frmMarketManagement_SubscribeToSign_InsertSubcribe.frmMarketManagement_SubscribeToSign_InsertSubcribeClient myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient = new BLL新锐房地产销售系统.MarketManagement.frmMarketManagement_SubscribeToSign_InsertSubcribe.frmMarketManagement_SubscribeToSign_InsertSubcribeClient();
DataTable dtCustom = new DataTable();
int intProjectID = 0;
int intConditionProjectID = 0;
private void frmMarketManagement_SubscribeToSign_InsertSubcribe_Load(object sender, EventArgs e)
{
btnSaveAndUpdate.Enabled = false;
int intProjectID = 0;
if (intprojectID != 0)
{
intProjectID = intprojectID;
intConditionProjectID = intprojectID;
}
else
{
intProjectID = Frm.intProjectID;
intConditionProjectID = Frm.intProjectID;
}
dtCustom = myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.InsertSubcribe_Load_BindingdgvCustomer(intProjectID).Tables[0];
dgvCustomer.DataSource = dtCustom;
cboFloorNumber.DataSource = myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.InsertSubcribe_Load_BindingcboFloorNumber(intProjectID).Tables[0];
cboFloorNumber.DisplayMember = "FloorName";
cboFloorNumber.ValueMember = "FloorID";
cboHomeBuyersConsultant.DataSource = myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.InsertSubcribe_Load_BindingcboHomeBuyersConsultant().Tables[0];
cboHomeBuyersConsultant.DisplayMember = "StaffName";
cboHomeBuyersConsultant.ValueMember = "StaffID";
cboAgent.DataSource = myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.InsertSubcribe_Load_BindingcboHomeBuyersConsultant().Tables[0];
cboAgent.DisplayMember = "StaffName";
cboAgent.ValueMember = "StaffID";
cboPaymentWay.DataSource = myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.InsertSubcribe_Load_BindingcboPaymentWay().Tables[0];
cboPaymentWay.DisplayMember = "PayTypementName";
cboPaymentWay.ValueMember = "PayTypeID";
cboPaymentDetailsOfName.DataSource = myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.InsertSubcribe_Load_BindingcboPaymentDetailsOfName().Tables[0];
cboPaymentDetailsOfName.DisplayMember = "AuttributeDetailsName";
cboPaymentDetailsOfName.ValueMember = "AttributeDetailsID";
string strSubscribeMaximumNumber = myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.SelectSubscribeMaximunNumber().Tables[0].Rows[0][0].ToString();
switch (strSubscribeMaximumNumber.Length)
{
case 1:
strSubscribeMaximumNumber = "000" + strSubscribeMaximumNumber;
break;
case 2:
strSubscribeMaximumNumber = "00" + strSubscribeMaximumNumber;
break;
case 3:
strSubscribeMaximumNumber = "0" + strSubscribeMaximumNumber;
break;
default:
break;
}
txtSubscriptionNumber.Text = DateTime.Now.Year.ToString() + (DateTime.Now.Month > 10 ? DateTime.Now.Month.ToString() : "0" + DateTime.Now.Month) + (DateTime.Now.Day > 10 ? DateTime.Now.Day.ToString() : "0" + DateTime.Now.Day) + strSubscribeMaximumNumber;
if (intSubscribeUnit != 0)
{
SubscribeToSign_UpdateSubcribe_Load(intSubscribeUnit);
}
if (intprojectID != 0)
{
HousingQuery_To_InsertSubcribe();
}
}
bool bolSwitch = false;
void HousingQuery_To_InsertSubcribe()
{
bolSwitch = true;
cboFloorNumber.Enabled = false;
cboUnitNumber.Enabled = false;
cboFloorNumber.SelectedValue = FrmHousingQuery.intFloorID;
cboUnitNumber.DataSource = myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.InsertSubcribe_Load_BindingcboUnitNumber(FrmHousingQuery.intFloorID).Tables[0];
cboUnitNumber.DisplayMember = "Number";
cboUnitNumber.ValueMember = "RoomResourcesID";
cboUnitNumber.SelectedValue = FrmHousingQuery.intRoomResourceID;
cboUnitNumber_SelectionChangeCommitted(null,null);
}
int intOldSubscribeUnit = 0;
int intOldRoom = 0;
int intOldCustomer = 0;
void SubscribeToSign_UpdateSubcribe_Load(int intSubscribeUnit)
{
DataTable dtSubcribeMsg = myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.SubscribeToSign_UpdateSubcribe_Load(intSubscribeUnit).Tables[0];
txtClientName.Text = dtSubcribeMsg.Rows[0]["ClientName"].ToString().Trim();
txtTelephoneNumber.Text = dtSubcribeMsg.Rows[0]["RelationPhone"].ToString().Trim();
txtClientNumber.Text = dtSubcribeMsg.Rows[0]["ClientNumber"].ToString().Trim();
txtIDNumber.Text = dtSubcribeMsg.Rows[0]["IDentityCard"].ToString().Trim();
txtCorrespondenceAddress.Text = dtSubcribeMsg.Rows[0]["CommunicationAddress"].ToString().Trim();
txtZipCode.Text = dtSubcribeMsg.Rows[0]["Postcode"].ToString().Trim();
cboFloorNumber.SelectedValue = Convert.ToInt32(dtSubcribeMsg.Rows[0]["FloorID"]);
cboUnitNumber.DataSource = myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.SubscribeToSign_UpdateSubcribe_Load_BindingcboUnitNumber((int)cboFloorNumber.SelectedValue).Tables[0];
cboUnitNumber.DisplayMember = "Number";
cboUnitNumber.ValueMember = "RoomResourcesID";
cboUnitNumber.SelectedValue = (int)dtSubcribeMsg.Rows[0]["RoomResourcesID"];
intOldRoom = (int)dtSubcribeMsg.Rows[0]["RoomResourcesID"];
intOldSubscribeUnit = (int)dtSubcribeMsg.Rows[0]["SubscribeUnitID"];
txtBuildingPresaleArea.Text = dtSubcribeMsg.Rows[0]["ConstructionArea"].ToString().Trim();
txtOpenToBookingAPrivateArea.Text = dtSubcribeMsg.Rows[0]["PricateArea"].ToString().Trim();
txtBookingpublicbetaarea.Text = (Convert.ToDecimal(dtSubcribeMsg.Rows[0]["ConstructionArea"]) - Convert.ToDecimal(dtSubcribeMsg.Rows[0]["PricateArea"])).ToString();
txtApprovedconstructionareaof.Text = dtSubcribeMsg.Rows[0]["PricateArea"].ToString().Trim();
txtOpentobookingaTatolPrice.Text = dtSubcribeMsg.Rows[0]["TheUnitPrice"].ToString().Trim();
txtBidPrice.Text = dtSubcribeMsg.Rows[0]["BidPrice"].ToString().Trim();
txtNumberOfPrice.Text = dtSubcribeMsg.Rows[0]["NumberOfPrice"].ToString().Trim();
txtSubscriptionNumber.Text = dtSubcribeMsg.Rows[0]["SubscriptioNumber"].ToString().Trim();
dtpSubscriptionDate.Value = Convert.ToDateTime(dtSubcribeMsg.Rows[0]["SubscribeToDate"]);
dtpAnticipatedDateSigned.Value = Convert.ToDateTime(dtSubcribeMsg.Rows[0]["AnticipatedDateSigned"]);
txtContractArea.Text = dtSubcribeMsg.Rows[0]["ContractArea"].ToString().Trim();
cboPaymentWay.SelectedValue = Convert.ToInt32(dtSubcribeMsg.Rows[0]["TypeOfPanymentID"]);
cboPaymentDetailsOfName.SelectedValue = Convert.ToInt32(dtSubcribeMsg.Rows[0]["PaymentDetailsOfNameID"]);
txtDiscount.Text = dtSubcribeMsg.Rows[0]["FsvorableDiscount"].ToString().Trim();
txtClinchADealUnitPrice.Text = dtSubcribeMsg.Rows[0]["ClinchADealUnitPrice"].ToString().Trim();
txtClinchADealThePrice.Text = dtSubcribeMsg.Rows[0]["ClinchADealThePrice"].ToString().Trim();
cboHomeBuyersConsultant.SelectedValue = Convert.ToInt32(dtSubcribeMsg.Rows[0]["HomeBuyerConsultantID"]);
cboAgent.SelectedValue = Convert.ToInt32(dtSubcribeMsg.Rows[0]["AgentID"]);
txtBriefNote.Text = dtSubcribeMsg.Rows[0]["BriefNote"].ToString().Trim();
intRoomStatus = Convert.ToInt32(dtSubcribeMsg.Rows[0]["PaymentDetailsOfNameID"]);
int intSaleAreaType = Convert.ToInt32(dtSubcribeMsg.Rows[0]["SalesStatusID"]);
intOldCustomer = Convert.ToInt32(dtSubcribeMsg.Rows[0]["ClientID"]);
intCustomID = Convert.ToInt32(dtSubcribeMsg.Rows[0]["ClientID"]);
switch (intSaleAreaType)
{
case 137:
radBuildingArea.Checked = true;
intSalesAreaOfWayID = 137;
break;
case 138:
radUnitArea.Checked = true;
intSalesAreaOfWayID = 138;
break;
case 139:
radUnit.Checked = true;
intSalesAreaOfWayID = 139;
break;
case 140:
radOhterArea.Checked = true;
intSalesAreaOfWayID = 140;
break;
}
cboUnitNumber.Enabled = false;
btnSaveAndInsert.Enabled = false;
btnSaveAndUpdate.Enabled = true;
}
private void btnSelect_Click(object sender, EventArgs e)
{
dtCustom = myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.InsertSubcribe_Load_BindingdgvCustomer(intConditionProjectID).Tables[0];
dgvCustomer.DataSource = dtCustom;
if (txtNameAndPhone.Text != "")
{
string strCondition = "ClientName like '%" + txtNameAndPhone.Text.ToString().Trim() + "%'" + " Or " + " RelationPhone like '%" + txtNameAndPhone.Text.ToString().Trim() + "%'";
DataView dv = new DataView(dtCustom);
dv.RowFilter = strCondition;
DataTable dt = dv.ToTable();
dgvCustomer.DataSource = dt;
}
else
dgvCustomer.DataSource = dtCustom;
dgvCustomer.Visible = true;
}
private void dgvCustomer_MouseLeave(object sender, EventArgs e)
{
dgvCustomer.Visible = false;
}
int intCustomID = 0;
private void dgvCustomer_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
{
intCustomID = (int)dgvCustomer.CurrentRow.Cells["CustomerID"].Value;
txtClientName.Text = dgvCustomer.CurrentRow.Cells["CustomName"].Value.ToString().Trim();
txtTelephoneNumber.Text = dgvCustomer.CurrentRow.Cells["CustomerPhoneNumber"].Value.ToString().Trim();
txtCorrespondenceAddress.Text = dgvCustomer.CurrentRow.Cells["通讯地址"].Value.ToString().Trim();
txtClientNumber.Text = dgvCustomer.CurrentRow.Cells["客户编号"].Value.ToString().Trim();
txtIDNumber.Text = dgvCustomer.CurrentRow.Cells["身份证号"].Value.ToString().Trim();
txtZipCode.Text = dgvCustomer.CurrentRow.Cells["邮政编码"].Value.ToString().Trim();
cboHomeBuyersConsultant.SelectedValue = Convert.ToInt32(dgvCustomer.CurrentRow.Cells["HomeBuyerConsultantID"].Value.ToString().Trim());
dgvCustomer.Visible = false;
}
private void cboFloorNumber_SelectionChangeCommitted(object sender, EventArgs e)
{
cboUnitNumber.Enabled = true;
int intFloorID = (int)cboFloorNumber.SelectedValue;
if (intSubscribeUnit != 0)
{
cboUnitNumber.DataSource = myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.InsertSubcribe_Load_BindingcboUnitNumber_WhthUpdate(intFloorID).Tables[0];
cboUnitNumber.DisplayMember = "Number";
cboUnitNumber.ValueMember = "RoomResourcesID";
}
else
{
cboUnitNumber.DataSource = myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.InsertSubcribe_Load_BindingcboUnitNumber(intFloorID).Tables[0];
cboUnitNumber.DisplayMember = "Number";
cboUnitNumber.ValueMember = "RoomResourcesID";
}
}
int intRoomID = 0;
int intRoomStatus = 0;
private void cboUnitNumber_SelectionChangeCommitted(object sender, EventArgs e)
{
intRoomID=(int)cboUnitNumber.SelectedValue;
DataTable dtRoomResource=myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.cboUnitNumber_SelectionChangeCommitted(intRoomID).Tables[0];
txtBuildingPresaleArea.Text = dtRoomResource.Rows[0]["ConstructionArea"].ToString().Trim();
txtOpenToBookingAPrivateArea.Text = dtRoomResource.Rows[0]["PricateArea"].ToString().Trim();
txtBookingpublicbetaarea.Text = dtRoomResource.Rows[0]["PublicArea"].ToString().Trim();
txtApprovedconstructionareaof.Text = dtRoomResource.Rows[0]["PresalseArea"].ToString().Trim();
txtOpentobookingaTatolPrice.Text = dtRoomResource.Rows[0]["TheUnitPrice"].ToString().Trim();
txtBidPrice.Text = dtRoomResource.Rows[0]["BidPrice"].ToString().Trim();
txtNumberOfPrice.Text = dtRoomResource.Rows[0]["NumberOfPrice"].ToString().Trim();
intRoomStatus = (int)dtRoomResource.Rows[0]["SalesStatusID"];
switch (intRoomStatus)
{
case 98:// 预留
DataTable dtSeserve = myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.cboUnitNumber_SelectionChangeCommitted_SelectClientID("预留", intRoomID.ToString()).Tables[0];
if (dtSeserve.Rows.Count > 0)
{
int intCustomerID = (int)dtSeserve.Rows[0]["ClientID"];
BindingCustomerMsg(intCustomerID);
}
break;
case 99:// 预定
DataTable dtReserve = myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.cboUnitNumber_SelectionChangeCommitted_SelectClientID("预定", intRoomID.ToString()).Tables[0];
if (dtReserve.Rows.Count > 0)
{
int intCustomerID = (int)dtReserve.Rows[0]["ClientID"];
BindingCustomerMsg(intCustomerID);
}
break;
case 100:// 保留
DataTable dtKeep = myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.cboUnitNumber_SelectionChangeCommitted_SelectClientID("保留", intRoomID.ToString()).Tables[0];
if (dtKeep.Rows.Count > 0)
{
int intCustomerID = (int)dtKeep.Rows[0]["ClientID"];
BindingCustomerMsg(intCustomerID);
}
break;
case 102:// 未售
break;
}
DataTable dtPreferential = myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.cboUnitNumber_SelectionChangeCommitted_SelectPreferential(intRoomID).Tables[0];
dgvDiscountList.DataSource = dtPreferential;
}
void BindingCustomerMsg(int intClientID)
{
DataTable dtMsg = myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.SelectClientMsg_OnCondition(intClientID).Tables[0];
intCustomID = (int)dtMsg.Rows[0]["ClientID"];
txtClientName.Text = dtMsg.Rows[0]["ClientName"].ToString().Trim();
txtTelephoneNumber.Text = dtMsg.Rows[0]["RelationPhone"].ToString().Trim();
txtCorrespondenceAddress.Text = dtMsg.Rows[0]["CommunicationAddress"].ToString().Trim();
txtClientNumber.Text = dtMsg.Rows[0]["ClientNumber"].ToString().Trim();
txtIDNumber.Text = dtMsg.Rows[0]["IDentityCard"].ToString().Trim();
txtZipCode.Text = dtMsg.Rows[0]["Postcode"].ToString().Trim();
cboHomeBuyersConsultant.SelectedValue = Convert.ToInt32(dtMsg.Rows[0]["HomeBuyerConsultantID"].ToString().Trim());
}
private void btnSaveAndInsert_Click(object sender, EventArgs e)
{
string strSubscriptioNumber = txtSubscriptionNumber.Text.ToString();
DateTime dtmSubscribeToDate = dtpSubscriptionDate.Value;
DateTime dtmAnticipatedDateSigned = dtpAnticipatedDateSigned.Value;
string strContractArea = txtContractArea.Text.ToString();
int intTypeOfPanymentID = (int)cboPaymentWay.SelectedValue;
int intPaymentDetailsOfNameID = (int)cboPaymentDetailsOfName.SelectedValue;
decimal decFsvorableDiscount = Convert.ToDecimal(txtDiscount.Text);
decimal decClinchADealUnitPrice = 0;
decimal decClinchADealThePrice = 0;
try
{
decClinchADealUnitPrice = Convert.ToDecimal(txtClinchADealUnitPrice.Text);
decClinchADealThePrice = Convert.ToDecimal(txtClinchADealThePrice.Text);
}
catch
{
MessageBox.Show("请完善所有的信息后继续!!!");
return;
}
int intAgentID = (int)cboAgent.SelectedValue;
string strBriefNote = txtBriefNote.Text.ToString();
int intAfterUpdateID = Convert.ToInt32( myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.btnSaveAndInsert_Click_Insert(intRoomID, 0, strSubscriptioNumber, dtmSubscribeToDate,
dtmAnticipatedDateSigned, strContractArea, intTypeOfPanymentID, intPaymentDetailsOfNameID, intSalesAreaOfWayID,
decFsvorableDiscount, decClinchADealUnitPrice, decClinchADealThePrice, intCustomID, intAgentID, strBriefNote).Tables[0].Rows[0][0]);
if (intAfterUpdateID > 0)
{
myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.btnSaveAndInsert_Click_UpdateRoomStatus(intRoomID);
PublicMethod.Pub_UpdateEverydayMaximumSubscribeNumber();
DateTime dtmOperatingTime = DateTime.Now;
string strNote = "";
int intOperatingType = 0;
int intOperatingPerson = 1;
switch (intRoomStatus)
{
case 98:
intOperatingType = 160;
myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.btnSaveAndInsert_Click_UpdateSeserve(intRoomID);
strNote = "预留房间转购";
break;
case 99:
intOperatingType = 159;
strNote = "预定房间转购";
myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.btnSaveAndInsert_Click_UpdateReserve(intRoomID);
break;
case 100:
intOperatingType = 158;
strNote = "保留房间转购";
myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.btnSaveAndInsert_Click_UpdateKeep(intRoomID);
break;
case 102:
intOperatingType = 153;
strNote = "添加认购信息";
break;
}
PublicMethod.Pub_InsertSalesOfServiceFloowDetail(strNote, intRoomID, 0, 0, 0, 0, 0, dtmOperatingTime, intOperatingPerson, intOperatingType);//添加操作记录
PublicMethod.Pub_InsertClientEventRecord(intCustomID, dtmOperatingTime, "已认购房源", "认购房源");
if (bolSwitch == true)
{
FrmHousingQuery.Refresh();
}
MessageBox.Show("添加认购成功!!!");
Frm.Refresh();
this.Close();
}
}
int intSalesAreaOfWayID = 0;
private void radBuildingArea_CheckedChanged(object sender, EventArgs e)
{
intSalesAreaOfWayID = 137;
}
private void radUnitArea_CheckedChanged(object sender, EventArgs e)
{
intSalesAreaOfWayID = 138;
}
private void radUnit_CheckedChanged(object sender, EventArgs e)
{
intSalesAreaOfWayID =139;
}
private void radOhterArea_CheckedChanged(object sender, EventArgs e)
{
intSalesAreaOfWayID = 140;
}
private void pubPrice_KeyPress(object sender, KeyPressEventArgs e)
{
PublicMethod.pubPriceOrRate_KeyPress(sender,e);
}
private void btnSaveAndUpdate_Click(object sender, EventArgs e)
{
string strSubscriptioNumber = txtSubscriptionNumber.Text.ToString();
DateTime dtmSubscribeToDate = dtpSubscriptionDate.Value;
DateTime dtmAnticipatedDateSigned = dtpAnticipatedDateSigned.Value;
string strContractArea = txtContractArea.Text.ToString();
int intTypeOfPanymentID = (int)cboPaymentWay.SelectedValue;
int intPaymentDetailsOfNameID = (int)cboPaymentDetailsOfName.SelectedValue;
decimal decFsvorableDiscount = Convert.ToDecimal(txtDiscount.Text);
decimal decClinchADealUnitPrice = 0;
decimal decClinchADealThePrice = 0;
try
{
decClinchADealUnitPrice = Convert.ToDecimal(txtClinchADealUnitPrice.Text);
decClinchADealThePrice = Convert.ToDecimal(txtClinchADealThePrice.Text);
}
catch
{
MessageBox.Show("请完善所有的信息后继续!!!");
return;
}
int intAgentID = (int)cboAgent.SelectedValue;
string strBriefNote = txtBriefNote.Text.ToString();
int intAfterUpdateID = (int)myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.btnSaveAndInsert_Click_Insert(intRoomID, 0, strSubscriptioNumber, dtmSubscribeToDate,
dtmAnticipatedDateSigned, strContractArea, intTypeOfPanymentID, intPaymentDetailsOfNameID, intSalesAreaOfWayID,
decFsvorableDiscount, decClinchADealUnitPrice, decClinchADealThePrice, intCustomID, intAgentID, strBriefNote).Tables[0].Rows[0][0];
if (intAfterUpdateID > 0)
{
DateTime dtmOperatingTime = DateTime.Now;
myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.btnSaveAndInsert_Click_UpdateRoomStatus(intRoomID);
myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.btnSaveAndUpdate_Click_Update(intAfterUpdateID, intOldSubscribeUnit);
if (intOldCustomer != intCustomID)
{
PublicMethod.Pub_InsertClientEventRecord(intOldCustomer, dtmOperatingTime, "修改认购房源", "更改该房源至其他客户名下");
PublicMethod.Pub_InsertClientEventRecord(intCustomID, dtmOperatingTime, "修改认购房源", "更改该房源至其该客户名下");
}
if (intOldCustomer == intCustomID)
{
PublicMethod.Pub_InsertClientEventRecord(intCustomID, dtmOperatingTime, "修改认购房源", "修改认购房源信息");
}
if (intOldRoom != 0 && intOldRoom != intRoomID)
{
myfrmMarketManagement_SubscribeToSign_InsertSubcribeClient.btnSaveAndInsert_Click_UpdateOldRoomStatus(intOldRoom);
PublicMethod.Pub_InsertSalesOfServiceFloowDetail(" 修改认购--被换购", intRoomID, 0, 0, 0, 0, 0, dtmOperatingTime, 1,154);
}
PublicMethod.Pub_InsertClientEventRecord(intCustomID, dtmOperatingTime, "修改认购房源", "认购房源");
PublicMethod.Pub_InsertSalesOfServiceFloowDetail("修改认购信息", intRoomID, 0, 0, 0, 0, 0, dtmOperatingTime, 1,154);
MessageBox.Show("修改认购成功!!!");
Frm.Refresh();
this.Close();
}
}
private void btnAdd_Click(object sender, EventArgs e)
{
frmMarketManagement_ClientRegistrtion_PubRegistration myfrmMarketManagement_ClientRegistrtion_PubRegistration = new frmMarketManagement_ClientRegistrtion_PubRegistration(this, intConditionProjectID);
myfrmMarketManagement_ClientRegistrtion_PubRegistration.ShowDialog();
}
private void btnSaveAndReturn_Click(object sender, EventArgs e)
{
}
private void btnRenturn_Click(object sender, EventArgs e)
{
this.Close();
}
}
以上内容仅供学习用途,如用于商业用途后果自负!!!!!