Esempio n. 1
0
 //构造函数
 public GoodsCatForm(BathDBDataContext dc, GoodsCat goodsCat)
 {
     db = dc;
     if (goodsCat != null)
     {
         newGoodsCat = false;
         m_goodsCat  = goodsCat;
     }
     InitializeComponent();
 }
Esempio n. 2
0
    /// <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);
    }
Esempio n. 3
0
 public GoodsByCategory(GoodsCat x)
 {
     CatName = x.Name;
     Items   = x.Goods.Select(y => new Goods(y));
 }