コード例 #1
0
        public void BindNew()
        {
            DataRow dr = null;
            string  id = Utility.Common.SqlEncode(Utility.Common.GetStringOfUrl("id"));

            if (string.IsNullOrEmpty(id))
            {
                dr = news.GetInfoByTitle("推广员介绍");
            }
            else
            {
                dr = news.GetInfo(id);
            }
            if (dr != null)
            {
                NewTitle   = dr["Title"].ToString();
                NewContent = dr["Content"].ToString();
                Hits       = dr["Hits"].ToString();
                AddTime    = ((DateTime)dr["Issue_Time"]).ToString("yyyy年MM月dd日");

                string seoDesc = Utility.Common.ClearHtml(Utility.Common.CutStringUnicode(NewContent, 300, "..."));

                SeoNewsSetting(NewTitle, dr["Keywords"].ToString(), seoDesc);
            }
        }
コード例 #2
0
        public void BindNew()
        {
            string id = Utility.Common.SqlEncode(Utility.Common.GetStringOfUrl("id"));

            if (string.IsNullOrEmpty(id) || !BCST.Common.CommonManager.String.IsInteger(id))
            {
                return;
            }

            news.UpdateHits(id);

            DataRow dr = news.GetInfo(id);

            if (dr != null)
            {
                NewTypeId   = dr["Typeid"].ToString();
                NewTypeName = dr["TypeName"].ToString();
                TitleColor  = dr["TitleColor"].ToString();
                NewTitle    = dr["Title"].ToString();
                NewContent  = dr["Content"].ToString();
                NewAuthor   = dr["Author"].ToString();
                NewFrom     = dr["News_From"].ToString();
                Hits        = dr["Hits"].ToString();
                AddTime     = ((DateTime)dr["Issue_Time"]).ToString("yyyy年MM月dd日");

                #region 标题及SEO设置

                string seoDesc = Utility.Common.ClearHtml(Utility.Common.CutStringUnicode(NewContent, 300, "..."));

                SeoNewsSetting(NewTitle, dr["Keywords"].ToString(), seoDesc);


                #endregion
            }
        }