Esempio n. 1
0
        /// <summary>
        /// 页面加载
        /// </summary>
        protected override void PageLoad()
        {
            base.PageLoad();
            int articleID = RequestHelper.GetQueryString <int>("ID");

            article = ArticleBLL.Read(articleID);

            thisClass = ArticleClassBLL.Read(ArticleClassBLL.GetLastClassID(article.ClassId));

            topNav = topClassID;



            if (article.ClassId != string.Empty)
            {
                articleClassID = ArticleClassBLL.GetLastClassID(article.ClassId);
                topClassID     = ArticleClassBLL.GetTopClassID(article.ClassId);
                topClass       = ArticleClassBLL.Read(topClassID);
            }

            newsClassList = ArticleClassBLL.ReadChilds(64);

            Title       = article.Title;
            Keywords    = (article.Keywords == string.Empty) ? article.Title : article.Keywords;
            Description = (article.Summary == string.Empty) ? StringHelper.Substring(StringHelper.KillHTML(article.Content), 200) : article.Summary;

            List <ArticleInfo> nextPreList = new List <ArticleInfo>();
            var arlist = ArticleBLL.SearchListRowNumber(" Id =" + article.Id + "");

            if (arlist.Count > 0)
            {
                ArticleInfo thisArtInfo = arlist[0];
                nextPreList = ArticleBLL.SearchListRowNumber(" ClassId Like'%" + article.ClassId + "%' and RowNumber>" + thisArtInfo.RowNumber + " Order by RowNumber asc");


                if (nextPreList.Count > 0)
                {
                    PreNews = "<a href=\"/NewsDetail.html?ID=" + nextPreList[0].Id + "\" title=\"" + nextPreList[0].Title + "\">" + StringHelper.Substring(nextPreList[0].Title, 20) + "</a>";
                }

                nextPreList = ArticleBLL.SearchListRowNumber(" ClassId Like'%" + article.ClassId + "%' and RowNumber<" + thisArtInfo.RowNumber + " Order by RowNumber desc");
                if (nextPreList.Count > 0)
                {
                    NextNews = "<a href=\"/NewsDetail.html?ID=" + nextPreList[0].Id + "\" title=\"" + nextPreList[0].Title + "\">" + StringHelper.Substring(nextPreList[0].Title, 20) + "</a>";
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 页面加载
        /// </summary>
        protected override void PageLoad()
        {
            base.PageLoad();

            articleList = ArticleBLL.SearchList(new ArticleSearchInfo {
                ClassId = "|45|"
            });

            int articleID = RequestHelper.GetQueryString <int>("ID");

            article = ArticleBLL.Read(articleID);
            if (articleID <= 0 && articleList.Count > 0)
            {
                article = articleList[0];
            }

            ArticleInfo tmp = article;

            tmp.ViewCount = tmp.ViewCount + 1;

            ArticleBLL.Update(tmp);

            thisClass = ArticleClassBLL.Read(ArticleClassBLL.GetLastClassID(article.ClassId));

            int topClassID = ArticleClassBLL.GetTopClassID(article.ClassId);

            topNav = topClassID;

            topClass = ArticleClassBLL.Read(topClassID);



            //SEO
            Title       = article.Title;
            Keywords    = (article.Keywords == string.Empty) ? article.Title : article.Keywords;
            Description = (article.Summary == string.Empty) ? StringHelper.Substring(StringHelper.KillHTML(article.Content), 200) : article.Summary;
        }
Esempio n. 3
0
        /// <summary>
        /// 页面加载
        /// </summary>
        protected override void PageLoad()
        {
            base.PageLoad();
            int articleID = RequestHelper.GetQueryString <int>("ID");

            if (articleID == 60)
            {
                topNav = 6;
                int counts = 0;
                if ((ArticleBLL.SearchList(1, 1, new ArticleSearchInfo {
                    ClassId = "|60|"
                }, ref counts).Count > 0))
                {
                    articleID = ArticleBLL.SearchList(1, 1, new ArticleSearchInfo {
                        ClassId = "|60|"
                    }, ref counts)[0].Id;
                }
            }
            article = ArticleBLL.Read(articleID);
            ArticleInfo tmp = article;

            tmp.ViewCount = tmp.ViewCount + 1;

            ArticleBLL.Update(tmp);

            thisClass = ArticleClassBLL.Read(ArticleClassBLL.GetLastClassID(article.ClassId));

            int topClassID = ArticleClassBLL.GetTopClassID(article.ClassId);

            topNav = topClassID;

            topClass = ArticleClassBLL.Read(topClassID);

            if (thisClass.Id == 60)
            {
                topNav = 6;
            }

            string theArticleClassID = article.ClassId;
            int    lastClassID       = int.MinValue;

            if (theArticleClassID != string.Empty)
            {
                theArticleClassID = theArticleClassID.Substring(1);
                lastClassID       = Convert.ToInt32(theArticleClassID.Substring(0, theArticleClassID.IndexOf('|')));
            }

            navList = ArticleClassBLL.ReadArticleClassFullFatherID(ArticleClassBLL.GetLastClassID(article.ClassId));
            ArticleSearchInfo articleSearch = new ArticleSearchInfo();


            List <ArticleInfo> nextPreList = new List <ArticleInfo>();

            if (ArticleBLL.SearchListRowNumber(" ID =" + article.Id + "").Count > 0)
            {
                ArticleInfo thisArtInfo = ArticleBLL.SearchListRowNumber(" ID =" + article.Id + "")[0];
                nextPreList = ArticleBLL.SearchListRowNumber(" [ClassID] Like'%" + article.ClassId + "%' and [RowNumber]>" + thisArtInfo.RowNumber + " Order by RowNumber asc");


                if (nextPreList.Count > 0)
                {
                    NextNews  = "<a href=\"/articledetail-I" + nextPreList[0].Id + ".html\" title=\"" + nextPreList[0].Title + "\">" + StringHelper.Substring(nextPreList[0].Title, 20) + "</a>";
                    NextNewsM = "<a href=\"/mobile/articledetail-I" + nextPreList[0].Id + ".html\" title=\"" + nextPreList[0].Title + "\">" + StringHelper.Substring(nextPreList[0].Title, 13) + "</a>";
                }

                nextPreList = ArticleBLL.SearchListRowNumber(" ClassID Like'%" + article.ClassId + "%' and RowNumber<" + thisArtInfo.RowNumber + " Order by RowNumber desc");
                if (nextPreList.Count > 0)
                {
                    PreNews  = "<a href=\"/articledetail-I" + nextPreList[0].Id + ".html\" title=\"" + nextPreList[0].Title + "\">" + StringHelper.Substring(nextPreList[0].Title, 20) + "</a>";
                    PreNewsM = "<a href=\"/mobile/articledetail-I" + nextPreList[0].Id + ".html\" title=\"" + nextPreList[0].Title + "\">" + StringHelper.Substring(nextPreList[0].Title, 13) + "</a>";
                }
            }

            //SEO
            Title       = article.Title;
            Keywords    = (article.Keywords == string.Empty) ? article.Title : article.Keywords;
            Description = (article.Summary == string.Empty) ? StringHelper.Substring(StringHelper.KillHTML(article.Content), 200) : article.Summary;
        }
Esempio n. 4
0
        /// <summary>
        /// 页面加载
        /// </summary>
        protected override void PageLoad()
        {
            base.PageLoad();
            int articleID = RequestHelper.GetQueryString <int>("ID");

            article = ArticleBLL.Read(articleID);
            ArticleInfo tmp = article;

            tmp.ViewCount = tmp.ViewCount + 1;

            ArticleBLL.Update(tmp);

            #region 微信分享
            Hashtable    ht  = new Hashtable();
            WechatCommon wxs = new WechatCommon();
            ht        = wxs.getSignPackage();
            timestamp = ht["timestamp"].ToString();
            nonce     = ht["nonceStr"].ToString();
            signature = ht["signature"].ToString();
            url       = ht["url"].ToString();

            WeChatImg = "http://" + HttpContext.Current.Request.Url.Host + article.Photo;
            title     = article.Title;
            desc      = (article.Summary == string.Empty) ? StringHelper.Substring(StringHelper.KillHTML(article.Content), 200) : article.Summary;
            #endregion

            thisClass = ArticleClassBLL.Read(ArticleClassBLL.GetLastClassID(article.ClassId));

            int topClassID = ArticleClassBLL.GetTopClassID(article.ClassId);
            topNav = topClassID;

            topClass = ArticleClassBLL.Read(topClassID);



            string theArticleClassID = article.ClassId;
            int    lastClassID       = int.MinValue;
            if (theArticleClassID != string.Empty)
            {
                theArticleClassID = theArticleClassID.Substring(1);
                lastClassID       = Convert.ToInt32(theArticleClassID.Substring(0, theArticleClassID.IndexOf('|')));
            }

            navList = ArticleClassBLL.ReadArticleClassFullFatherID(ArticleClassBLL.GetLastClassID(article.ClassId));
            ArticleSearchInfo articleSearch = new ArticleSearchInfo();


            List <ArticleInfo> nextPreList = new List <ArticleInfo>();
            if (ArticleBLL.SearchListRowNumber(" ID =" + article.Id + "").Count > 0)
            {
                ArticleInfo thisArtInfo = ArticleBLL.SearchListRowNumber(" ID =" + article.Id + "")[0];
                nextPreList = ArticleBLL.SearchListRowNumber(" [ClassID] Like'%" + article.ClassId + "%' and [RowNumber]>" + thisArtInfo.RowNumber + " Order by RowNumber asc");


                if (nextPreList.Count > 0)
                {
                    NextNewsM = "<a href=\"/mobile/Newsdetail.html?id=" + nextPreList[0].Id + "\" title=\"" + nextPreList[0].Title + "\" class=\"nextLink\">" + "下一篇:" + StringHelper.Substring(nextPreList[0].Title, 13) + "</a>";
                }

                nextPreList = ArticleBLL.SearchListRowNumber(" ClassID Like'%" + article.ClassId + "%' and RowNumber<" + thisArtInfo.RowNumber + " Order by RowNumber desc");
                if (nextPreList.Count > 0)
                {
                    PreNewsM = "<a href=\"/mobile/Newsdetail.html?id=" + nextPreList[0].Id + "\" title=\"" + nextPreList[0].Title + "\" class=\"prevLink\">" + "上一篇:" + StringHelper.Substring(nextPreList[0].Title, 13) + "</a>";
                }
            }

            //SEO
            Title       = article.Title;
            Keywords    = (article.Keywords == string.Empty) ? article.Title : article.Keywords;
            Description = (article.Summary == string.Empty) ? StringHelper.Substring(StringHelper.KillHTML(article.Content), 200) : article.Summary;
        }