Ejemplo n.º 1
0
        public void editreply(HttpContext context)
        {
            ReplyInfo replyInfo = new ReplyInfo();
            string    s         = "{\"status\":\"0\"}";

            replyInfo.Id           = int.Parse(context.Request["id"]);
            replyInfo.EditDate     = DateTime.Now;
            replyInfo.ReceiverType = context.Request["ReceiverType"];
            replyInfo.Type         = int.Parse(context.Request["Type"]);
            if (replyInfo.ReceiverType == "text")
            {
                replyInfo.Content = context.Request["Content"];
            }
            else
            {
                replyInfo.Url = context.Request["Url"];
                string       str2           = "";
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                if (!string.IsNullOrEmpty(masterSettings.ShopHomePic))
                {
                    str2 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.ShopHomePic;
                }
                else
                {
                    str2 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.DistributorBackgroundPic.Split(new char[] { '|' })[0];
                }
                replyInfo.Image = str2;
                if ((string.IsNullOrEmpty(context.Request["Image"]) && string.IsNullOrEmpty(context.Request["Display_name"])) && string.IsNullOrEmpty(context.Request["Summary"]))
                {
                    replyInfo.Displayname = masterSettings.SiteName;
                    replyInfo.Summary     = string.IsNullOrEmpty(masterSettings.ShopIntroduction) ? masterSettings.SiteName : masterSettings.ShopIntroduction;
                }
                else
                {
                    replyInfo.Image       = string.IsNullOrEmpty(context.Request["Image"]) ? str2 : context.Request["Image"];
                    replyInfo.Displayname = context.Request["Display_name"];
                    replyInfo.Summary     = context.Request["Summary"];
                    replyInfo.ArticleId   = int.Parse(context.Request["ArticleId"]);
                }
            }
            if (WeiboHelper.UpdateReplyInfo(replyInfo))
            {
                s = "{\"status\":\"1\"}";
            }
            context.Response.Write(s);
        }