Пример #1
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);
            }
        }
Пример #2
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);
        }