/// <summary> /// 递归找到父节点 /// </summary> private void LoopChannelMenu(StringBuilder strTxt, string urlKey, int category_id) { BLL.article_category bll = new BLL.article_category(); int parentId = bll.GetParentId(category_id); if (parentId > 0) { this.LoopChannelMenu(strTxt, urlKey, parentId); } strTxt.Append(" > <a href=\"" + linkurl(urlKey, category_id, 1) + "\">" + bll.GetTitle(category_id) + "</a>"); }
/// <summary> /// 获取最初始的类别id /// </summary> /// <param name="category_id"></param> /// <returns></returns> protected int ret_fist_category( int category_id ) { BLL.article_category bll = new BLL.article_category(); int parentId = bll.GetParentId( category_id ); if( parentId > 0 ) { category_id= this.ret_fist_category( parentId ); } return category_id; }
/// <summary> /// 获取最初始的类别id /// </summary> /// <param name="category_id"></param> /// <returns></returns> protected int ret_fist_category(int category_id) { BLL.article_category bll = new BLL.article_category(); int parentId = bll.GetParentId(category_id); if (parentId > 0) { category_id = this.ret_fist_category(parentId); } return(category_id); }
/// <summary> /// 递归找到父节点 /// </summary> private void LoopChannelMenu(StringBuilder strTxt, string urlKey, int category_id) { BLL.article_category bll = new BLL.article_category(); int parentId = bll.GetParentId(category_id); if (parentId > 0) { this.LoopChannelMenu(strTxt, urlKey, parentId); } HttpCookie cookie = HttpContext.Current.Request.Cookies["lang"]; string lang = cookie != null ? cookie.Value : "pl-PL"; if ("pl-PL".Equals(lang)) { strTxt.Append(" > <a href=\"" + linkurl(urlKey, category_id, 1) + "\">" + bll.GetSeoTitle(category_id) + "</a>"); } else { strTxt.Append(" > <a href=\"" + linkurl(urlKey, category_id, 1) + "\">" + bll.GetTitle(category_id) + "</a>"); } }
/// <summary> /// 返回父id /// </summary> /// <param name="category_id"></param> /// <returns></returns> protected int get_category_parent_id(string category_id) { BLL.article_category bll = new BLL.article_category(); return(bll.GetParentId(Convert.ToInt32(category_id))); }
/// <summary> /// 返回父id /// </summary> /// <param name="category_id"></param> /// <returns></returns> protected int get_category_parent_id(int category_id) { BLL.article_category bll = new BLL.article_category(); return(bll.GetParentId(category_id)); }