Ejemplo n.º 1
0
        public new void ProcessRequest(HttpContext context)
        {
            try
            {
                this.modeId = context.Request.Form["ModelId"];
                string text = this.modeId;
                switch (text)
                {
                default:
                    if (text == "editeadvertcustom")
                    {
                        string text4 = context.Request.Form["Param"];
                        if (text4 != "")
                        {
                            JObject advertcustomobject = (JObject)JsonConvert.DeserializeObject(text4);
                            if (this.CheckAdvertCustom(advertcustomobject) && this.UpdateAdvertCustom(advertcustomobject))
                            {
                                Common_CustomAd common_CustomAd = new Common_CustomAd();
                                common_CustomAd.AdId = Convert.ToInt32(this.elementId);
                                var value3 = new
                                {
                                    AdCustom = common_CustomAd.RendHtml()
                                };
                                this.message = string.Format(this.resultformat, "true", JsonConvert.SerializeObject(value3));
                            }
                        }
                    }
                    break;

                case "editeadvertslide":
                {
                    string text5 = context.Request.Form["Param"];
                    if (text5 != "")
                    {
                        JObject avdvertobject = (JObject)JsonConvert.DeserializeObject(text5);
                        if (this.CheckAdvertSlide(avdvertobject) && this.UpdateAdvertSlide(avdvertobject))
                        {
                            Common_SlideAd common_SlideAd = new Common_SlideAd();
                            common_SlideAd.AdId = Convert.ToInt32(this.elementId);
                            var value4 = new
                            {
                                AdSlide = common_SlideAd.RendHtml()
                            };
                            this.message = string.Format(this.resultformat, "true", JsonConvert.SerializeObject(value4));
                        }
                    }
                    break;
                }

                case "editeadvertimage":
                {
                    string text3 = context.Request.Form["Param"];
                    if (text3 != "")
                    {
                        JObject advertimageobject = (JObject)JsonConvert.DeserializeObject(text3);
                        if (this.CheckAdvertImage(advertimageobject) && this.UpdateAdvertImage(advertimageobject))
                        {
                            Common_ImageAd common_ImageAd = new Common_ImageAd();
                            common_ImageAd.AdId = Convert.ToInt32(this.elementId);
                            var value2 = new
                            {
                                AdImage = common_ImageAd.RendHtml()
                            };
                            this.message = string.Format(this.resultformat, "true", JsonConvert.SerializeObject(value2));
                        }
                    }
                    break;
                }

                case "editelogo":
                {
                    string text2 = context.Request.Form["Param"];
                    if (text2 != "")
                    {
                        JObject jObject = (JObject)JsonConvert.DeserializeObject(text2);
                        if (this.CheckLogo(jObject) && this.UpdateLogo(jObject))
                        {
                            Common_Logo common_Logo = new Common_Logo();
                            var         value       = new
                            {
                                LogoUrl = common_Logo.RendHtml()
                            };
                            this.message = string.Format(this.resultformat, "true", JsonConvert.SerializeObject(value));
                        }
                    }
                    break;
                }
                }
            }
            catch (Exception ex)
            {
                this.message = "{\"success\":false,\"Result\":\"未知错误:" + ex.Message + "\"}";
            }
            context.Response.ContentType = "text/json";
            context.Response.Write(this.message);
        }
Ejemplo n.º 2
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                string str2;
                string str3;
                string str4;
                this.modeId = context.Request.Form["ModelId"];
                string modeId = this.modeId;
                if (modeId != null)
                {
                    if (!(modeId == "editeadvertslide"))
                    {
                        if (modeId == "editeadvertimage")
                        {
                            goto Label_00FD;
                        }
                        if (modeId == "editelogo")
                        {
                            goto Label_0196;
                        }
                        if (modeId == "editeadvertcustom")
                        {
                            goto Label_021D;
                        }
                    }
                    else
                    {
                        string str = context.Request.Form["Param"];
                        if (str != "")
                        {
                            JavaScriptObject avdvertobject = (JavaScriptObject)JavaScriptConvert.DeserializeObject(str);
                            if (this.CheckAdvertSlide(avdvertobject) && this.UpdateAdvertSlide(avdvertobject))
                            {
                                Common_SlideAd ad = new Common_SlideAd();
                                ad.AdId = Convert.ToInt32(this.elementId);
                                var type = new {
                                    AdSlide = ad.RendHtml()
                                };
                                this.message = string.Format(this.resultformat, "true", JavaScriptConvert.SerializeObject(type));
                            }
                        }
                    }
                }
                goto Label_02CA;
Label_00FD:
                str2 = context.Request.Form["Param"];
                if (str2 != "")
                {
                    JavaScriptObject advertimageobject = (JavaScriptObject)JavaScriptConvert.DeserializeObject(str2);
                    if (this.CheckAdvertImage(advertimageobject) && this.UpdateAdvertImage(advertimageobject))
                    {
                        Common_ImageAd ad2 = new Common_ImageAd();
                        ad2.AdId = Convert.ToInt32(this.elementId);
                        var type2 = new {
                            AdImage = ad2.RendHtml()
                        };
                        this.message = string.Format(this.resultformat, "true", JavaScriptConvert.SerializeObject(type2));
                    }
                }
                goto Label_02CA;
Label_0196:
                str3 = context.Request.Form["Param"];
                if (str3 != "")
                {
                    JavaScriptObject logoobject = (JavaScriptObject)JavaScriptConvert.DeserializeObject(str3);
                    if (this.CheckLogo(logoobject) && this.UpdateLogo(logoobject))
                    {
                        Common_Logo logo  = new Common_Logo();
                        var         type3 = new {
                            LogoUrl = logo.RendHtml()
                        };
                        this.message = string.Format(this.resultformat, "true", JavaScriptConvert.SerializeObject(type3));
                    }
                }
                goto Label_02CA;
Label_021D:
                str4 = context.Request.Form["Param"];
                if (str4 != "")
                {
                    JavaScriptObject advertcustomobject = (JavaScriptObject)JavaScriptConvert.DeserializeObject(str4);
                    if (this.CheckAdvertCustom(advertcustomobject) && this.UpdateAdvertCustom(advertcustomobject))
                    {
                        Common_CustomAd ad3 = new Common_CustomAd();
                        ad3.AdId = Convert.ToInt32(this.elementId);
                        var type4 = new {
                            AdCustom = ad3.RendHtml()
                        };
                        this.message = string.Format(this.resultformat, "true", JavaScriptConvert.SerializeObject(type4));
                    }
                }
            }
            catch (Exception exception)
            {
                this.message = "{\"success\":false,\"Result\":\"未知错误:" + exception.Message + "\"}";
            }
Label_02CA:
            context.Response.ContentType = "text/json";
            context.Response.Write(this.message);
        }