wcf|海马汽车经销商管理系统技术解析(五)车辆续保提醒
海马汽车经销商管理系统技术解析(五)车辆续保提醒
车辆续保提醒这个模块会把三天后需要续保的客户及车辆信息显示在车辆续保提醒界面,然后可以对信息进行提醒操作,还有查询、上页、下页操作。
车辆续保提醒主界面如图 (图1)所示:
文章图片
(图1)
车辆续保提醒查询界面如图(图2)所示:
文章图片
(图2)
车辆续保提醒提醒界面如图(图3)所示
文章图片
(图3)
从界面上可以看到我们这里用到的控件有
控件名称 |
说明 |
(ToolStrip) |
控件可以在工具箱直接拖动至窗体,拖至窗体后右击属性可以修改控件的样式和各种属性,还可以编辑事件。 |
表格(DataGridView) |
|
按钮(toolStripButton)/(Button) |
|
复选框(CheckBox) |
|
下拉框(ComBoBox) |
|
文本框(TextBox) |
|
日期控件(DateTimePicker) |
第一步:数据库
1、表和关系
文章图片
表1:车辆信息表(BM_CarNewsList)
用于存放车辆录入的信息
列名 |
数据类型 |
主键/外键 |
说明 |
CarNewsID |
int |
主键 |
车辆信息ID |
CarOwnerNewsID |
int |
外键 |
车主信息ID |
RecordNumber |
nchar (20) |
|
档案号 |
LicensePlateNumber |
nchar (20) |
|
车牌号 |
CarModelsCode |
nchar (20) |
|
车型代码 |
VINCode |
nchar (20) |
|
VIN码 |
MotorModel |
nchar (20) |
|
发动机型号 |
TransmissionType |
nchar (20) |
|
变速箱形式 |
MotorNumber |
nchar (20) |
|
发动机号 |
TransmissionNumber |
nchar (20) |
|
变速箱号码 |
KeyNumber |
nchar (20) |
|
钥匙号 |
ShiftWay |
nchar (20) |
|
换挡方式 |
CarModelsYearFund |
nchar (20) |
|
车型年款 |
Displacement |
nchar (20) |
|
排量 |
EquipmentCode |
nchar (20) |
|
装备代码 |
BodyworkColour |
nchar (10) |
|
车身颜色 |
LeaveFactoryDate |
datetime |
|
出厂日期 |
FuelKind |
nchar (20) |
|
燃料种类 |
BuyCarDate |
datetime |
|
购车日期 |
BuyCarMileage |
decimal (18, 2) |
|
购车里程 |
Purpose |
nchar (20) |
|
用途 |
SellUnit |
nchar (20) |
|
销售单位 |
CarBrand |
nchar (20) |
|
车辆品牌 |
CarModelsSimpleCode |
nchar (20) |
|
车型简码 |
IfInWarranTyperiod |
bit |
|
在保修期内 |
UserManage |
bit |
|
用户管理 |
IfEffective |
bit |
|
有效否 |
用于存放车主录入的信息
列名 |
数据类型 |
主键/外键 |
说明 |
CarOwnerNewsID |
int |
主键 |
车主信息ID |
CarOwnerCode |
nchar (20) |
|
车主代码 |
CarOwnerName |
nchar (20) |
|
车主姓名 |
AttributeMinuteID_ClientTypeOne |
int |
外键 |
属性明细ID_客户类型一 |
AttributeMinuteID_ClientTypeTwo |
int |
外键 |
属性明细ID_客户类型二 |
AttributeMinuteID_Sex |
int |
外键 |
属性明细ID_性别 |
Site |
nchar (100) |
|
地址 |
MobilePhone |
nchar (20) |
|
移动电话 |
HousePhone |
nchar (20) |
|
住宅电话 |
OfficePhone |
nchar (20) |
|
办公电话 |
AddressPostcode |
nchar (20) |
|
住址邮编 |
TheGenusCountiesAndCities |
nchar (50) |
|
所属县市 |
WorkUnit |
nchar (50) |
|
工作单位 |
Job |
nchar (50) |
|
职务 |
AttributeMinuteID_MaritalStatus |
int |
外键 |
属性明细ID_婚姻状况 |
IDCard |
nchar (30) |
|
身份证号码 |
Birthday |
datetime |
|
生日 |
Hobby |
nchar (100) |
|
爱好 |
ChangeSite |
nchar (100) |
|
变更地址 |
Postcode |
nchar (20) |
|
邮编 |
Nationality |
nchar (50) |
|
国籍 |
Email |
nchar (50) |
|
Email |
FacilitateTheReturnTime |
datetime |
【wcf|海马汽车经销商管理系统技术解析(五)车辆续保提醒】 |
方便回访时间 |
CarOwnerPicture |
nchar (3000) |
|
车主照片 |
Remarks |
nchar (50) |
|
备注 |
IfEffective |
bit |
|
有效否 |
用于存放代办保险录入的信息
列名 |
数据类型 |
主键/外键 |
说明 |
CommissionInsureBillID |
int |
主键 |
代办保险单ID |
CarNewsID |
int |
外键 |
车辆信息表,车辆信息ID |
ContactPerson |
nchar (20) |
联系人 |
|
AttributeMinuteID_ContactPersonSex |
int |
外键 |
属性明细表,属性明细ID_联系人性别 |
ContactPersonPhone |
nchar (20) |
联系人电话 |
|
ContactPersoncellphone |
nchar (20) |
联系人手机 |
用于存放代办保险明细录入的信息
列名 |
数据类型 |
主键/外键 |
说明 |
CommissionInsureMinuteID |
int |
主键 |
代办保险明细ID |
CommissionInsureOddNumbers |
nchar (20) |
代办保险单号 |
|
CommissionInsureBillID |
int |
外键 |
代办保险单表,代办保险ID |
BeginDate |
datetime |
生效日期 |
|
ExpireDate |
datetime |
到期日期 |
|
InsureCompanyID |
int |
外键 |
保险公司表,保险公司ID |
InsureKindID |
int |
外键 |
险种表,险种ID |
InsureMoney |
decimal (18, 2) |
投保金额 |
|
Cost |
decimal (18, 2) |
成本 |
|
StaffID |
int |
外键 |
员工档案表,员工ID |
SalesmanBrokerage |
decimal (18, 2) |
业务员提成 |
|
IfWarn |
bit |
是否提醒 |
|
IfEffective |
bit |
有效否 |
|
AttributeMinuteID_Type |
int |
外键 |
属性明细表,属性明细ID_类型 |
用于存放车辆续保提醒录入的信息
列名 |
数据类型 |
主键/外键 |
说明 |
CarContinueInsureWarnID |
int |
主键 |
车辆续保提醒ID |
CommissionInsureID |
int |
外键 |
代办保险单ID |
AttributeMinuteID_WarnWay |
int |
|
属性明细ID_提醒方式 |
WarnDate |
datetime |
|
提醒日期 |
StaffID |
int |
外键 |
员工ID |
WarnContent |
nchar (100) |
|
提醒内容 |
第二步:技术解析
1、只显示当前时间加三天的到期的车辆信息:
第一步:数据库存储过程
IF(@TYPE ='dgvCarContinueInsureWarn_Select_ChaXunCheLiangXuBaoXinXi')
BEGIN
SELECTPW_CommissionInsureBillList.CommissionInsureBillID, PW_CommissionInsureBillList.ContactPerson, PW_CommissionInsureBillList.ContactPersonPhone,
PW_CommissionInsureBillList.ContactPersoncellphone, PW_CommissionInsureBillList.CarNewsID, BM_CarNewsList.LicensePlateNumber, BM_CarNewsList.VINCode,
BM_CarNewsList.CarOwnerNewsID, BM_CarOwnerNewsList.CarOwnerCode, BM_CarOwnerNewsList.CarOwnerName, PW_CommissionInsureMinuteList.Type,
PW_CommissionInsureMinuteList.BeginDate, PW_CommissionInsureMinuteList.ExpireDate, PW_CommissionInsureMinuteList.InsureCompanyID, BM_InsureCompanyList.InsureCompanyName,
PW_CommissionInsureMinuteList.InsureKindID, BM_InsureKindList.InsureKindName, PW_CommissionInsureMinuteList.InsureMoney, PW_CommissionInsureMinuteList.Cost,
PW_CommissionInsureMinuteList.SalesmanBrokerage, PW_CommissionInsureMinuteList.IfWarn, PW_CommissionInsureMinuteList.CommissionInsureMinuteID,
BM_StaffRecordList.StaffName AS SellAdviser
FROMPW_CommissionInsureBillList INNER JOIN
PW_CommissionInsureMinuteList ON PW_CommissionInsureBillList.CommissionInsureBillID = PW_CommissionInsureMinuteList.CommissionInsureID INNER JOIN
BM_CarNewsList ON PW_CommissionInsureBillList.CarNewsID = BM_CarNewsList.CarNewsID INNER JOIN
BM_CarOwnerNewsList ON BM_CarNewsList.CarOwnerNewsID = BM_CarOwnerNewsList.CarOwnerNewsID INNER JOIN
BM_InsureCompanyList ON PW_CommissionInsureMinuteList.InsureCompanyID = BM_InsureCompanyList.InsureCompanyID INNER JOIN
BM_InsureKindList ON PW_CommissionInsureMinuteList.InsureKindID = BM_InsureKindList.InsureKindID INNER JOIN
BM_StaffRecordList ON PW_CommissionInsureMinuteList.StaffID = BM_StaffRecordList.StaffID
END
第二步:逻辑层(BLL)代码
[OperationContract]
public DataSet dgvCarContinueInsureWarn_Select_ChaXunCheLiangXuBaoXinXi()
{
SqlParameter[] mySqlParameters ={
new SqlParameter("@TYPE",SqlDbType.Char),
};
mySqlParameters[0].Value = "https://www.it610.com/article/dgvCarContinueInsureWarn_Select_ChaXunCheLiangXuBaoXinXi";
DataTable dt = myDALMethod.QueryDataTable("顾客关系_FRM_CheLiangXuBaoTiXing", mySqlParameters);
DataSet ds = new DataSet();
ds.Tables.Add(dt);
return ds;
}
第三步:界面层(UIL)代码,写进界面Load事件
dtCarContinueInsureWarn=myFRM_CheLiangXuBaoTiXingClient.
dgvCarContinueInsureWarn_Select_ChaXunCheLiangXuBaoXinXi().Tables[0];
dtmTime = DateTime.Now.AddDays(3);
//当前时间加三天
dtWarn = dtCarContinueInsureWarn.Copy();
//复制表
dtWarn.Clear();
//清空表内容
for (int i = 0;
i < dtCarContinueInsureWarn.Rows.Count;
i++)
{
if (dtmTime.ToShortDateString() == Convert.ToDateTime(dtCarContinueInsureWarn.Rows[i]["ExpireDate"]).ToShortDateString())
{//若当前时间加三天等于到期日期则显示
DataRow row = dtWarn.NewRow();
//创建空白行
row.ItemArray = dtCarContinueInsureWarn.Rows[i].ItemArray;
//复制行
dtWarn.Rows.Add(row);
//把行添加进表
}
}
dgvCarContinueInsureWarn.DataSource = dtWarn;
// 把表绑定到dgv
dgvCarContinueInsureWarn.AllowUserToAddRows = false;
dgvCarContinueInsureWarn.ReadOnly = true;
2、提醒功能:
第一步:数据库存储过程
IF(@TYPE ='btnConfirm_Click_Save_XinZengTiXingXinXi')
BEGIN
INSERT BM_CarContinueInsureWarnList (CommissionInsureID,AttributeMinuteID_WarnWay,
WarnDate, StaffID, WarnContent)
VALUES (@CommissionInsureID,@AttributeMinuteID_WarnWay,@WarnDate,@StaffID,@WarnContent)
UPDATE PW_CommissionInsureMinuteList
SETIfWarn=@IfWarn
WHERE PW_CommissionInsureMinuteList.CommissionInsureMinuteID =@CommissionInsureMinuteID
END
第二步:逻辑层(BLL)代码
[OperationContract]
public int btnConfirm_Click_Save_XinZengTiXingXinXi(int intCommissionInsureID, int intAttributeMinuteID_WarnWay,
DateTime dtmWarnDate, int intStaffID, string strWarnContent, bool blnIfWarn, int intCommissionInsureMinuteID)
{
SqlParameter[] mySqlParameters ={
new SqlParameter("@TYPE",SqlDbType.Char),
new SqlParameter("@CommissionInsureID",SqlDbType.Int),
new SqlParameter("@AttributeMinuteID_WarnWay",SqlDbType.Int),
new SqlParameter("@WarnDate",SqlDbType.DateTime),
new SqlParameter("@StaffID",SqlDbType.Int),
new SqlParameter("@WarnContent",SqlDbType.Char),
new SqlParameter("@IfWarn",SqlDbType.Bit),
new SqlParameter("@CommissionInsureMinuteID",SqlDbType.Int ),
};
mySqlParameters[0].Value = "https://www.it610.com/article/btnConfirm_Click_Save_XinZengTiXingXinXi";
mySqlParameters[1].Value = https://www.it610.com/article/intCommissionInsureID;
mySqlParameters[2].Value = intAttributeMinuteID_WarnWay;
mySqlParameters[3].Value = dtmWarnDate;
mySqlParameters[4].Value = intStaffID;
mySqlParameters[5].Value = strWarnContent;
mySqlParameters[6].Value = blnIfWarn;
mySqlParameters[7].Value = intCommissionInsureMinuteID;
return myDALMethod.UpdateData("顾客关系_FRM_CheLiangXuBaoTiXing_TiXing", mySqlParameters);
}
第三步:界面层(UIL)代码,写进Button单击事件
///
///
///
/// 触发者
/// 触发事件
private void btnConfirm_Click(object sender, EventArgs e)
{
int intCommissionInsureID = FRM_CheLiangXuBaoTiXing.CommissionInsureBillID;
int intAttributeMinuteID_WarnWay = Convert.ToInt32(cboWarnWay .SelectedValue);
DateTime dtmWarnDate = DateTime.Now;
int intStaffID =PublicStaticObject .YuanGongID;
string strWarnContent = txtWarnContent.Text.Trim();
bool blnIfWarn = true;
int intCommissionInsureMinuteID = FRM_CheLiangXuBaoTiXing.CommissionInsureMinuteID;
int i = myFRM_CheLiangXuBaoTiXing_TiXingClient.btnConfirm_Click_Save_XinZengTiXingXinXi(intCommissionInsureID,
intAttributeMinuteID_WarnWay, dtmWarnDate, intStaffID, strWarnContent, blnIfWarn, intCommissionInsureMinuteID);
BaoCunFou = true;
if (i > 0)
{
MessageBox.Show("提醒成功!!!");
this.Close();
}
else { MessageBox.Show("提醒失败!!!");
}
}
仅用于学习参考,禁止用于商业用途!!
推荐阅读
- 众泰T500智能互联双加载,让汽车生活更有趣
- EXCEL的汽车导航-全能的GPS定位
- 儿子的手被汽车天窗挤住之后……
- 为什么汽车经销商总是有优惠,而厂商却不在指导价格上直接官降()
- 汽车音响中的分辨率
- MATLAB图形界面|基于Matlab的汽车出入库计时计费系统
- 浅谈酒店管理
- 自动驾驶关乎安全|自动驾驶关乎安全 四款搭载L2级主流新能源汽车你选谁()
- 汽车行业大数据分析怎么做(快试试这个数据分析工具,小白也能做)
- 苹果自动驾驶汽车团队又一经理跳槽,Project Titan项目再遇挫