/// <summary> /// 更新指定分类的有效商品数量 /// </summary> /// <param name="goodscategoryinfo">指定分类的信息</param> /// <returns>更新商品分类数</returns> public static bool UpdateCategoryGoodsCount(Goodscategoryinfo goodsCategoryInfo) { if (goodsCategoryInfo != null && goodsCategoryInfo.Categoryid > 0) { goodsCategoryInfo.Goodscount = Goods.GetGoodsCount(goodsCategoryInfo.Categoryid, ""); GoodsCategories.UpdateGoodsCategory(goodsCategoryInfo); return(true); } return(false); }
/// <summary> /// 更新分类的有效商品数量 /// </summary> /// <returns>更新商品分类数</returns> public static bool UpdateCategoryGoodsCount() { Goodscategoryinfo[] goodsArray = DTO.GetGoodsCategoryInfoArray(GoodsCategories.GetCategoriesTable()); if (goodsArray == null) { return(true); } foreach (Goodscategoryinfo goodsCategoryInfo in goodsArray) { if (goodsCategoryInfo != null && goodsCategoryInfo.Categoryid > 0) { goodsCategoryInfo.Goodscount = Goods.GetGoodsCount(goodsCategoryInfo.Categoryid, ""); GoodsCategories.UpdateGoodsCategory(goodsCategoryInfo); } } return(true); }