/// <summary> /// 获取二级菜单 /// </summary> /// <param name="id"></param> /// <returns></returns> public static string GetMenuChildById(int id) { if (id == 123) { return(string.Empty); } StringBuilder rStr = new StringBuilder(); BLL.contents.article_category bll = new BLL.contents.article_category(); DataTable dt = bll.GetChildList(id, 6); if (dt != null && dt.Rows.Count > 0) { int num = 1; for (int i = 0; i < dt.Rows.Count; i++) { if (i < 3) { rStr.Append("<li class=\"li" + num + "\">"); rStr.Append("<a href=\"" + dt.Rows[i]["link_url"] + "?fId=" + dt.Rows[i]["parent_id"] + "&cId=" + dt.Rows[i]["id"] + "\">"); rStr.Append(dt.Rows[i]["title"].ToString()); rStr.Append("</a>"); rStr.Append("</li>"); } else { if (i == 3) { rStr.Append("<li><a id=\"a\" href=\"#\">更多</a></li>"); rStr.Append(" <ul id=\"ul1\" class=\"dis\">"); rStr.Append(" <li><a href=\"" + dt.Rows[i]["link_url"] + "?fId=" + dt.Rows[i]["parent_id"] + "&cId=" + dt.Rows[i]["id"] + "\">" + dt.Rows[i]["title"] + "</a></li>"); } else if (i == dt.Rows.Count - 1) { rStr.Append("<li><a href=\"" + dt.Rows[i]["link_url"] + "?fId=" + dt.Rows[i]["parent_id"] + "&cId=" + dt.Rows[i]["id"] + "\">" + dt.Rows[i]["title"] + "</a></li>"); rStr.Append("</ul>"); } else { rStr.Append("<li><a href=\"" + dt.Rows[i]["link_url"] + "?fId=" + dt.Rows[i]["parent_id"] + "&cId=" + dt.Rows[i]["id"] + "\">" + dt.Rows[i]["title"] + "</a></li>"); } } if (i < dt.Rows.Count - 1) { rStr.Append("| "); } num++; } } return(rStr.ToString()); }
public static string GetMenuChildUrl(int cid) { BLL.contents.article_category bll = new BLL.contents.article_category(); int id = bll.GetParentId(cid); StringBuilder rStr = new StringBuilder(); DataTable dt = bll.GetChildList(id, 6); if (dt != null && dt.Rows.Count > 0) { int num = 1; for (int i = 0; i < dt.Rows.Count; i++) { if (Convert.ToInt32(dt.Rows[i]["id"]) == cid) { rStr.Append(GetPageNameUrl(Convert.ToInt32(dt.Rows[i]["id"]))); rStr.Append("?IdF=" + dt.Rows[i]["parent_id"] + "&id=" + dt.Rows[i]["id"] + "&mId=" + num); } num++; } } return(rStr.ToString()); }
/// <summary> /// 获取二级菜单English /// </summary> /// <param name="id"></param> /// <returns></returns> public static string GetMenuChild_En(int id) { StringBuilder rStr = new StringBuilder(); BLL.contents.article_category bll = new BLL.contents.article_category(); DataTable dt = bll.GetChildList(id, 6); if (dt != null && dt.Rows.Count > 0) { int num = 1; for (int i = 0; i < dt.Rows.Count; i++) { if (!string.IsNullOrEmpty(dt.Rows[i]["link_url"].ToString())) { rStr.Append("<dd><a id=\"child" + num + "\" href=\"" + dt.Rows[i]["link_url"]); rStr.Append("?IdF=" + dt.Rows[i]["parent_id"] + "&id=" + dt.Rows[i]["id"] + "&mId=" + num + "\"><i>></i>" + dt.Rows[i]["title"].ToString() + "</a></dd>"); num++; } } } return(rStr.ToString()); }
/// <summary> /// 获取二级菜单 /// </summary> /// <param name="id"></param> /// <returns></returns> public static string GetMenuChild(int id) { StringBuilder rStr = new StringBuilder(); BLL.contents.article_category bll = new BLL.contents.article_category(); DataTable dt = bll.GetChildList(id, 6); if (dt != null && dt.Rows.Count > 0) { int num = 1; for (int i = 0; i < dt.Rows.Count; i++) { rStr.Append("<li class=\"li" + num + "\">"); rStr.Append("<a href=\"" + dt.Rows[i]["link_url"] + "?fId=" + dt.Rows[i]["parent_id"] + "&cId=" + dt.Rows[i]["id"] + "\">"); rStr.Append(dt.Rows[i]["title"].ToString()); rStr.Append("</a>"); rStr.Append("</li>"); num++; } } return(rStr.ToString()); }
/// <summary> /// 获取二级菜单English /// </summary> /// <param name="id"></param> /// <returns></returns> public static string GetMenuChild_En(int id) { StringBuilder rStr = new StringBuilder(); BLL.contents.article_category bll = new BLL.contents.article_category(); DataTable dt = bll.GetChildList(id, 6); if (dt != null && dt.Rows.Count > 0) { int num = 1; for (int i = 0; i < dt.Rows.Count; i++) { if (!string.IsNullOrEmpty(dt.Rows[i]["link_url"].ToString())) { rStr.Append("<dd><a id=\"child" + num + "\" href=\"" + dt.Rows[i]["link_url"]); rStr.Append("?IdF=" + dt.Rows[i]["parent_id"] + "&id=" + dt.Rows[i]["id"] + "&mId=" + num + "\"><i>></i>" + dt.Rows[i]["title"].ToString() + "</a></dd>"); num++; } } } return rStr.ToString(); }
public static string GetMenuChildUrl(int cid) { BLL.contents.article_category bll = new BLL.contents.article_category(); int id = bll.GetParentId(cid); StringBuilder rStr = new StringBuilder(); DataTable dt = bll.GetChildList(id, 6); if (dt != null && dt.Rows.Count > 0) { int num = 1; for (int i = 0; i < dt.Rows.Count; i++) { if (Convert.ToInt32(dt.Rows[i]["id"]) == cid) { rStr.Append(GetPageNameUrl(Convert.ToInt32(dt.Rows[i]["id"]))); rStr.Append("?IdF=" + dt.Rows[i]["parent_id"] + "&id=" + dt.Rows[i]["id"] + "&mId=" + num); } num++; } } return rStr.ToString(); }
/// <summary> /// 获取二级菜单 /// </summary> /// <param name="id"></param> /// <returns></returns> public static string GetMenuChildById(int id) { if (id == 123) { return string.Empty; } StringBuilder rStr = new StringBuilder(); BLL.contents.article_category bll = new BLL.contents.article_category(); DataTable dt = bll.GetChildList(id, 6); if (dt != null && dt.Rows.Count > 0) { int num = 1; for (int i = 0; i < dt.Rows.Count; i++) { if (i < 3) { rStr.Append("<li class=\"li" + num + "\">"); rStr.Append("<a href=\"" + dt.Rows[i]["link_url"] + "?fId=" + dt.Rows[i]["parent_id"] + "&cId=" + dt.Rows[i]["id"] + "\">"); rStr.Append(dt.Rows[i]["title"].ToString()); rStr.Append("</a>"); rStr.Append("</li>"); } else { if (i == 3) { rStr.Append("<li><a id=\"a\" href=\"#\">更多</a></li>"); rStr.Append(" <ul id=\"ul1\" class=\"dis\">"); rStr.Append(" <li><a href=\"" + dt.Rows[i]["link_url"] + "?fId=" + dt.Rows[i]["parent_id"] + "&cId=" + dt.Rows[i]["id"] + "\">" + dt.Rows[i]["title"] + "</a></li>"); } else if (i == dt.Rows.Count - 1) { rStr.Append("<li><a href=\"" + dt.Rows[i]["link_url"] + "?fId=" + dt.Rows[i]["parent_id"] + "&cId=" + dt.Rows[i]["id"] + "\">" + dt.Rows[i]["title"] + "</a></li>"); rStr.Append("</ul>"); } else { rStr.Append("<li><a href=\"" + dt.Rows[i]["link_url"] + "?fId=" + dt.Rows[i]["parent_id"] + "&cId=" + dt.Rows[i]["id"] + "\">" + dt.Rows[i]["title"] + "</a></li>"); } } if (i < dt.Rows.Count - 1) { rStr.Append("| "); } num++; } } return rStr.ToString(); }
/// <summary> /// 获取二级菜单 /// </summary> /// <param name="id"></param> /// <returns></returns> public static string GetMenuChild(int id) { StringBuilder rStr = new StringBuilder(); BLL.contents.article_category bll = new BLL.contents.article_category(); DataTable dt = bll.GetChildList(id, 6); if (dt != null && dt.Rows.Count > 0) { int num = 1; for (int i = 0; i < dt.Rows.Count; i++) { rStr.Append("<li class=\"li" + num + "\">"); rStr.Append("<a href=\"" + dt.Rows[i]["link_url"] + "?fId=" + dt.Rows[i]["parent_id"] + "&cId=" + dt.Rows[i]["id"] + "\">"); rStr.Append(dt.Rows[i]["title"].ToString()); rStr.Append("</a>"); rStr.Append("</li>"); num++; } } return rStr.ToString(); }