using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Web;
|
using System.Web.UI;
|
using System.Web.UI.WebControls;
|
using System.Data;
|
using System.Data.SqlClient;
|
using CY.Model;
|
using CY.BLL;
|
using CY.Infrastructure.Common;
|
using CY.BLL.Sys;
|
using CY.BLL.EC;
|
using CY.Infrastructure.DESEncrypt;
|
using CY.Infrastructure.Query;
|
|
namespace CY.WebForm.Pages.workcar
|
{
|
//吴辉
|
//新增保险记录
|
public partial class CarInsuranceAdd : BasePage
|
{
|
Sys_DictionaryBLL bll_Sys_DictionaryBLL = null;
|
OA_CarInsuranceBll oA_WorkReminderBll = null;
|
|
public CarInsuranceAdd()
|
{
|
bll_Sys_DictionaryBLL = new Sys_DictionaryBLL();
|
oA_WorkReminderBll = new OA_CarInsuranceBll();
|
}
|
|
//页面加载
|
protected void Page_Load(object sender, EventArgs e)
|
{
|
if (!IsPostBack)
|
{
|
}
|
}
|
|
//表单提交
|
protected void btn_submit_form(object sender, EventArgs e)
|
{
|
try
|
{
|
if (string.IsNullOrEmpty(this.txtInsuranceTime.Value))
|
{
|
JavaScript.MessageBox("购买时间不能为空", this);
|
return;
|
}
|
if (string.IsNullOrEmpty(this.txtInsuranceEndTime.Value))
|
{
|
JavaScript.MessageBox("到期时间不能为空", this);
|
return;
|
}
|
DateTime? Runtime1 = DateTime.Parse(this.txtInsuranceTime.Value);
|
DateTime? Runtime2 = DateTime.Parse(this.txtInsuranceEndTime.Value);
|
if (Runtime1 == null || Runtime2 == null || Runtime1 > Runtime2)
|
{
|
JavaScript.MessageBox("购买时间 不能大于 到期时间", this);
|
return;
|
}
|
|
DateTime nowTime = DateTime.Now;
|
OA_CarInsurance m_OA_CarInsurance = new OA_CarInsurance();
|
m_OA_CarInsurance.CarId = Request["carid"].ToInt32();
|
m_OA_CarInsurance.InsurancePeople = this.txtInsurancePeople.Value;
|
m_OA_CarInsurance.InsuranceTime = this.txtInsuranceTime.Value.ToDateTime2();
|
m_OA_CarInsurance.InsuranceEndTime = this.txtInsuranceEndTime.Value.ToDateTime2();
|
m_OA_CarInsurance.InsuranceMoney = this.txtInsuranceMoney.Value.ToDecimal2();
|
m_OA_CarInsurance.InsuranceCompany = this.txtInsuranceCompany.Value;
|
m_OA_CarInsurance.InsuranceContent = this.txtInsuranceContent.Value;
|
m_OA_CarInsurance.InsuranceStatus = 0;
|
m_OA_CarInsurance.Operator = CurrentUser.ShortName;
|
m_OA_CarInsurance.LastUpdateTime = nowTime;
|
|
if (oA_WorkReminderBll.InsertModel(m_OA_CarInsurance))
|
JavaScript.MessageBoxCloseAndRefreshFirst("新增成功", this);
|
else
|
JavaScript.MessageBox("操作失败", this);
|
}
|
catch (Exception ex)
|
{
|
PAGEHandleException(ex);
|
JavaScript.MessageBox("操作失败", this);
|
}
|
}
|
}
|
}
|