//构造函数 public GoodsCatForm(BathDBDataContext dc, GoodsCat goodsCat) { db = dc; if (goodsCat != null) { newGoodsCat = false; m_goodsCat = goodsCat; } InitializeComponent(); }
/// <summary> /// 显示商品分类 /// </summary> /// <returns></returns> public static string ShowGoodCats() { int cid = HttpContext.Current.Request["cid"].ToArrowInt(); string result = ""; List <GoodsCatInfo> goodCats = new GoodsCat().SelectList("IsDel=0"); string format = "<li {2}><a href='{0}'>{1}</a></li>"; foreach (var model in goodCats) { string curStyle = model.ID == cid ? "class=\"cur\"" : ""; result += string.Format(format, "Mall.aspx?cid=" + model.ID, model.Name, curStyle); } return(result); }
public GoodsByCategory(GoodsCat x) { CatName = x.Name; Items = x.Goods.Select(y => new Goods(y)); }