/// <summary> /// 获取指定商品 /// </summary> /// <param name="productId"></param> /// <returns></returns> public BalePackProduct GetBalePackProductById(Guid productId) { BalePackProduct product = this.BalePackProducts.SingleOrDefault(s => s.ProductId == productId); #region # 验证 if (product == null) { throw new ArgumentOutOfRangeException("productId", string.Format("套餐品类下不存在Id为\"{0}\"的商品!", productId)); } #endregion return(product); }
/// <summary> /// 重新上架商品 /// </summary> /// <param name="productId">商品Id</param> public void ProductReShelfed(Guid productId) { BalePackProduct product = this.GetBalePackProductById(productId); product.ProductReShelfed(); }
/// <summary> /// 下架商品 /// </summary> /// <param name="productId">商品Id</param> public void ProductShelfOff(Guid productId) { BalePackProduct product = this.GetBalePackProductById(productId); product.ProductShelfOff(); }
/// <summary> /// 替换下架商品 /// </summary> /// <param name="shelfOffProductId">下架商品Id</param> /// <param name="productId">商品Id</param> public void ReplaceProduct(Guid shelfOffProductId, Guid productId) { BalePackProduct product = this.GetBalePackProductById(shelfOffProductId); product.ReplaceProduct(productId); }