protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         this.CdModel = new OneCardApplicationModel();
     }
 }
 protected void MailSaveClick(object sender, EventArgs e)
 {
     this.CdModel = MakeUtil.getRequestDataToModel<OneCardApplicationModel>(Request, typeof(OneCardApplicationModel), -1);
     try
     {
         CdModel.HappenDate = DateTime.Now;
         bll.add(CdModel);
         Script.alertMsg("申请成功,请等候通知", Page);
         Script.scriptRedirect(Request.RawUrl, this.Page);
     }
     catch (Make.Exp.MakeException mEx)
     {
         Script.alertMsg(mEx.Message, this.Page);
         this.DataBind();
     }
 }
        public void add(OneCardApplicationModel onecardapplication)
        {
            SqlConnection cn = null;
            SqlTransaction tc = null;
            try
            {
                cn = DbHelperSQL.getConnection();
                tc = DbHelperSQL.startTransaction(cn);

                //执行新增写进数据库
            onecardapplicationDal.add(cn, tc, onecardapplication);

                DbHelperSQL.commitTransaction(tc);
            }
            catch (Exception dalEx)
            {
                DbHelperSQL.rollBackTransaction(tc);
                throw new MakeException(ExpSort.数据库, dalEx.Message);
            }
            finally
            {
                DbHelperSQL.closeConnection(cn);
            }
        }