Ejemplo n.º 1
0
        //保存
        protected void btnSave_Click(object sender, EventArgs e)
        {
            int tId     = MyCommFun.Str2Int(txtSelectTemplateId.Text);
            int colorId = MyCommFun.Str2Int(txtSelectColorId.Text);

            if (tId != 0)
            {
                Model.wx_userweixin weixin = GetWeiXinCode();

                Model.wx_module_templates_wcode tw = new Model.wx_module_templates_wcode();
                bool isAdd = true;
                bool Succ  = false;
                if (hidWTId.Value != "0")
                {
                    int wtId = MyCommFun.Str2Int(hidWTId.Value);
                    tw = twBll.GetModel(wtId);
                    if (tw != null)
                    {
                        isAdd = false;
                    }
                }
                tw.wid        = weixin.id;
                tw.tid        = tId;
                tw.createDate = DateTime.Now;



                if (isAdd)
                {
                    int id = twBll.Add(tw);
                    if (id > 0)
                    {
                        Succ = true;
                    }
                    hidWTId.Value = id.ToString();
                }
                else
                {
                    Succ = twBll.Update(tw);
                }
                if (Succ)
                {
                    JscriptMsg("模版设置成功!", "list.aspx", "Success");
                }
                else
                {
                    JscriptMsg("模版设置失败!", "", "Error");
                }
            }
        }
Ejemplo n.º 2
0
        //保存
        protected void btnSave_Click(object sender, EventArgs e)
        {

            int tId = MyCommFun.Str2Int(txtSelectTemplateId.Text);
            int colorId = MyCommFun.Str2Int(txtSelectColorId.Text);
            if (tId != 0)
            {
                Model.wx_userweixin weixin = GetWeiXinCode();

                Model.wx_module_templates_wcode tw = new Model.wx_module_templates_wcode();
                bool isAdd = true;
                bool Succ = false;
                if (hidWTId.Value != "0")
                {
                    int wtId = MyCommFun.Str2Int(hidWTId.Value);
                    tw = twBll.GetModel(wtId);
                    if (tw != null)
                    {
                        isAdd = false;
                    }
                }
                tw.wid = weixin.id;
                tw.tid = tId;
                tw.createDate = DateTime.Now;

               

                if (isAdd)
                {
                    int id = twBll.Add(tw);
                    if (id > 0)
                    { Succ = true; }
                    hidWTId.Value = id.ToString();
                }
                else
                {
                    Succ = twBll.Update(tw);
                }
                if (Succ)
                {
                    JscriptMsg("模版设置成功!", "list.aspx", "Success");
                }
                else
                {
                    JscriptMsg("模版设置失败!", "", "Error");
                }
            }


        }