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 CarViolationAdd : BasePage { OA_CarDictionaryBLL bll_OA_CarDictionaryBLL = null; OA_CarViolationBll oA_WorkReminderBll = null; public CarViolationAdd() { bll_OA_CarDictionaryBLL = new OA_CarDictionaryBLL(); oA_WorkReminderBll = new OA_CarViolationBll(); } //页面加载 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.selViolationReason.DataSource = bll_OA_CarDictionaryBLL.SelectListByMemberIdAndParType(CurrentUser.MemberId, "违章原因"); this.selViolationReason.DataValueField = "ParName"; this.selViolationReason.DataTextField = "ParName"; this.selViolationReason.DataBind(); } } //表单提交 protected void btn_submit_form(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(this.txtViolationTime.Value)) { JavaScript.MessageBox("违章时间不能为空", this); return; } DateTime nowTime = DateTime.Now; OA_CarViolation m_OA_CarViolation = new OA_CarViolation(); m_OA_CarViolation.CarId = Request["carid"].ToInt32(); m_OA_CarViolation.ViolationPeople = this.txtViolationPeople.Value; m_OA_CarViolation.ViolationTime = this.txtViolationTime.Value.ToDateTime2(); m_OA_CarViolation.ViolationReason = this.selViolationReason.Value; m_OA_CarViolation.ViolationTrafficPoliceMoney = this.txtViolationTrafficPoliceMoney.Value.ToDecimal2(); m_OA_CarViolation.ViolationTrafficPoliceScore = this.txtViolationTrafficPoliceScore.Value.ToInt32(); m_OA_CarViolation.ViolationFinedTheCompany = this.txtViolationFinedTheCompany.Value.ToDecimal2(); m_OA_CarViolation.ViolationRemark = this.txtViolationRemark.Value; m_OA_CarViolation.ViolationCompanyFinedTime = nowTime; m_OA_CarViolation.Operator = CurrentUser.ShortName; m_OA_CarViolation.LastUpdateTime = nowTime; if (oA_WorkReminderBll.InsertModel(m_OA_CarViolation)) JavaScript.MessageBoxCloseAndRefreshFirst("新增成功", this); else JavaScript.MessageBox("操作失败", this); } catch (Exception ex) { PAGEHandleException(ex); JavaScript.MessageBox("操作失败", this); } } } }