protected void Page_Load(object sender, EventArgs e) { CacheTest.Text = DateTime.Now.ToString(); url = "http://" + Request.Url.Authority + Request.ApplicationPath + "/"; //图片新闻 // Text string NewsCommendAlias = ConfigurationManager.AppSettings["NewsCommendAlias"]; DataTable NewsCommendText = new DataTable(); NewsCommendText = DataQuery.GetSubCategories(NewsCommendAlias); FocusTabsTxt.DataSource = NewsCommendText; FocusTabsTxt.DataBind(); // Pic if (NewsCommendText.Rows.Count > 0) { DataTable NewsCommendPic = new DataTable(); //NewsCommendPic = new DAL.Article().GetArticleList(NewsCommendText.Rows[0][1].ToString(),false,1); //缓存 NewsCommendPic = DataQuery.ArticleQuery("", "1", NewsCommendText.Rows[0][2].ToString()).Tables[0]; if (NewsCommendPic != null) { NewsCommendPic.Columns.Add("FocusTabsIndex", typeof(String)); NewsCommendPic.Rows[0]["FocusTabsIndex"] = NewsCommendText.Rows[0]["XIndex"]; DataTable NewsCommendPicMerge = new DataTable(); for (int i = 1; i < NewsCommendText.Rows.Count; i++) { //NewsCommendPicMerge = new DAL.Article().GetArticleList(NewsCommendText.Rows[i][1].ToString(),false,1); //缓存 NewsCommendPicMerge = DataQuery.ArticleQuery("", "1", NewsCommendText.Rows[i][2].ToString()).Tables[0]; NewsCommendPicMerge.Columns.Add("FocusTabsIndex", typeof(String)); NewsCommendPicMerge.Rows[0]["FocusTabsIndex"] = NewsCommendText.Rows[i]["XIndex"]; NewsCommendPic.Merge(NewsCommendPicMerge); } FocusTabsPic.DataSource = NewsCommendPic; FocusTabsPic.DataBind(); } } //特别关注 string SubjectGUID = DataQuery.CategoryAliasToID(ConfigurationManager.AppSettings["TBGZ_Alias"]); string SubjectPath = DataQuery.CategoryPath(SubjectGUID); //专题路径 DataTable HotSubjects = new DataTable(); HotSubjects = DataQuery.GetNHotZT(); // 获取课件 //string SubjectHotGUID = DataQuery.CategoryAliasToID(ConfigurationManager.AppSettings["SAHot_Alias"]); // string SubjectHotPath = DataQuery.CategoryPath(SubjectGUID); DataTable HotCoursesMerge = new DataTable(); // 第一个专题 if (HotSubjects.Rows.Count > 0) { //string SubjectHotItemPath = SubjectPath + "/" + HotSubjects.Rows[0][0].ToString(); // DataTable HotCourses = new DAL.CategoryDAL().GetArticleIndexList(SubjectHotItemPath, "最新动态", 2, false); string HotSubjectAlias = DataQuery.CategoryIDToAlias(HotSubjects.Rows[0][0].ToString()); string SubjectNewAlias = DataQuery.GetChannelAliasByName(HotSubjectAlias, "最新动态"); string SubjectNewGuid = DataQuery.CategoryAliasToID(SubjectNewAlias); DataTable HotCourses = new DAL.Article().GetArticleList(SubjectNewGuid, false, 2); HotCourses.Columns.Add("SubjectID", Type.GetType("System.String")); HotCourses.Columns.Add("SubjectTitle", Type.GetType("System.String")); for (int i = 0; i < HotCourses.Rows.Count; i++) { HotCourses.Rows[i]["SubjectID"] = HotSubjects.Rows[0][0].ToString(); HotCourses.Rows[i]["SubjectTitle"] = HotSubjects.Rows[0][1].ToString(); } // 后N个专题 for (int i = 1; i < HotSubjects.Rows.Count; i++) { //SubjectHotItemPath = SubjectPath + "/" + HotSubjects.Rows[i][0].ToString(); //HotCoursesMerge = new DAL.CategoryDAL().GetArticleIndexList(SubjectHotItemPath, "最新动态", 2, false); HotSubjectAlias = DataQuery.CategoryIDToAlias(HotSubjects.Rows[i][0].ToString()); SubjectNewGuid = DataQuery.GetSubChannelGuidByName(HotSubjectAlias, "最新动态"); HotCoursesMerge = new DAL.Article().GetArticleList(SubjectNewGuid, false, 2); HotCoursesMerge.Columns.Add("SubjectID", Type.GetType("System.String")); HotCoursesMerge.Columns.Add("SubjectTitle", Type.GetType("System.String")); for (int j = 0; j < HotCoursesMerge.Rows.Count; j++) { HotCoursesMerge.Rows[j]["SubjectID"] = HotSubjects.Rows[i][0].ToString(); HotCoursesMerge.Rows[j]["SubjectTitle"] = HotSubjects.Rows[i][1].ToString(); } HotCourses.Merge(HotCoursesMerge); } SpecialFocusContent.DataSource = HotCourses; SpecialFocusContent.DataBind(); } //时事新闻 DataTable HomeTopDataTable1 = new DataTable(); string HomeNews1Guid = DataQuery.CategoryAliasToID(ConfigurationManager.AppSettings["HomeTop1Alias"]); HomeTopDataTable1 = new DAL.Article().GetArticleList(HomeNews1Guid, true, 1); if (HomeTopDataTable1 != null) { // //TopVideoPic1.ImageUrl = DataQuery.GetCoursePicPath(HomeTopDataTable1.Rows[0][0].ToString(), url, "000.jpg"); TopVideoLink1a.NavigateUrl = "ShowVideo.aspx?ID=" + HomeTopDataTable1.Rows[0][0].ToString(); TopVideoLink1b.NavigateUrl = "ShowVideo.aspx?ID=" + HomeTopDataTable1.Rows[0][0].ToString(); string TopVideoLink1Title = HomeTopDataTable1.Rows[0][1].ToString(); string[] TopVideoLink1Array = TopVideoLink1Title.Split(new char[] { '[' }); TopVideoLink1Title = TopVideoLink1Array[1].Replace("]", ""); TopVideoLink1b.Text = TopVideoLink1Title; TopVideoText1.Text = DataProcessing.SubstringText(HomeTopDataTable1.Rows[0][10].ToString(), 26); // DataTable HomeTopDataTable2 = new DataTable(); string HomeNews2Guid = DataQuery.CategoryAliasToID(ConfigurationManager.AppSettings["HomeTop2Alias"]); HomeTopDataTable2 = new DAL.Article().GetArticleList(HomeNews2Guid, false, 1); //TopVideoPic2.ImageUrl = DataQuery.GetCoursePicPath(HomeTopDataTable2.Rows[0][0].ToString(), url, "000.jpg"); TopVideoLink2a.NavigateUrl = "ShowVideo.aspx?ID=" + HomeTopDataTable2.Rows[0][0].ToString(); TopVideoLink2b.NavigateUrl = "ShowVideo.aspx?ID=" + HomeTopDataTable2.Rows[0][0].ToString(); string TopVideoLink2Title = HomeTopDataTable2.Rows[0][1].ToString(); string[] TopVideoLink2Array = TopVideoLink2Title.Split(new char[] { '[' }); TopVideoLink2Title = TopVideoLink2Array[1].Replace("]", ""); TopVideoLink2b.Text = TopVideoLink2Title; string CSVPath = DataQuery.GetFileStreamPath(HomeTopDataTable2.Rows[0][0].ToString(), "vod/data.csv"); //string CSVPath = DataQuery.GetFileStreamPath(HomeTopDataTable2.Rows[0][0].ToString(), "vod/"); if (CSVPath != null) { DataTable CSVDataSrc = new DataTable(); try { CSVDataSrc = DataProcessing.ImportCSV(CSVPath); //CSVDataSrc = DataProcessing.getCsvData(CSVPath, "data.csv"); var CSVData = from row in CSVDataSrc.AsEnumerable() select row; CSVDataSrc = CSVData.Take(1).CopyToDataTable <DataRow>(); //DailyVideoInfoTextLines.DataSource = CSVDataSrc; //DailyVideoInfoTextLines.DataBind(); string CSVDataText = CSVDataSrc.Rows[0][5].ToString(); CSVDataText = CSVDataText.Remove(0, 1); TopVideoText2.Text = DataProcessing.SubstringText(CSVDataText, 26); } catch (Exception ex) { } } } //导航 string NaviList1Alias = ConfigurationManager.AppSettings["subject"]; DataTable NaviList1Items = DataQuery.GetSubCategories(NaviList1Alias, "9"); NaviList1.DataSource = NaviList1Items; NaviList1.DataBind(); string NaviList2Alias = ConfigurationManager.AppSettings["MAJOR"]; DataTable NaviList2Items = DataQuery.GetSubCategories(NaviList2Alias, "9"); NaviList2.DataSource = NaviList2Items; NaviList2.DataBind(); string NaviList3Alias = ConfigurationManager.AppSettings["INSTITUTION"]; DataTable NaviList3Items = DataQuery.GetSubCategories(NaviList3Alias, "9"); NaviList3.DataSource = NaviList3Items; NaviList3.DataBind(); //主列表 string ChannelListAliasA1 = ConfigurationManager.AppSettings["HomeChannelListA_CategoryAlias_1"]; WebModules.HomeChannelListA HomeChannelListA1 = new WebModules.HomeChannelListA(ChannelListAliasA1); ColumnShowSort1.DataSource = HomeChannelListA1.SubSortTable; ColumnShowSort1.DataBind(); ColumnVideo1.DataSource = HomeChannelListA1.PicInfo; ColumnVideo1.DataBind(); ColumnOtherL1.DataSource = HomeChannelListA1.TextInfoL; ColumnOtherL1.DataBind(); ColumnOtherR1.DataSource = HomeChannelListA1.TextInfoR; ColumnOtherR1.DataBind(); string ChannelListATitle1 = ConfigurationManager.AppSettings["HomeChannelListA_Title_1"]; ListATitle1.Text = ChannelListATitle1; ListALink1.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasA1; string ChannelListAliasA2 = ConfigurationManager.AppSettings["HomeChannelListA_CategoryAlias_2"]; WebModules.HomeChannelListA HomeChannelListA2 = new WebModules.HomeChannelListA(ChannelListAliasA2); ColumnShowSort2.DataSource = HomeChannelListA2.SubSortTable; ColumnShowSort2.DataBind(); ColumnVideo2.DataSource = HomeChannelListA2.PicInfo; ColumnVideo2.DataBind(); ColumnOtherL2.DataSource = HomeChannelListA2.TextInfoL; ColumnOtherL2.DataBind(); ColumnOtherR2.DataSource = HomeChannelListA2.TextInfoR; ColumnOtherR2.DataBind(); string ChannelListATitle2 = ConfigurationManager.AppSettings["HomeChannelListA_Title_2"]; ListATitle2.Text = ChannelListATitle2; ListALink2.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasA2; string ChannelListAliasA3 = ConfigurationManager.AppSettings["HomeChannelListA_CategoryAlias_3"]; WebModules.HomeChannelListA HomeChannelListA3 = new WebModules.HomeChannelListA(ChannelListAliasA3); ColumnShowSort3.DataSource = HomeChannelListA3.SubSortTable; ColumnShowSort3.DataBind(); ColumnVideo3.DataSource = HomeChannelListA3.PicInfo; ColumnVideo3.DataBind(); ColumnOtherL3.DataSource = HomeChannelListA3.TextInfoL; ColumnOtherL3.DataBind(); ColumnOtherR3.DataSource = HomeChannelListA3.TextInfoR; ColumnOtherR3.DataBind(); string ChannelListATitle3 = ConfigurationManager.AppSettings["HomeChannelListA_Title_3"]; ListATitle3.Text = ChannelListATitle3; ListALink3.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasA3; string ChannelListAliasA4 = ConfigurationManager.AppSettings["HomeChannelListA_CategoryAlias_4"]; WebModules.HomeChannelListA HomeChannelListA4 = new WebModules.HomeChannelListA(ChannelListAliasA4); ColumnShowSort4.DataSource = HomeChannelListA4.SubSortTable; ColumnShowSort4.DataBind(); ColumnVideo4.DataSource = HomeChannelListA4.PicInfo; ColumnVideo4.DataBind(); ColumnOtherL4.DataSource = HomeChannelListA4.TextInfoL; ColumnOtherL4.DataBind(); ColumnOtherR4.DataSource = HomeChannelListA4.TextInfoR; ColumnOtherR4.DataBind(); string ChannelListATitle4 = ConfigurationManager.AppSettings["HomeChannelListA_Title_4"]; ListATitle4.Text = ChannelListATitle4; ListALink4.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasA4; //右侧列表 string ChannelListAliasB2 = ConfigurationManager.AppSettings["HomeChannelListB_CategoryAlias_2"]; WebModules.HomeChannelListB HomeChannelListB2 = new WebModules.HomeChannelListB(ChannelListAliasB2, 1, 8); VerticalShowVideo2.DataSource = HomeChannelListB2.PicInfo; VerticalShowVideo2.DataBind(); VerticalShowList2.DataSource = HomeChannelListB2.TextInfo; VerticalShowList2.DataBind(); string ChannelListBTitle2 = ConfigurationManager.AppSettings["HomeChannelListB_Title_2"]; ListBTitle2.Text = ChannelListBTitle2; ListBLink2.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasB2; string ChannelListAliasB3 = ConfigurationManager.AppSettings["HomeChannelListB_CategoryAlias_3"]; WebModules.HomeChannelListB HomeChannelListB3 = new WebModules.HomeChannelListB(ChannelListAliasB3, 1, 4); VerticalShowVideo3.DataSource = HomeChannelListB3.PicInfo; VerticalShowVideo3.DataBind(); VerticalShowList3.DataSource = HomeChannelListB3.TextInfo; VerticalShowList3.DataBind(); string ChannelListBTitle3 = ConfigurationManager.AppSettings["HomeChannelListB_Title_3"]; ListBTitle3.Text = ChannelListBTitle3; ListBLink3.NavigateUrl = "level2.aspx?alias=" + ChannelListAliasB3; //右侧名家 string ChannelListAliasBS1 = ConfigurationManager.AppSettings["HomeChannelListBS_CategoryAlias_1"]; WebModules.HomeChannelListBS HomeChannelListBS1 = new WebModules.HomeChannelListBS(ChannelListAliasBS1, 2); VerticalShowVideo1.DataSource = HomeChannelListBS1.PicInfo; VerticalShowVideo1.DataBind(); string ChannelListBSTitle1 = ConfigurationManager.AppSettings["HomeChannelListBS_Title_1"]; ListBTitle1.Text = ChannelListBSTitle1; string FameAlias = ConfigurationManager.AppSettings["ChannelFame"]; ListBLink1.NavigateUrl = "level2.aspx?alias=" + FameAlias; //右侧公开课 string ChannelListAliasBS2 = ConfigurationManager.AppSettings["ChannelClass"]; //WebModules.HomeChannelListBS HomeChannelListBS2 = new WebModules.HomeChannelListBS(ChannelListAliasBS2, 2); //VerticalShowVideo4.DataSource = HomeChannelListBS2.PicInfo; //VerticalShowVideo4.DataBind(); //LeftList string Lv2ClassLeftListAlias = DataQuery.GetChannelAliasByName(ChannelListAliasBS2, "国内985大学"); DataTable Lv2ClassLeftList1Items = DataQuery.GetSubCategories(Lv2ClassLeftListAlias, "6"); TabIndex2List1.DataSource = Lv2ClassLeftList1Items; TabIndex2List1.DataBind(); //LeftList Lv2ClassLeftListAlias = DataQuery.GetChannelAliasByName(ChannelListAliasBS2, "国外大学"); DataTable Lv2ClassLeftList2Items = DataQuery.GetSubCategories(Lv2ClassLeftListAlias, "6"); TabIndex2List2.DataSource = Lv2ClassLeftList2Items; TabIndex2List2.DataBind(); //下方列表 string SkillListAlias = ConfigurationManager.AppSettings["HomeChannelListC_CategoryAlias"]; DataTable SkillCategoryInfo = DataQuery.GetSubCategoriesNote(DataQuery.GetChannelAliasByName(SkillListAlias, "栏目"), "8"); SkillTabs.DataSource = SkillCategoryInfo; SkillTabs.DataBind(); TabIndex1Box.DataSource = SkillCategoryInfo; TabIndex1Box.DataBind(); SkillNote.DataSource = SkillCategoryInfo; SkillNote.DataBind(); string ChannelListAliasD = ConfigurationManager.AppSettings["HomeChannelListD_CategoryAlias"]; WebModules.HomeChannelListC HomeChannelListC2 = new WebModules.HomeChannelListC(ChannelListAliasD); TrainList.DataSource = HomeChannelListC2.CategoryInfo; TrainList.DataBind(); // TEST //GridView1.DataSource = HomeChannelListA1.TextInfoL; //GridView1.DataBind(); }
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("<", "<"); // SperkerSummary = SperkerSummary.Replace(">", ">"); // 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(); } } }
private string GetLevel2Top() { //专题标题 string sTitle = Request.Form["Title"]; //专题简介 int iDescLength = 144; string sContent = new DAL.CategoryDAL().GetZTSummaryFromTitle(sZTSummaryAlias, sTitle); sContent = DAL.Article.RemoveHtml(sContent); string sDesc = sContent; if (sContent.Length > iDescLength) { sContent = sContent.Substring(0, iDescLength); sDesc = sDesc.Remove(0, iDescLength); if (sDesc.StartsWith(">")) { sDesc = sDesc.Remove(0, 1); } } //核心观点 DataTable dt1 = new DAL.CategoryDAL().GetArticleIndexList(sCategoryPath, "核心观点", 2, false); //最新动态 DataTable dt2 = new DAL.CategoryDAL().GetArticleIndexList(sCategoryPath, "最新动态", 2, false); string sDiv = ""; sDiv += string.Format("<div class=\"ZTLevel2ContentRightCenterTitle\">{0}</div>", sTitle); sDiv += string.Format("<div class=\"ZTSummary\" data-tooltip=\"{0}\" data-placement=\"bottom\">{1}</div>", string.IsNullOrEmpty(sDesc) ? string.Empty : string.Format("<div class='divTooltip'>{0}</div>", sDesc), sContent); sDiv += " <table class=\"SpecialAttentionNewTableXL\">"; sDiv += " <tr><td class=\"SpecialAttentionNewTableLineTitle\">核心观点</td>"; sDiv += " <td class=\"ZTNewTableTitleXL\">"; if (dt1.Rows.Count > 0) { sDiv += string.Format("<a href=\"ShowVideo.aspx?ID={0}\" title=\"{1}\" target=\"_blank\">{2}</a>", dt1.Rows[0]["ArticleGUID"].ToString(), dt1.Rows[0]["Title"].ToString(), DataProcessing.SubstringText(dt1.Rows[0]["Title"].ToString(), 35)); } sDiv += "</td>"; sDiv += "</tr><tr><td></td><td class=\"ZTNewTableTitleXL\">"; if (dt1.Rows.Count > 1) { sDiv += string.Format("<a href=\"ShowVideo.aspx?ID={0}\" title=\"{1}\" target=\"_blank\">{2}</a>", dt1.Rows[1]["ArticleGUID"].ToString(), dt1.Rows[1]["Title"].ToString(), DataProcessing.SubstringText(dt1.Rows[1]["Title"].ToString(), 35)); } sDiv += "</td>"; sDiv += "</tr><tr><td class=\"SpecialAttentionNewTableXLSpace\"></td></tr><tr><td class=\"SpecialAttentionNewTableLineTitle\">最新动态</td>"; sDiv += " <td class=\"ZTNewTableTitleXL\">"; if (dt2.Rows.Count > 0) { sDiv += string.Format("<a href=\"ShowVideo.aspx?ID={0}\" title=\"{1}\" target=\"_blank\">{2}</a>", dt2.Rows[0]["ArticleGUID"].ToString(), dt2.Rows[0]["Title"].ToString(), DataProcessing.SubstringText(dt2.Rows[0]["Title"].ToString(), 35)); } sDiv += "</td>"; sDiv += "</tr><tr><td></td><td class=\"ZTNewTableTitleXL\">"; if (dt2.Rows.Count > 1) { sDiv += string.Format("<a href=\"ShowVideo.aspx?ID={0}\" title=\"{1}\" target=\"_blank\">{2}</a>", dt2.Rows[1]["ArticleGUID"].ToString(), dt2.Rows[1]["Title"].ToString(), DataProcessing.SubstringText(dt2.Rows[1]["Title"].ToString(), 35)); } sDiv += "</td></tr></table>"; return(sDiv); }
//private string GetLevel2New() //{ // //最新动态 // int iDescLength = 360; // string sDiv = string.Empty; // string sDesc = string.Empty; // DataTable dt = new DAL.CategoryDAL().GetArticleIndexList(sCategoryPath, "最新动态", 3,true); // sDiv = "<div class=\"SpecialAttentionLv2NewLeft\">"; // for (int i = 0; i < dt.Rows.Count; i++) // { // sDiv += "<div class=\"SpecialAttentionLv2NewItem\">"; // sDiv += "<div class=\"SpecialAttentionLv2NewTitle\">"; // sDiv += string.Format("<a href=\"ShowVideo.aspx?ID={0}\" title=\"{1}\" target=\"_blank\">{1}</a>", dt.Rows[i]["ArticleGUID"].ToString(), dt.Rows[i]["Title"].ToString()); // sDiv += "</div>"; // string sContent = DAL.Article.RemoveHtml(dt.Rows[i]["Summary"].ToString()); // if (sContent.Length > iDescLength) { // sDesc = sContent.Remove(0, iDescLength); // sContent = sContent.Substring(0, iDescLength); // } // sDiv += string.Format("<div class=\"ZTSummary\" data-tooltip=\"{0}\" data-placement=\"bottom\">{1}</div>", string.IsNullOrEmpty(sDesc) ? string.Empty : string.Format("<div class='divTooltip'>{0}</div>", sDesc), sContent); // sDiv += "</div>"; // } // sDiv += "</div>"; // sDiv += "<div class=\"SpecialAttentionLv2NewRight\">"; // string strFilePath = System.Configuration.ConfigurationManager.AppSettings["FileRootPath"]; // string[] pathList = strFilePath.Split('|'); // for (int i = 0; i < dt.Rows.Count; i++) // { // if (i >= 2) break; // string picpath = string.Empty; // sDiv += "<div class=\"SpecialAttentionLv2NewRightItem\">"; // if (!string.IsNullOrEmpty(dt.Rows[i]["coursepicture"].ToString())) // { // foreach (string sPath in pathList) // { // string tempPath = sPath.Split(',')[1] + "\\" + dt.Rows[i]["Filename"].ToString(); // if (Directory.Exists(tempPath)) // { // string[] sTemp = dt.Rows[i]["coursepicture"].ToString().Split(','); // picpath = sPath.Split(',')[0] + "/" + dt.Rows[i]["Filename"].ToString() + "/" + sTemp[sTemp.Length-1]; // break; // } // } // } // sDiv += string.Format("<img src=\"{0}\" width=\"288px\" height=\"187px\">", picpath); // sDiv += "<div class=\"SpecialAttentionLv2NewRightItemTitle\">"; // sDiv += string.Format("<a href=\"ShowVideo.aspx?ID={0}\" title=\"{2}\" target=\"_blank\">{1} {2}</a>", dt.Rows[i]["ArticleGUID"].ToString(), dt.Rows[i]["Author"].ToString(), dt.Rows[i]["Title"].ToString()); // sDiv += "</div>"; // } // sDiv += "</div>"; // return sDiv; //} //CC private string GetLevel2New() { //最新动态 int iDescLength = 98; string sDiv = string.Empty; string sDesc = string.Empty; DataTable dt = new DAL.CategoryDAL().GetArticleIndexList(sCategoryPath, "最新动态", 9, true); sDiv = "<div class=\"SpecialAttentionLv2NewLeft\">"; for (int i = 3; i < dt.Rows.Count; i++) { sDiv += "<div class=\"SpecialAttentionLv2NewItem\">"; sDiv += "<div class=\"SpecialAttentionLv2NewTitle\">"; sDiv += string.Format("<a href=\"ShowVideo.aspx?ID={0}\" title=\"{1}\" target=\"_blank\">{1}</a>", dt.Rows[i]["ArticleGUID"].ToString(), dt.Rows[i]["Title"].ToString()); sDiv += "</div>"; string sContent = DAL.Article.RemoveHtml(dt.Rows[i]["Summary"].ToString()); if (sContent.Length > iDescLength) { sDesc = sContent.Remove(0, iDescLength); sContent = sContent.Substring(0, iDescLength); } sDiv += string.Format("<div class=\"ZTSummary\" data-tooltip=\"{0}\" data-placement=\"bottom\">{1}</div>", string.IsNullOrEmpty(sDesc) ? string.Empty : string.Format("<div class='divTooltip'>{0}</div>", sDesc), sContent); sDiv += "</div>"; } sDiv += "</div>"; sDiv += "<div class=\"SpecialAttentionLv2NewRight\">"; string strFilePath = System.Configuration.ConfigurationManager.AppSettings["FileRootPath"]; string[] pathList = strFilePath.Split('|'); for (int i = 0; i < 3; i++) { string picpath = string.Empty; sDiv += "<div class=\"SpecialAttentionLv2NewRightItem\">"; if (!string.IsNullOrEmpty(dt.Rows[i]["coursepicture"].ToString())) { foreach (string sPath in pathList) { string tempPath = sPath.Split(',')[1] + "\\" + dt.Rows[i]["Filename"].ToString(); if (Directory.Exists(tempPath)) { string[] sTemp = dt.Rows[i]["coursepicture"].ToString().Split(','); picpath = sPath.Split(',')[0] + "/" + dt.Rows[i]["Filename"].ToString() + "/" + sTemp[sTemp.Length - 1]; break; } } } sDiv += string.Format("<a href=\"ShowVideo.aspx?ID={0}\" title=\"{1}\" target=\"_blank\"><img src=\"{2}\" width=\"160px\" height=\"120px\" class=\"PicNoBorder\"></a>", dt.Rows[i]["ArticleGUID"].ToString(), dt.Rows[i]["Title"].ToString(), picpath); sDiv += "<div class=\"SpecialAttentionLv2NewRightItemTitle\">"; sDiv += string.Format("<a href=\"ShowVideo.aspx?ID={0}\" title=\"{1}\" target=\"_blank\">{2}</a>", dt.Rows[i]["ArticleGUID"].ToString(), dt.Rows[i]["Title"].ToString(), DataProcessing.SubstringText(dt.Rows[i]["Title"].ToString(), 17)); sDiv += "</div>"; } sDiv += "</div>"; return(sDiv); }
private string GetLastNew() { int iDescLength = 110; DataTable dt = new DAL.CategoryDAL().GetLastNewZT(sCategoryPath, iYIndex + 1); if (dt == null || dt.Rows.Count == 0) { return(string.Empty); } DataTable dtArticle = new DAL.Article().GetArticleList(dt.Rows[0]["CategoryGUID"].ToString(), false, 3); string sTitle = dt.Rows[0]["CategoryName"].ToString(); string sContent = new DAL.CategoryDAL().GetZTSummaryFromTitle(sZTSummaryAlias, sTitle); sContent = DAL.Article.RemoveHtml(sContent); string sDesc = sContent; if (sContent.Length > iDescLength) { sContent = sContent.Replace(" ", "");//*CC* sContent = sContent.Substring(0, iDescLength); sDesc = sDesc.Remove(0, iDescLength); if (sDesc.StartsWith(">")) { sDesc.Remove(0, 1); } } string sDiv = "<div class=\"SpecialAttentionNewLeft\">"; sDiv += string.Format("<a href=\"SpecialAttentionLite.aspx?ID={0}&Title={1}\" title=\"{2}\" target=\"_blank\">", dt.Rows[0]["CategoryGUID"].ToString(), HttpUtility.UrlEncode(sTitle), sTitle); sDiv += "<img width=\"276\" height=\"195\" src=\"ShowZTImage.aspx?Title=" + HttpUtility.UrlEncode(sTitle) + "\" alt=\"\" border=\"0\" /></a>"; sDiv += "</div><div class=\"SpecialAttentionNewRight\"><div class=\"SpecialAttentionNewTitle\">"; sDiv += string.Format("<a href=\"SpecialAttentionLite.aspx?ID={0}&Title={1}\" target=\"_blank\">{2}</a>", dt.Rows[0]["CategoryGUID"].ToString(), HttpUtility.UrlEncode(sTitle), DataProcessing.SubstringText(sTitle, 19)); //*CC* sDiv += "</div>"; sDiv += string.Format("<div class=\"ZTSummary\" data-tooltip=\"{0}\" data-placement=\"bottom\">", string.IsNullOrEmpty(sDesc) ? string.Empty : string.Format("<div class='divTooltip'>{0}</div>", sDesc)); sDiv += string.Format("<a href=\"SpecialAttentionLite.aspx?ID={0}&Title={1}\" target=\"_blank\">", dt.Rows[0]["CategoryGUID"].ToString(), HttpUtility.UrlEncode(sTitle)) + sContent + "</a>"; sDiv += "</div><table class=\"SpecialAttentionNewTable\" style=\"table-layout:fixed;\" width=\"355\">"; if (dtArticle.Rows.Count > 0) { for (int i = 0; i < dtArticle.Rows.Count; i++) { sDiv += "<tr><td class=\"SpecialAttentionNewTableTitle SpecialAttentionNewTableTitleZTTop\" style=\"overflow:hidden;text-overflow:ellipsis;white-space:nowrap;\">"; sDiv += string.Format("<a href=\"ShowVideo.aspx?ID={0}\" title=\"{1}\" target=\"_blank\">{2}</a></td>", dtArticle.Rows[i]["ArticleGUID"].ToString(), dtArticle.Rows[i]["Title"].ToString(), DataProcessing.SubstringText(dtArticle.Rows[i]["Title"].ToString(), 18));//*CC* sDiv += "<td align=\"right\">" + DateTime.Parse(dtArticle.Rows[i]["CreateTime"].ToString()).ToString("yyyy-MM-dd") + "</td></tr>"; } } sDiv += "</table></div>"; return(sDiv); }