Exemplo n.º 1
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            url = "http://" + Request.Url.Authority + Request.ApplicationPath + "/";
            string ChannelAlias = null;

            try
            {
                ChannelAlias = Request.QueryString["SubAlias"].ToString();
            }
            catch (Exception AliasNull)
            {
                Response.Redirect("HomeLite.aspx");
            }
            string    ChannelGuid  = DataQuery.CategoryAliasToID(ChannelAlias);
            string    CategoryName = DataQuery.GetNameByCategoryAlias(ChannelAlias);
            string    OtherAlias   = DataQuery.GetChannelAliasByName(ConfigurationManager.AppSettings["NewsCategoriesAlias"], CategoryName);
            string    OtherGuid    = DataQuery.CategoryAliasToID(OtherAlias);
            DataTable TopInfo      = DataQuery.ArticleQuerySummary("", "1", ChannelAlias).Tables[0];
            DataTable OtherInfo    = DataQuery.ArticleQuery("", "", OtherAlias).Tables[0];

            TopPicLargeLink.NavigateUrl = "ShowVideo.aspx?ID=" + TopInfo.Rows[0]["ArticleGUID"].ToString();
            PlayLink.NavigateUrl        = "ShowVideo.aspx?ID=" + TopInfo.Rows[0]["ArticleGUID"].ToString();
            TopPicLarge.ImageUrl        = DataQuery.GetCoursePicPath(TopInfo.Rows[0]["ArticleGUID"].ToString(), url, "360x240.png");
            TopPicSmall.ImageUrl        = DataQuery.GetCoursePicPath(TopInfo.Rows[0]["ArticleGUID"].ToString(), url, "001.jpg");
            TopTitle.Text          = DataProcessing.SubstringText(TopInfo.Rows[0]["Title"].ToString(), 17);
            TopSpeaker.Text        = DataProcessing.SubstringText(TopInfo.Rows[0]["Author"].ToString(), 17);
            TopSpeakerInfo.Text    = DataProcessing.SubstringText(TopInfo.Rows[0]["SpeakerInfo"].ToString(), 25);
            TopSpeakerInfo.ToolTip = TopInfo.Rows[0]["SpeakerInfo"].ToString();
            TopSummary.Text        = DataProcessing.SubstringText(DataProcessing.NoHTML(TopInfo.Rows[0]["Summary"].ToString()), 155);
            TopSummary.ToolTip     = DataProcessing.NoHTML(TopInfo.Rows[0]["Summary"].ToString());
            //
            SpecialAttentionLevel2CourseList.DataSource = OtherInfo;
            SpecialAttentionLevel2CourseList.DataBind();
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string CourseKeyWord;
            string CourseSperker;

            url = "http://" + Request.Url.Authority + Request.ApplicationPath + "/";
            string CourseId = Request.QueryString["ID"].ToString();

            if (CourseId == null)
            {
                Response.Redirect("HomeLite.aspx");
            }
            string CoursrQueryStr   = "SELECT Top 1 ArticleGUID,State,Title,Area,Author,PlainText,Filename,CreateTime,KeyWord FROM ArticleCurrent Where ArticleGUID='" + CourseId + "'";
            string SpeakerQueryStr  = "Select Top 1 PropertyValue From ArticleCurrentPropertyExt Where PropertyAlias = 'speakerresume' And ArticleGUID='" + CourseId + "'";
            string connectingString = ConfigurationManager.ConnectionStrings["zjspccmConnectionString"].ToString();
            String SpeakerFile;

            using (SqlConnection connection =
                       new SqlConnection(connectingString))
            {
                SqlCommand command = new SqlCommand(CoursrQueryStr, connection);
                connection.Open();
                SqlDataReader CourseReder = command.ExecuteReader();
                CourseReder.Read();
                TopPicLargeLink.NavigateUrl = "ShowVideo.aspx?ID=" + CourseReder[0].ToString();
                TopPlayLink.NavigateUrl     = "ShowVideo.aspx?ID=" + CourseReder[0].ToString();
                TopPicLarge.ImageUrl        = DataQuery.GetCoursePicPath(CourseReder[0].ToString(), url, "360x240.png");
                TopPicSmall.ImageUrl        = DataQuery.GetCoursePicPath(CourseReder[0].ToString(), url, "001.jpg");
                SpeakerInfoUrl         = DataQuery.GetCoursePicPath(CourseReder[0].ToString(), url, "data/jsData.js");
                TopTitle.Text          = DataProcessing.SubstringText(CourseReder[2].ToString(), 17);
                TopSpeaker.Text        = DataProcessing.SubstringText(CourseReder[4].ToString(), 17);
                TopSpeakerInfo.Text    = DataProcessing.SubstringText(CourseReder[3].ToString(), 40);
                TopSpeakerInfo.ToolTip = CourseReder[3].ToString();
                TopSummary.Text        = DataProcessing.SubstringText(DataProcessing.NoHTML(CourseReder[5].ToString()), 210);
                TopSummary.ToolTip     = DataProcessing.NoHTML(CourseReder[5].ToString());
                CourseSperker          = CourseReder[4].ToString();
                CourseKeyWord          = CourseReder[8].ToString();
            }
            //主讲人简介
            //using (SqlConnection connection =  new SqlConnection(connectingString))
            //{
            //    connection.Open();
            //    SqlCommand SpeakerCommand = new SqlCommand(SpeakerQueryStr, connection);
            //    SqlDataReader SpeakerReder = SpeakerCommand.ExecuteReader();
            //    if (SpeakerReder.Read())
            //    {
            //        SpeakerFile = SpeakerReder[0].ToString();
            //        string SpeakerFilePath = DataQuery.GetCoursePicPath(CourseId, url, SpeakerFile);
            //        XmlDocument xmlDoc = new XmlDocument();
            //        try
            //        {
            //            xmlDoc.Load(SpeakerFilePath);
            //            XmlNode root = xmlDoc.SelectSingleNode("Speaker");
            //            //string SperkerSummary = DataProcessing.NoHTML((root.SelectSingleNode("Information1")).InnerXml);
            //            string SperkerSummary = (root.SelectSingleNode("Information1")).InnerXml;
            //            SperkerSummary = SperkerSummary.Replace("&lt;", "<");
            //            SperkerSummary = SperkerSummary.Replace("&gt;", ">");
            //            SperkerSummary = DataProcessing.NoHTML(SperkerSummary);
            //            SperkerSummary = SperkerSummary.Replace("![CDATA[", "");
            //            SperkerSummary = SperkerSummary.Replace("]]", "");
            //            SperkerSummary = SperkerSummary.Replace("<", "");
            //            SperkerSummary = SperkerSummary.Replace(">", "");
            //            TopSpeakerSummary.Text = DataProcessing.SubstringText(SperkerSummary,45);
            //        }
            //        catch (Exception eXML)
            //        {

            //        }
            //    }

            //}
            // 相关列表
            string SearchContent   = "Author like '%" + CourseSperker + "%'";
            string RelatedQueryStr = "SELECT Top 10 ArticleGUID,Title,Author,Area as SpeakerInfo,Filename,CreateTime FROM ArticleCurrent Where " + SearchContent;

            using (SqlConnection connection =
                       new SqlConnection(connectingString))
            {
                SqlCommand command = new SqlCommand(RelatedQueryStr, connection);
                connection.Open();
                SqlDataReader CourseReder = command.ExecuteReader();
                DataTable     CourseTable = new DataTable();
                CourseTable.Load(CourseReder);
                CoursesWithSperker.DataSource = CourseTable;
                CoursesWithSperker.DataBind();
            }
            if (CourseKeyWord != null)
            {
                CourseKeyWord   = CourseKeyWord.Replace(" ", ",");
                SearchContent   = new DAL.CategoryDAL().GetArticleSearchContent(CourseKeyWord);
                RelatedQueryStr = "SELECT Top 10 ArticleGUID,Title,Author,Area as SpeakerInfo,Filename,CreateTime FROM ArticleCurrent Where " + SearchContent;
                using (SqlConnection connection =
                           new SqlConnection(connectingString))
                {
                    SqlCommand command = new SqlCommand(RelatedQueryStr, connection);
                    connection.Open();
                    SqlDataReader CourseReder = command.ExecuteReader();
                    DataTable     CourseTable = new DataTable();
                    CourseTable.Load(CourseReder);
                    CoursesWithTitle.DataSource = CourseTable;
                    CoursesWithTitle.DataBind();
                }
            }
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            url = "http://" + Request.Url.Authority + Request.ApplicationPath + "/";
            DataTable NewsList1Video = DataQuery.GetArticleListFromAlias("gxchannel9_topics_1_1", false, "desc", 0, 4);
            DataTable NewsList1Other = DataQuery.GetArticleListFromAlias("gxchannel9_topics_1_1", false, "desc", 4, 8);

            if (NewsList1Video.Rows.Count > 0)
            {
                Level2NewsList1Video.DataSource = NewsList1Video;
                Level2NewsList1Video.DataBind();
                Level2NewsList1Other.DataSource = NewsList1Other;
                Level2NewsList1Other.DataBind();
            }
            //
            DataTable NewsList2Video = DataQuery.GetArticleListFromAlias("gxchannel9_topics_6_1", false, "desc", 0, 4);
            DataTable NewsList2Other = DataQuery.GetArticleListFromAlias("gxchannel9_topics_6_1", false, "desc", 4, 8);

            if (NewsList2Video.Rows.Count > 0)
            {
                Level2NewsList2Video.DataSource = NewsList1Video;
                Level2NewsList2Video.DataBind();
                Level2NewsList2Other.DataSource = NewsList1Other;
                Level2NewsList2Other.DataBind();
            }
            //
            string    FameListAlias          = DataQuery.GetChannelAliasByName("gxchannel10", "名家谈时事");
            DataTable Lv2NewsListLeftCourses = DataQuery.GetArticleListFromAlias(FameListAlias, false, "desc", 0, 5);

            Lv2NewsListLeft.DataSource = Lv2NewsListLeftCourses;
            Lv2NewsListLeft.DataBind();
            //改别名
            DataTable Lv2NewsList3BottomInfo = DataQuery.GetArticleListFromAlias("gxchannel9_topics_1_1", false, "desc", 0, 3);

            Level2NewsList3Bottom.DataSource = Lv2NewsList3BottomInfo;
            Level2NewsList3Bottom.DataBind();
            DataTable Lv2NewsList4BottomInfo = DataQuery.GetArticleListFromAlias("gxchannel9_topics_1_1", false, "desc", 0, 3);

            Level2NewsList4Bottom.DataSource = Lv2NewsList4BottomInfo;
            Level2NewsList4Bottom.DataBind();
            //
            DataTable Lv2NewsList5Info = DataQuery.GetArticleListFromAlias("gxchannel9_topics_3_1", false, "desc", 0, 5);

            Level2NewsList5.DataSource = Lv2NewsList5Info;
            Level2NewsList5.DataBind();
            Level2NewsList5Image.ImageUrl = DataQuery.GetCoursePicPath(Lv2NewsList5Info.Rows[0][0].ToString(), url, "001.jpg");
            DataTable Lv2NewsList6Info = DataQuery.GetArticleListFromAlias("gxchannel9_topics_5_1", false, "desc", 0, 5);

            Level2NewsList6.DataSource = Lv2NewsList6Info;
            Level2NewsList6.DataBind();
            Level2NewsList6Image.ImageUrl = DataQuery.GetCoursePicPath(Lv2NewsList6Info.Rows[0][0].ToString(), url, "001.jpg");
            DataTable Lv2NewsList7Info = DataQuery.GetArticleListFromAlias("gxchannel9_topics_4_1", false, "desc", 0, 5);

            Level2NewsList7.DataSource = Lv2NewsList7Info;
            Level2NewsList7.DataBind();
            Level2NewsList7Image.ImageUrl = DataQuery.GetCoursePicPath(Lv2NewsList7Info.Rows[0][0].ToString(), url, "001.jpg");
            //改别名
            DataTable Level2NewsList8Info = DataQuery.GetArticleListFromAlias("gxchannel9_topics_1_1", false, "desc", 0, 3);

            Level2NewsList8.DataSource = Level2NewsList8Info;
            Level2NewsList8.DataBind();
            //改别名
            DataTable Level2NewsList9Info = DataQuery.GetArticleListFromAlias("gxchannel9_topics_1_1", false, "desc", 0, 5);

            Level2NewsList9.DataSource = Level2NewsList9Info;
            Level2NewsList9.DataBind();
        }