Example #1
0
        protected void btnSave_Click(object sender, System.EventArgs e)
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);

            if (masterSettings.WeixinAppId != this.txtAppId.Text.Trim())
            {
                WeiXinHelper.ClearWeiXinMediaID();
                MemberHelper.ClearAllOpenId();
                ScanHelp.ClearScanBind("WX");
            }
            masterSettings.WeixinAppId     = this.txtAppId.Text.Trim();
            masterSettings.WeixinAppSecret = this.txtAppSecret.Text.Trim();
            SettingsManager.Save(masterSettings);
            Globals.RefreshWeiXinToken();
            this.ShowMsgAndReUrl("修改成功", true, "WXConfigBindOK.aspx");
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string str  = base.Request.QueryString["articletype"];
            string str2 = base.Request.Form["posttype"];
            string s    = base.Request.Form["id"];

            int.TryParse(s, out this.articleid);
            if ((str2 == "del") && (this.articleid > 0))
            {
                base.Response.ContentType = "application/json";
                string    str4   = "{\"type\":\"0\",\"tips\":\"操作失败\"}";
                DataSet   set    = ArticleHelper.ArticleIsInWeiXinReply(this.articleid);
                DataTable table  = set.Tables[0];
                DataTable table2 = set.Tables[1];
                DataTable table3 = set.Tables[2];
                if (Globals.ToNum(table.Rows[0][0]) > 0)
                {
                    str4 = "{\"type\":\"0\",\"tips\":\"删除失败,该素材已在栏目“微信->自动回复”中使用。\"}";
                }
                else if (Globals.ToNum(table2.Rows[0][0]) > 0)
                {
                    str4 = "{\"type\":\"0\",\"tips\":\"删除失败,该素材已在栏目“微博->自动回复”中使用。\"}";
                }
                else if (Globals.ToNum(table3.Rows[0][0]) > 0)
                {
                    str4 = "{\"type\":\"0\",\"tips\":\"删除失败,该素材已在栏目“服务窗->自动回复”中使用。\"}";
                }
                else if (ArticleHelper.DeleteArticle(this.articleid))
                {
                    str4 = "{\"type\":\"1\",\"tips\":\"删除成功\"}";
                }
                base.Response.Write(str4);
                base.Response.End();
            }
            else if (str2 == "clearweixin")
            {
                base.Response.ContentType = "application/json";
                WeiXinHelper.ClearWeiXinMediaID();
                string str5 = "{\"type\":\"1\",\"tips\":\"更新成功\"}";
                base.Response.Write(str5);
                base.Response.End();
            }
            else
            {
                this.LoadParameters(str);
            }
        }
Example #3
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string stype = base.Request.QueryString["articletype"];
            string a     = base.Request.Form["posttype"];
            string s     = base.Request.Form["id"];

            int.TryParse(s, out this.articleid);
            if (a == "del" && this.articleid > 0)
            {
                base.Response.ContentType = "application/json";
                string s2 = "{\"type\":\"0\",\"tips\":\"操作失败\"}";
                System.Data.DataSet   dataSet    = ArticleHelper.ArticleIsInWeiXinReply(this.articleid);
                System.Data.DataTable dataTable  = dataSet.Tables[0];
                System.Data.DataTable dataTable2 = dataSet.Tables[1];
                System.Data.DataTable dataTable3 = dataSet.Tables[2];
                if (Globals.ToNum(dataTable.Rows[0][0]) > 0)
                {
                    s2 = "{\"type\":\"0\",\"tips\":\"删除失败,该素材已在栏目“微信->自动回复”中使用。\"}";
                }
                else if (Globals.ToNum(dataTable2.Rows[0][0]) > 0)
                {
                    s2 = "{\"type\":\"0\",\"tips\":\"删除失败,该素材已在栏目“微博->自动回复”中使用。\"}";
                }
                else if (Globals.ToNum(dataTable3.Rows[0][0]) > 0)
                {
                    s2 = "{\"type\":\"0\",\"tips\":\"删除失败,该素材已在栏目“服务窗->自动回复”中使用。\"}";
                }
                else if (ArticleHelper.DeleteArticle(this.articleid))
                {
                    s2 = "{\"type\":\"1\",\"tips\":\"删除成功\"}";
                }
                base.Response.Write(s2);
                base.Response.End();
                return;
            }
            if (a == "clearweixin")
            {
                base.Response.ContentType = "application/json";
                WeiXinHelper.ClearWeiXinMediaID();
                string s3 = "{\"type\":\"1\",\"tips\":\"更新成功\"}";
                base.Response.Write(s3);
                base.Response.End();
                return;
            }
            this.LoadParameters(stype);
        }
Example #4
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            //SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
            //if (masterSettings.WeixinAppId != this.txtAppId.Text.Trim())
            //{
            //    WeiXinHelper.ClearWeiXinMediaID();
            //}
            //masterSettings.WeixinAppId = this.txtAppId.Text.Trim();
            //masterSettings.WeixinAppSecret = this.txtAppSecret.Text.Trim();
            //SettingsManager.Save(masterSettings);
            //this.ShowMsg("修改成功", true);

            if (website.appid != this.txtAppId.Text.Trim())
            {
                WeiXinHelper.ClearWeiXinMediaID(this.wid);
            }
            website.appid     = this.txtAppId.Text.Trim();
            website.appsecret = this.txtAppSecret.Text.Trim();
            bll.Update(website);
            this.ShowMsg("修改成功", true);
        }
Example #5
0
 private void saveData()
 {
     if (string.IsNullOrEmpty(this.txt_appid.Text.Trim()))
     {
         this.ShowMsg("请输入appid!", false);
     }
     if (string.IsNullOrEmpty(this.txt_appsecret.Text.Trim()))
     {
         this.ShowMsg("请输入appsecret!", false);
     }
     if (string.IsNullOrEmpty(this.txt_key.Text.Trim()))
     {
         this.ShowMsg("请输入Key!", false);
     }
     if (string.IsNullOrEmpty(this.txt_mch_id.Text.Trim()))
     {
         this.ShowMsg("请输入mch_id!", false);
     }
     if (this.website.appid != this.txt_appid.Text.Trim())
     {
         WeiXinHelper.ClearWeiXinMediaID(this.wid);
     }
     //this.siteSettings.WeixinAppId = this.txt_appid.Text.Trim();
     //this.siteSettings.WeixinAppSecret = this.txt_appsecret.Text.Trim();
     //this.siteSettings.WeixinPartnerKey = this.txt_key.Text.Trim();
     //this.siteSettings.WeixinPartnerID = this.txt_mch_id.Text.Trim();
     this.website.appid              = this.txt_appid.Text.Trim();
     this.website.appsecret          = this.txt_appsecret.Text.Trim();
     this.website.account_pay_key    = this.txt_key.Text.Trim();
     this.website.weixin_pay_account = this.txt_mch_id.Text.Trim();
     //SettingsManager.Save(this.siteSettings);
     if (bll.Update(this.website))
     {
         this.ShowMsg("保存成功!", true);
     }
     else
     {
         this.ShowMsg("保存失败!", false);
     }
 }