Example #1
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                string mainArticleCategories = "";
                this.modeId = context.Request.Form["ModelId"];
                switch (this.modeId)
                {
                case "commentarticleview":
                    mainArticleCategories = this.GetMainArticleCategories();
                    this.message          = string.Format(this.resultformat, "true", mainArticleCategories);
                    goto Label_0554;

                case "commentCategory":
                    mainArticleCategories = this.GetCategorys();
                    this.message          = string.Format(this.resultformat, "true", mainArticleCategories);
                    goto Label_0554;

                case "editecommentarticle":
                {
                    string str2 = context.Request.Form["Param"];
                    if (!string.IsNullOrEmpty(str2))
                    {
                        JavaScriptObject articleobject = (JavaScriptObject)JavaScriptConvert.DeserializeObject(str2);
                        if (this.CheckCommentArticle(articleobject) && this.UpdateCommentArticle(articleobject))
                        {
                            Common_SubjectArticle article = new Common_SubjectArticle();
                            article.CommentId = Convert.ToInt32(this.elementId);
                            var type = new {
                                ComArticle = article.RendHtml()
                            };
                            this.message = string.Format(this.resultformat, "true", JavaScriptConvert.SerializeObject(type));
                        }
                    }
                    goto Label_0554;
                }

                case "editecommentcategory":
                {
                    string str3 = context.Request.Form["Param"];
                    if (!string.IsNullOrEmpty(str3))
                    {
                        JavaScriptObject categoryobject = (JavaScriptObject)JavaScriptConvert.DeserializeObject(str3);
                        if (this.CheckCommentCategory(categoryobject) && this.UpdateCommentCategory(categoryobject))
                        {
                            Common_SubjectCategory category = new Common_SubjectCategory();
                            category.CommentId = Convert.ToInt32(this.elementId);
                            var type2 = new {
                                ComCategory = category.RendHtml()
                            };
                            this.message = string.Format(this.resultformat, "true", JavaScriptConvert.SerializeObject(type2));
                        }
                    }
                    goto Label_0554;
                }

                case "editecommentbrand":
                {
                    string str4 = context.Request.Form["Param"];
                    if (!string.IsNullOrEmpty(str4))
                    {
                        JavaScriptObject brandobject = (JavaScriptObject)JavaScriptConvert.DeserializeObject(str4);
                        if (this.CheckCommentBrand(brandobject) && this.UpdateCommentBrand(brandobject))
                        {
                            Common_SubjectBrand brand = new Common_SubjectBrand();
                            brand.CommentId = Convert.ToInt32(this.elementId);
                            var type3 = new {
                                ComBrand = brand.RendHtml()
                            };
                            this.message = string.Format(this.resultformat, "true", JavaScriptConvert.SerializeObject(type3));
                        }
                    }
                    goto Label_0554;
                }

                case "editecommentkeyword":
                {
                    string str5 = context.Request.Form["Param"];
                    if (!string.IsNullOrEmpty(str5))
                    {
                        JavaScriptObject keywordobject = (JavaScriptObject)JavaScriptConvert.DeserializeObject(str5);
                        if (this.CheckCommentKeyWord(keywordobject) && this.UpdateCommentKeyWord(keywordobject))
                        {
                            Common_SubjectKeyword keyword = new Common_SubjectKeyword();
                            keyword.CommentId = Convert.ToInt32(this.elementId);
                            var type4 = new {
                                ComCategory = keyword.RendHtml()
                            };
                            this.message = string.Format(this.resultformat, "true", JavaScriptConvert.SerializeObject(type4));
                        }
                    }
                    goto Label_0554;
                }

                case "editecommentattribute":
                {
                    string str6 = context.Request.Form["Param"];
                    if (!string.IsNullOrEmpty(str6))
                    {
                        JavaScriptObject attributeobject = (JavaScriptObject)JavaScriptConvert.DeserializeObject(str6);
                        if (this.CheckCommentAttribute(attributeobject) && this.UpdateCommentAttribute(attributeobject))
                        {
                            Common_SubjectAttribute attribute = new Common_SubjectAttribute();
                            attribute.CommentId = Convert.ToInt32(this.elementId);
                            var type5 = new {
                                ComAttribute = attribute.RendHtml()
                            };
                            this.message = string.Format(this.resultformat, "true", JavaScriptConvert.SerializeObject(type5));
                        }
                    }
                    goto Label_0554;
                }

                case "editecommenttitle":
                {
                    string str7 = context.Request.Form["Param"];
                    if (!string.IsNullOrEmpty(str7))
                    {
                        JavaScriptObject titleobject = (JavaScriptObject)JavaScriptConvert.DeserializeObject(str7);
                        if (this.CheckCommentTitle(titleobject) && this.UpdateCommentTitle(titleobject))
                        {
                            Common_SubjectTitle title = new Common_SubjectTitle();
                            title.CommentId = Convert.ToInt32(this.elementId);
                            var type6 = new {
                                ComTitle = title.RendHtml()
                            };
                            this.message = string.Format(this.resultformat, "true", JavaScriptConvert.SerializeObject(type6));
                        }
                    }
                    goto Label_0554;
                }

                case "editecommentmorelink":
                {
                    string str8 = context.Request.Form["Param"];
                    if (!string.IsNullOrEmpty(str8))
                    {
                        JavaScriptObject morelinkobject = (JavaScriptObject)JavaScriptConvert.DeserializeObject(str8);
                        if (this.CheckCommentMorelink(morelinkobject) && this.UpdateMorelink(morelinkobject))
                        {
                            Common_SubjectMoreLink link = new Common_SubjectMoreLink();
                            link.CommentId = Convert.ToInt32(this.elementId);
                            var type7 = new {
                                ComMoreLink = link.RendHtml()
                            };
                            this.message = string.Format(this.resultformat, "true", JavaScriptConvert.SerializeObject(type7));
                        }
                    }
                    goto Label_0554;
                }
                }
            }
            catch (Exception exception)
            {
                this.message = "{\"success\":false,\"Result\":\"未知错误:" + exception.Message + "\"}";
            }
Label_0554:
            context.Response.ContentType = "text/json";
            context.Response.Write(this.message);
        }
Example #2
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                string text = "";
                this.modeId = context.Request.Form["ModelId"];
                switch (this.modeId)
                {
                case "commentarticleview":
                    text         = this.GetMainArticleCategories();
                    this.message = string.Format(this.resultformat, "true", text);
                    break;

                case "commentCategory":
                    text         = this.GetCategorys();
                    this.message = string.Format(this.resultformat, "true", text);
                    break;

                case "editecommentarticle":
                {
                    string value7 = context.Request.Form["Param"];
                    if (!string.IsNullOrEmpty(value7))
                    {
                        JObject articleobject = (JObject)JsonConvert.DeserializeObject(value7);
                        if (this.CheckCommentArticle(articleobject) && this.UpdateCommentArticle(articleobject))
                        {
                            Common_SubjectArticle common_SubjectArticle = new Common_SubjectArticle();
                            common_SubjectArticle.CommentId = Convert.ToInt32(this.elementId);
                            var value8 = new
                            {
                                ComArticle = common_SubjectArticle.RendHtml()
                            };
                            this.message = string.Format(this.resultformat, "true", JsonConvert.SerializeObject(value8));
                        }
                    }
                    break;
                }

                case "editecommentcategory":
                {
                    string value3 = context.Request.Form["Param"];
                    if (!string.IsNullOrEmpty(value3))
                    {
                        JObject categoryobject = (JObject)JsonConvert.DeserializeObject(value3);
                        if (this.CheckCommentCategory(categoryobject) && this.UpdateCommentCategory(categoryobject))
                        {
                            Common_SubjectCategory common_SubjectCategory = new Common_SubjectCategory();
                            common_SubjectCategory.CommentId = Convert.ToInt32(this.elementId);
                            var value4 = new
                            {
                                ComCategory = common_SubjectCategory.RendHtml()
                            };
                            this.message = string.Format(this.resultformat, "true", JsonConvert.SerializeObject(value4));
                        }
                    }
                    break;
                }

                case "editecommentbrand":
                {
                    string value5 = context.Request.Form["Param"];
                    if (!string.IsNullOrEmpty(value5))
                    {
                        JObject jObject = (JObject)JsonConvert.DeserializeObject(value5);
                        if (this.CheckCommentBrand(jObject) && this.UpdateCommentBrand(jObject))
                        {
                            Common_SubjectBrand common_SubjectBrand = new Common_SubjectBrand();
                            common_SubjectBrand.CommentId = Convert.ToInt32(this.elementId);
                            var value6 = new
                            {
                                ComBrand = common_SubjectBrand.RendHtml()
                            };
                            this.message = string.Format(this.resultformat, "true", JsonConvert.SerializeObject(value6));
                        }
                    }
                    break;
                }

                case "editecommentkeyword":
                {
                    string value11 = context.Request.Form["Param"];
                    if (!string.IsNullOrEmpty(value11))
                    {
                        JObject keywordobject = (JObject)JsonConvert.DeserializeObject(value11);
                        if (this.CheckCommentKeyWord(keywordobject) && this.UpdateCommentKeyWord(keywordobject))
                        {
                            Common_SubjectKeyword common_SubjectKeyword = new Common_SubjectKeyword();
                            common_SubjectKeyword.CommentId = Convert.ToInt32(this.elementId);
                            var value12 = new
                            {
                                ComCategory = common_SubjectKeyword.RendHtml()
                            };
                            this.message = string.Format(this.resultformat, "true", JsonConvert.SerializeObject(value12));
                        }
                    }
                    break;
                }

                case "editecommentattribute":
                {
                    string value13 = context.Request.Form["Param"];
                    if (!string.IsNullOrEmpty(value13))
                    {
                        JObject attributeobject = (JObject)JsonConvert.DeserializeObject(value13);
                        if (this.CheckCommentAttribute(attributeobject) && this.UpdateCommentAttribute(attributeobject))
                        {
                            Common_SubjectAttribute common_SubjectAttribute = new Common_SubjectAttribute();
                            common_SubjectAttribute.CommentId = Convert.ToInt32(this.elementId);
                            var value14 = new
                            {
                                ComAttribute = common_SubjectAttribute.RendHtml()
                            };
                            this.message = string.Format(this.resultformat, "true", JsonConvert.SerializeObject(value14));
                        }
                    }
                    break;
                }

                case "editecommenttitle":
                {
                    string value9 = context.Request.Form["Param"];
                    if (!string.IsNullOrEmpty(value9))
                    {
                        JObject titleobject = (JObject)JsonConvert.DeserializeObject(value9);
                        if (this.CheckCommentTitle(titleobject) && this.UpdateCommentTitle(titleobject))
                        {
                            Common_SubjectTitle common_SubjectTitle = new Common_SubjectTitle();
                            common_SubjectTitle.CommentId = Convert.ToInt32(this.elementId);
                            var value10 = new
                            {
                                ComTitle = common_SubjectTitle.RendHtml()
                            };
                            this.message = string.Format(this.resultformat, "true", JsonConvert.SerializeObject(value10));
                        }
                    }
                    break;
                }

                case "editecommentmorelink":
                {
                    string value = context.Request.Form["Param"];
                    if (!string.IsNullOrEmpty(value))
                    {
                        JObject morelinkobject = (JObject)JsonConvert.DeserializeObject(value);
                        if (this.CheckCommentMorelink(morelinkobject) && this.UpdateMorelink(morelinkobject))
                        {
                            Common_SubjectMoreLink common_SubjectMoreLink = new Common_SubjectMoreLink();
                            common_SubjectMoreLink.CommentId = Convert.ToInt32(this.elementId);
                            var value2 = new
                            {
                                ComMoreLink = common_SubjectMoreLink.RendHtml()
                            };
                            this.message = string.Format(this.resultformat, "true", JsonConvert.SerializeObject(value2));
                        }
                    }
                    break;
                }
                }
            }
            catch (Exception ex)
            {
                this.message = "{\"success\":false,\"Result\":\"未知错误:" + ex.Message + "\"}";
            }
            context.Response.ContentType = "text/json";
            context.Response.Write(this.message);
        }