using System; using System.Data; using System.Configuration; using System.Collections; using System.Collections.Generic; using System.Text; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using yestem.webplug.Utility; public partial class index : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.lbTopNews.Text = GetTopPostNews(12, 1, 2); this.lbTopList.Text = GetTopPostList(12, 4, 1); this.lbHotSales.Text = GetDownLoad(13, 1); this.lbTeamService.Text = GetDownLoad(14, 1); } this.webDomain.Value = GetSearchUrl("common_cn/index.aspx?nodeid=8"); } public string GetSearchUrl(string searchUrl) { return ConfigurationManager.AppSettings["WebSiteDomain"] + ConfigurationManager.AppSettings["TempletPath"] + searchUrl; } public string GetTopPostNews(int nodeid,int top,int select) { List SingleNews = NaviDAO.GetTopPostContent(nodeid, top, select); StringBuilder strHtmlTopPostNews = new StringBuilder(); if (SingleNews != null && SingleNews.Count>0) { strHtmlTopPostNews.Append(String.Format("

{1}

", NaviBLL.GetPicPath(SingleNews[0].Picture, "small"), SingleNews[0].Title)); strHtmlTopPostNews.Append(String.Format("{1}

", NaviBLL.GetUrl(SingleNews[0].NodeID.ToString(), SingleNews[0].ItemUrl, SingleNews[0].TempletPath, SingleNews[0].TempletFile, SingleNews[0].ItemID.ToString()), Universal.MaxLengthText(NaviBLL.RemovePreTarget(SingleNews[0].Brief, "p"), 65))); strHtmlTopPostNews.Append(String.Format("
", NaviBLL.GetUrl(SingleNews[0].NodeID.ToString(), SingleNews[0].ItemUrl, SingleNews[0].TempletPath, SingleNews[0].TempletFile, SingleNews[0].ItemID.ToString()))); } return strHtmlTopPostNews.ToString(); } public string GetTopPostList(int nodeid, int top, int select) { List listNews = NaviDAO.GetTopPostContent(nodeid, top, select); StringBuilder strHtmlListNews = new StringBuilder(); if (listNews != null && listNews.Count > 0) { strHtmlListNews.Append(""); } return strHtmlListNews.ToString(); } public string GetDownLoad(int nodeid, int top) { List downLoad = NaviDAO.GetContentByNode(nodeid, top); StringBuilder strHtmlDown = new StringBuilder(); if (downLoad != null && downLoad.Count > 0) { strHtmlDown.Append(String.Format("

{0}

{2}

", Universal.MaxLengthText(downLoad[0].Title, 10), NaviBLL.GetUrl(downLoad[0].NodeID.ToString(), downLoad[0].ItemUrl, downLoad[0].TempletPath, downLoad[0].TempletFile, downLoad[0].ItemID.ToString()), Universal.MaxLengthText(NaviBLL.RemovePreTarget(downLoad[0].Brief, "p"),25))); strHtmlDown.Append(String.Format("

阅读详情 >>

", NaviBLL.GetUrl(downLoad[0].NodeID.ToString(), downLoad[0].ItemUrl, downLoad[0].TempletPath, downLoad[0].TempletFile, downLoad[0].ItemID.ToString()))); strHtmlDown.Append(String.Format("

", NaviBLL.GetAccessroy(downLoad[0].Accessroy))); } return strHtmlDown.ToString(); } }