Ejemplo n.º 1
0
        public void add(WXTemplateSettingModel wxtemplatesetting)
        {
            SqlConnection cn = null;
            SqlTransaction tc = null;
            try
            {
                cn = DbHelperSQL.getConnection();
                tc = DbHelperSQL.startTransaction(cn);

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

                DbCacheHelper.UpdateCache<WXTemplateSettingDto>("WXTemplateSettingV", cn, tc);

                DbHelperSQL.commitTransaction(tc);
            }
            catch (Exception dalEx)
            {
                DbHelperSQL.rollBackTransaction(tc);
                throw new MakeException(ExpSort.数据库, dalEx.Message);
            }
            finally
            {
                DbHelperSQL.closeConnection(cn);
            }
        }
 protected void ImageBtnSave_Click(object sender, ImageClickEventArgs e)
 {
     this.WxTemplateSettingModel = MakeUtil.getRequestDataToModel<WXTemplateSettingModel>(Request, typeof(WXTemplateSettingModel), -1);
     try
     {
         var qmlist = new List<QueryModel>();
         qmlist.Add(MakeUtil.getQueryModel("TemplateType", "'", SqlWhere.WhereOperator.Equal, WxTemplateSettingModel.TemplateType));
         if (_iwxTemplateSettingEbi.getModelList(qmlist, -1).Count == 0)
         {
             _iwxTemplateSettingEbi.add(WxTemplateSettingModel);
         }
         else
         {
             _iwxTemplateSettingEbi.update(WxTemplateSettingModel);
         }
         MakeUtil.addOperationNote(Request.UserHostAddress, UserId.Trim(), "微信模版发送设置", WxTemplateSettingModel.TemplateId);
         Script.alertMsg("修改成功", Page);
         Script.scriptRedirect("WXTemplateSeting.aspx?TemplateType=" + WxTemplateSettingModel.TemplateType, this.Page);
     }
     catch (Make.Exp.MakeException mEx)
     {
         Script.alertMsg(mEx.Message, this.Page);
         this.DataBind();
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (true)
     {
         TemplateType = MakeUtil.getStringFromRequestByName(Request, "TemplateType", -1);
         if (TemplateType == "")
         {
             TemplateType = Helper.TemplateType.XiaoFeiDuanXin;
         }
         var qmlist = new List<QueryModel>();
         qmlist.Add(MakeUtil.getQueryModel("TemplateType", "'", SqlWhere.WhereOperator.Equal, TemplateType));
         WxTemplateSettingModel = _iwxTemplateSettingEbi.getModel(qmlist);
         //        WxTemplateSettingModel = new WXTemplateSettingModel();
         WxPlateList.DataSource = _wxppe.getModelList(null, -1);
         this.DataBind();
     }
 }
Ejemplo n.º 4
0
 public bool update(SqlConnection cn, SqlTransaction tc, WXTemplateSettingModel model)
 {
     return DbHelperSQL.updateModel<WXTemplateSettingModel>(model, "WXTemplateSetting", "Evenid", model.Evenid.ToString(), "'", cn, tc);
 }
Ejemplo n.º 5
0
 public bool add(SqlConnection cn, SqlTransaction tc, WXTemplateSettingModel model)
 {
     return DbHelperSQL.insertModel<WXTemplateSettingModel>(model, "WXTemplateSetting", cn, tc);
 }