Esempio n. 1
0
        protected override void PageLoad()
        {
            base.PageLoad();
            #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();

            #endregion
            if (RequestHelper.GetQueryString <string>("action").Equals("GetHospitals"))
            {
                GetHospitals();
            }
        }
Esempio n. 2
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;
        }