public string RendHtml() { XmlNode node = TagsHelper.FindCommentNode(this.CommentId, "keyword"); StringBuilder builder = new StringBuilder(); if (node != null) { int categoryId = 0; int result = 0; int num3 = 0; int.TryParse(node.Attributes["CategoryId"].Value, out result); int.TryParse(node.Attributes["MaxNum"].Value, out num3); CategoryInfo category = CategoryBrowser.GetCategory(result); if (category != null) { categoryId = category.TopCategoryId; } DataTable hotKeywords = CommentBrowser.GetHotKeywords(categoryId, num3); builder.AppendFormat("<ul class=\"keyword cssEdite\" type=\"keyword\" id=\"comments_{0}\" >", this.CommentId).AppendLine(); if ((hotKeywords != null) && (hotKeywords.Rows.Count > 0)) { foreach (DataRow row in hotKeywords.Rows) { builder.AppendFormat("<li><a target=\"_blank\" href=\"{0}\">{1}</a></li>", Globals.GetSiteUrls().SubCategory((int)row["CategoryId"], null) + "?keywords=" + Globals.UrlEncode((string)row["Keywords"]), row["Keywords"]).AppendLine(); } } builder.AppendLine("</ul>"); } return(builder.ToString()); }
private void RenderHeader(XmlNode node, StringBuilder sb) { sb.AppendLine("<div class=\"group_hd\">"); sb.AppendLine("<div>"); if (!string.IsNullOrEmpty(node.Attributes["ImageTitle"].Value)) { sb.AppendFormat("<span class=\"icon\"><img src=\"{0}\" /></span>", Globals.ApplicationPath + node.Attributes["ImageTitle"].Value); } if (!string.IsNullOrEmpty(node.Attributes["Title"].Value)) { sb.AppendFormat("<span class=\"title\">{0}</span>", node.Attributes["Title"].Value); } sb.AppendLine("</div>"); DataTable hotKeywords = CommentBrowser.GetHotKeywords(this.categoryId, int.Parse(node.Attributes["HotKeywordNum"].Value)); if ((hotKeywords != null) && (hotKeywords.Rows.Count > 0)) { sb.AppendLine("<ul>"); foreach (DataRow row in hotKeywords.Rows) { sb.AppendFormat("<li><a href=\"{0}\">{1}</a></li>", Globals.GetSiteUrls().SubCategory((int)row["CategoryId"], null) + "?keywords=" + Globals.UrlEncode((string)row["Keywords"]), row["Keywords"]).AppendLine(""); } sb.AppendLine("</ul>"); } if (node.Attributes["IsShowMoreLink"].Value == "true") { sb.AppendFormat("<em><a href=\"{0}\">更多>></a></em>", Globals.GetSiteUrls().SubCategory(this.categoryId, null)).AppendLine(); } sb.AppendLine("</div>"); }
public string RendHtml() { XmlNode xmlNode = TagsHelper.FindCommentNode(this.CommentId, "keyword"); StringBuilder stringBuilder = new StringBuilder(); if (xmlNode != null) { int categoryId = 0; int categoryId2 = 0; int hotKeywordsNum = 0; int.TryParse(xmlNode.Attributes["CategoryId"].Value, out categoryId2); int.TryParse(xmlNode.Attributes["MaxNum"].Value, out hotKeywordsNum); CategoryInfo category = CatalogHelper.GetCategory(categoryId2); if (category != null) { categoryId = category.TopCategoryId; } List <HotkeywordInfo> hotKeywords = CommentBrowser.GetHotKeywords(categoryId, hotKeywordsNum); stringBuilder.AppendFormat("<ul class=\"keyword cssEdite\" type=\"keyword\" id=\"comments_{0}\" >", this.CommentId).AppendLine(); if (hotKeywords != null && hotKeywords.Count > 0) { foreach (HotkeywordInfo item in hotKeywords) { stringBuilder.AppendFormat("<li><a target=\"_blank\" href=\"{0}\">{1}</a></li>", base.GetRouteUrl("subCategory", new { categoryId = item.CategoryId }) + "?keywords=" + Globals.UrlEncode(item.Keywords), item.Keywords).AppendLine(); } } stringBuilder.AppendLine("</ul>"); } return(stringBuilder.ToString()); }
private void recordsone_ItemDataBound(object sender, RepeaterItemEventArgs e) { Control control = e.Item.Controls[0]; Repeater repeater = (Repeater)control.FindControl("recordstwo"); HtmlInputHidden htmlInputHidden = (HtmlInputHidden)control.FindControl("hidMainCategoryId"); int mainCategoryId = int.Parse(htmlInputHidden.Value); Repeater repeater2 = (Repeater)control.FindControl("recordsbrands"); Repeater repeater3 = (Repeater)control.FindControl("rphotkey"); Repeater recordTwoCategory = (Repeater)control.FindControl("recordTwoCategory"); Repeater recordtwoHotBuyProduct = (Repeater)control.FindControl("recordtwoHotBuyProduct"); repeater2.DataSource = CategoryBrowser.GetBrandCategories(mainCategoryId, 12); repeater2.DataBind(); repeater.DataSource = CategoryBrowser.GetMaxSubCategories(mainCategoryId, 0, 1000); repeater.DataBind(); if (repeater3 != null) { repeater3.DataSource = CommentBrowser.GetHotKeywords(mainCategoryId, 12); repeater3.DataBind(); } if (recordTwoCategory != null) { recordTwoCategory.DataSource = CategoryBrowser.GetMaxSubCategories(mainCategoryId, 0, 1000); recordTwoCategory.DataBind(); } if (recordtwoHotBuyProduct != null) { recordtwoHotBuyProduct.DataSource = ProductBrowser.GetHotBuyProduct(mainCategoryId); recordtwoHotBuyProduct.DataBind(); } }
protected override void OnLoad(EventArgs e) { int.TryParse(this.Page.Request.QueryString["CategoryId"], out this.categoryId); CategoryInfo category = CategoryBrowser.GetCategory(this.categoryId); if (category != null) { this.topCategoryId = category.TopCategoryId; } base.DataSource = CommentBrowser.GetHotKeywords(this.topCategoryId, this.MaxNum); base.DataBind(); }
public string RendHtml() { XmlNode xmlNode = TagsHelper.FindCommentNode(this.CommentId, "keyword"); StringBuilder stringBuilder = new StringBuilder(); if (xmlNode != null) { int categoryId = 0; int categoryId2 = 0; int hotKeywordsNum = 0; int.TryParse(xmlNode.Attributes["CategoryId"].Value, out categoryId2); int.TryParse(xmlNode.Attributes["MaxNum"].Value, out hotKeywordsNum); CategoryInfo category = CategoryBrowser.GetCategory(categoryId2); if (category != null) { categoryId = category.TopCategoryId; } //DataTable hotKeywords = CommentBrowser.GetHotKeywords(categoryId, hotKeywordsNum); DataTable hotKeywords = CommentBrowser.GetHotKeywords(categoryId, hotKeywordsNum, ClientType.PC); stringBuilder.AppendFormat("<ul class=\"keyword cssEdite\" type=\"keyword\" id=\"comments_{0}\" >", this.CommentId).AppendLine(); if (hotKeywords != null && hotKeywords.Rows.Count > 0) { foreach (DataRow dataRow in hotKeywords.Rows) { if (dataRow["CategoryId"] != DBNull.Value) { stringBuilder.AppendFormat("<li><a target=\"_blank\" href=\"{0}\">{1}</a></li>", Globals.GetSiteUrls().SubCategory((int)dataRow["CategoryId"], null) + "?keywords=" + Globals.UrlEncode((string)dataRow["Keywords"]), dataRow["Keywords"]).AppendLine(); } else { stringBuilder.AppendFormat("<li><a target=\"_blank\" href=\"{0}\">{1}</a></li>", "/SubCategory.aspx?keywords=" + Globals.UrlEncode((string)dataRow["Keywords"]), dataRow["Keywords"]).AppendLine(); } } } stringBuilder.AppendLine("</ul>"); } return(stringBuilder.ToString()); }
private void recordsone_ItemDataBound(object sender, RepeaterItemEventArgs e) { Control control = e.Item.Controls[0]; Repeater repeater = (Repeater)control.FindControl("recordstwo"); Repeater repeater2 = (Repeater)control.FindControl("repMainTow"); HtmlInputHidden htmlInputHidden = (HtmlInputHidden)control.FindControl("hidMainCategoryId"); Repeater repeater3 = (Repeater)control.FindControl("recordsbrands"); Repeater repeater4 = (Repeater)control.FindControl("rphotkey"); repeater3.DataSource = CatalogHelper.GetBrandCategories(int.Parse(htmlInputHidden.Value), 12); repeater3.DataBind(); Repeater repeater5 = repeater2; Repeater repeater6 = repeater; object obj2 = repeater5.DataSource = (repeater6.DataSource = CatalogHelper.GetSubCategories(int.Parse(htmlInputHidden.Value))); repeater.DataBind(); repeater2.DataBind(); if (repeater4 != null) { repeater4.DataSource = CommentBrowser.GetHotKeywords(int.Parse(htmlInputHidden.Value), 12); repeater4.DataBind(); } }