コード例 #1
0
ファイル: Helpitem.cs プロジェクト: damoOnly/e-commerce
 protected override void AttachChildControls()
 {
     this.rptHelps       = (ThemedTemplatedRepeater)this.FindControl("rptHelps");
     this.pager          = (Pager)this.FindControl("pager");
     this.lblCategory    = (System.Web.UI.WebControls.Label) this.FindControl("lblCategory");
     this.lblhelpName    = (System.Web.UI.WebControls.Label) this.FindControl("lblhelpName");
     this.lblhelpcontent = (System.Web.UI.WebControls.Literal) this.FindControl("lblhelpcontent");
     if (!this.Page.IsPostBack)
     {
         if (!string.IsNullOrEmpty(this.Page.Request.QueryString["helpid"]))
         {
             int helpid = 0;
             int.TryParse(this.Page.Request.QueryString["helpid"], out helpid);
             HelpInfo helpInfo = CommentBrowser.GetHelp(helpid);
             if (helpInfo != null)
             {
                 HelpCategoryInfo helpCategory = CommentBrowser.GetHelpCategory(helpInfo.CategoryId);
                 PageTitle.AddSiteNameTitle(helpInfo.Title);
                 this.lblCategory.Text    = helpCategory.Name;
                 this.lblhelpName.Text    = helpInfo.Title;
                 this.lblhelpcontent.Text = helpInfo.Content;
             }
         }
         this.BindList();
     }
 }
コード例 #2
0
        public IHttpActionResult Help(int id, string accessToken, int channel, int platform, string ver)
        {
            Logger.WriterLogger("Common.Help, Params: " + string.Format("accessToken={0}&channel={1}&platform={2}&ver={3}&id={4}", accessToken, channel, platform, ver, id), LoggerType.Info);

            // 保存访问信息
            base.SaveVisitInfo("", channel, platform, ver);

            // 验证令牌
            int accessTookenCode = VerifyAccessToken(accessToken);

            if (accessTookenCode > 0)
            {
                return(base.JsonFaultResult(new CommonException(accessTookenCode).GetMessage(), "Common.Help"));
            }

            HelpListItem item = new HelpListItem();

            HelpInfo help = CommentBrowser.GetHelp(id);

            if (help != null)
            {
                item.CategoryId  = help.CategoryId;
                item.Id          = help.HelpId;
                item.Title       = help.Title;
                item.Description = help.Description;

                var regex = new Regex(@"""/Storage/master");

                item.Content = regex.Replace(help.Content, "\"" + base.STORAGE_HOST + @"/Storage/master");

                item.Content   = StringExtension.CovertToHtml(item.Content);
                item.AddedDate = help.AddedDate.ToString("yyyy-MM-dd HH:mm:ss");

                return(base.JsonActionResult(new StandardResult <HelpListItem>()
                {
                    code = 0,
                    msg = "",
                    data = item
                }));
            }

            else
            {
                StandardResult <string> result = new StandardResult <string>()
                {
                    code = 1,
                    msg  = "找不到该帮助内容",
                    data = ""
                };

                return(base.JsonActionResult(result));
            }
        }
コード例 #3
0
        public void GetHelpContent(System.Web.HttpContext context)
        {
            string text = context.Request["helpid"].ToLower();

            if (!string.IsNullOrEmpty(text))
            {
                int helpid = 0;
                int.TryParse(text, out helpid);
                HelpInfo helpInfo = CommentBrowser.GetHelp(helpid);
                if (helpInfo != null)
                {
                    HelpCategoryInfo helpCategory = CommentBrowser.GetHelpCategory(helpInfo.CategoryId);
                    this.message = helpInfo.Content;
                }
            }
        }
コード例 #4
0
        protected override void AttachChildControls()
        {
            this.helpContent = (System.Web.UI.WebControls.Literal) this.FindControl("helpContent");

            if (!int.TryParse(this.Page.Request.QueryString["helpid"], out this.helpid))
            {
                base.GotoResourceNotFound("");
            }
            else
            {
                HelpInfo helpinfo = CommentBrowser.GetHelp(this.helpid);
                this.helpContent.Text = helpinfo.Content;
                string name = helpinfo.Title;

                PageTitle.AddSiteNameTitle(name);
            }
        }
コード例 #5
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["helpId"], out this.helpId))
     {
         base.GotoResourceNotFound();
     }
     this.litHelpAddedDate   = (FormatedTimeLabel)this.FindControl("litHelpAddedDate");
     this.litHelpDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litHelpDescription");
     this.litHelpContent     = (System.Web.UI.WebControls.Literal) this.FindControl("litHelpContent");
     this.litHelpTitle       = (System.Web.UI.WebControls.Literal) this.FindControl("litHelpTitle");
     this.lblFront           = (System.Web.UI.WebControls.Label) this.FindControl("lblFront");
     this.lblNext            = (System.Web.UI.WebControls.Label) this.FindControl("lblNext");
     this.lblFrontTitle      = (System.Web.UI.WebControls.Label) this.FindControl("lblFrontTitle");
     this.lblNextTitle       = (System.Web.UI.WebControls.Label) this.FindControl("lblNextTitle");
     this.aFront             = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("front");
     this.aNext = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("next");
     if (!this.Page.IsPostBack)
     {
         HelpInfo help = CommentBrowser.GetHelp(this.helpId);
         if (help != null)
         {
             PageTitle.AddSiteNameTitle(help.Title);
             if (!string.IsNullOrEmpty(help.MetaKeywords))
             {
                 MetaTags.AddMetaKeywords(help.MetaKeywords, HiContext.Current.Context);
             }
             if (!string.IsNullOrEmpty(help.MetaDescription))
             {
                 MetaTags.AddMetaDescription(help.MetaDescription, HiContext.Current.Context);
             }
             this.litHelpTitle.Text       = help.Title;
             this.litHelpDescription.Text = help.Description;
             string str = HiContext.Current.HostPath + Globals.GetSiteUrls().UrlData.FormatUrl("HelpDetails", new object[]
             {
                 this.helpId
             });
             this.litHelpContent.Text   = help.Content.Replace("href=\"#\"", "href=\"" + str + "\"");
             this.litHelpAddedDate.Time = help.AddedDate;
             HelpInfo frontOrNextHelp = CommentBrowser.GetFrontOrNextHelp(this.helpId, help.CategoryId, "Front");
             if (frontOrNextHelp != null && frontOrNextHelp.HelpId > 0)
             {
                 if (this.lblFront != null)
                 {
                     this.lblFront.Visible   = true;
                     this.aFront.HRef        = "HelpDetails.aspx?helpId=" + frontOrNextHelp.HelpId;
                     this.lblFrontTitle.Text = frontOrNextHelp.Title;
                 }
             }
             else
             {
                 if (this.lblFront != null)
                 {
                     this.lblFront.Visible = false;
                 }
             }
             HelpInfo frontOrNextHelp2 = CommentBrowser.GetFrontOrNextHelp(this.helpId, help.CategoryId, "Next");
             if (frontOrNextHelp2 != null && frontOrNextHelp2.HelpId > 0)
             {
                 if (this.lblNext != null)
                 {
                     this.lblNext.Visible   = true;
                     this.aNext.HRef        = "HelpDetails.aspx?helpId=" + frontOrNextHelp2.HelpId;
                     this.lblNextTitle.Text = frontOrNextHelp2.Title;
                     return;
                 }
             }
             else
             {
                 if (this.lblNext != null)
                 {
                     this.lblNext.Visible = false;
                 }
             }
         }
     }
 }