1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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 CarExaminedAdd : BasePage
    {
        Sys_DictionaryBLL bll_Sys_DictionaryBLL = null;
        OA_CarExaminedBll oA_WorkReminderBll = null;
 
        public CarExaminedAdd()
        {
            bll_Sys_DictionaryBLL = new Sys_DictionaryBLL();
            oA_WorkReminderBll = new OA_CarExaminedBll();
        }
 
        //页面加载
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
            }
        }
 
        //表单提交
        protected void btn_submit_form(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(this.txtExaminedTime.Value))
                {
                    JavaScript.MessageBox("年检时间不能为空", this);
                    return;
                }
                if (string.IsNullOrEmpty(this.txtExaminedNextTime.Value))
                {
                    JavaScript.MessageBox("下次年检时间不能为空", this);
                    return;
                }
                DateTime? Runtime1 = DateTime.Parse(this.txtExaminedTime.Value);
                DateTime? Runtime2 = DateTime.Parse(this.txtExaminedNextTime.Value);
                if (Runtime1 == null || Runtime2 == null || Runtime1 > Runtime2)
                {
                    JavaScript.MessageBox("年检时间 不能大于 下次年检时间", this);
                    return;
                }
 
                DateTime nowTime = DateTime.Now;
                OA_CarExamined m_OA_CarExamined =  new OA_CarExamined();
                m_OA_CarExamined.CarId = Request["carid"].ToInt32();
                m_OA_CarExamined.ExaminedPeople = this.txtExaminedPeople.Value;
                m_OA_CarExamined.ExaminedTime = this.txtExaminedTime.Value.ToDateTime2();
                m_OA_CarExamined.ExaminedNextTime = this.txtExaminedNextTime.Value.ToDateTime2();
                m_OA_CarExamined.ExaminedMoney = this.txtExaminedMoney.Value.ToDecimal2();
                m_OA_CarExamined.ExaminedRecore = this.txtExaminedRecore.Value;
                m_OA_CarExamined.ExaminedStatus = 0;
                m_OA_CarExamined.Operator = CurrentUser.ShortName;
                m_OA_CarExamined.LastUpdateTime = nowTime;
 
                if (oA_WorkReminderBll.InsertModel(m_OA_CarExamined))
                    JavaScript.MessageBoxCloseAndRefreshFirst("新增成功", this);
                else
                    JavaScript.MessageBox("操作失败", this);
            }
            catch (Exception ex)
            {
                PAGEHandleException(ex);
                JavaScript.MessageBox("操作失败", this);
            }
        }
    }
}