using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Text; using System.Data; namespace Mtxfw.shop { public partial class shop_category : System.Web.UI.Page { public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config(); public Mtxfw.DAL.P_Category daoCategory = new Mtxfw.DAL.P_Category(); public string categorys = ""; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Page.Title = "商品分类 - " + config.webName; Page.MetaDescription = "商品分类 - " + config.webName; Page.MetaKeywords = "商品分类," + config.webName; if (!String.IsNullOrEmpty(Request.QueryString["id"])) { int CategoryID = int.Parse(Request.QueryString["id"].ToString()); DataSet Ds_Productlb2 = daoCategory.GetList("(select count(c_id) from P_Category b where b.C_PARENTID=a.c_id) as acount,", "ttype=0 And IfShow=0 And C_PARENTID=" + CategoryID + " Order By C_LinkID Asc"); if (Ds_Productlb2.Tables[0].Rows.Count > 0) { foreach (System.Data.DataRow drv2 in Ds_Productlb2.Tables[0].Rows) { int acount = int.Parse(drv2["acount"].ToString()); categorys += "
  • 0 ? "category-" : "search-class-") + drv2["C_ID"].ToString() + ".html\">" + drv2["C_NAME"].ToString() + "
  • \n"; } } Ds_Productlb2.Clear(); } else { DataSet Ds_Productlb = daoCategory.GetList("", "ttype=0 And C_Layer=1 And IfShow=0 Order By C_LinkID Asc"); foreach (System.Data.DataRow drv in Ds_Productlb.Tables[0].Rows) { categorys += "
  • " + drv["C_NAME"].ToString() + "
  • \n"; } Ds_Productlb.Clear(); } } } } }