Example #1
0
        /// <summary>
        /// 递归找到父节点
        /// </summary>
        private void LoopChannelMenu(StringBuilder strTxt, string urlKey, string mark, int category_id)
        {
            BLL.article_category   bll   = new BLL.article_category();
            Model.article_category model = bll.Get(category_id);
            int parentId = model.parent_id;

            if (parentId > 0)
            {
                i++;
                this.LoopChannelMenu(strTxt, urlKey, mark, parentId);
            }
            string url = null;

            if (model.call_index != "")
            {
                url = linkurl(urlKey, model.call_index);
            }
            else
            {
                url = linkurl(urlKey, category_id);
            }
            strTxt.Append("<a href=\"" + url + "\">" + bll.GetTitle(category_id) + "</a>" + mark);
        }