/// <summary> /// 添加促销赠品至购物车 /// </summary> /// <param name="productSysNo">商品(赠品)系统编号</param> /// <param name="promotionSysNo">促销系统编号</param> /// <param name="source">购物车商品来源</param> /// <return></return> /// <remarks>2013-10-16 黄波 创建</remarks> public override void AddGift(int productSysNo, int promotionSysNo, Model.WorkflowStatus.CustomerStatus.购物车商品来源 source) { var giftItem = _cookieCart.Find(o => o.ProductSysNo == productSysNo && o.Promotions == promotionSysNo.ToString() && o.ProductSalesType == (int)CustomerStatus.商品销售类型.赠品 ); if ((giftItem == null)) { _cookieCart.Add(new JsonCartItem { SysNo = CreateSysNo(), GroupCode = "", IsLock = (int)CustomerStatus.购物车是否锁定.是, IsChecked = (int)CustomerStatus.是否选中.是, ProductSalesType = (int)CustomerStatus.商品销售类型.赠品, ProductSysNo = productSysNo, Promotions = promotionSysNo.ToString(), Quantity = 1 }); } SetCookieCart(); }
/// <summary> /// 添加商品至购物车 /// </summary> /// <param name="productSysNo">商品系统编号</param> /// <param name="quantity">商品数量</param> /// <param name="source">购物车商品来源</param> /// <return></return> /// <remarks>2013-10-16 黄波 创建</remarks> public override void Add(int productSysNo, int quantity, Model.WorkflowStatus.CustomerStatus.购物车商品来源 source) { var productItems = _cookieCart.Find(o => o.ProductSysNo == productSysNo); if (productItems != null) { productItems.Quantity += quantity; } else { _cookieCart.Add(new JsonCartItem { SysNo = CreateSysNo(), GroupCode = "", IsLock = (int)CustomerStatus.购物车是否锁定.否, IsChecked = (int)CustomerStatus.是否选中.是, ProductSalesType = (int)CustomerStatus.商品销售类型.普通, ProductSysNo = productSysNo, Promotions = "", Quantity = quantity }); } SetCookieCart(); }
/// <summary> /// 添加促销商品至购物车 /// </summary> /// <param name="groupSysNo">组系统编号(组合,团购主表系统编号)</param> /// <param name="quantity">组数量</param> /// <param name="promotionSysNo">促销系统编号</param> /// <param name="source">购物车商品来源</param> /// <returns>购物车明细集合</returns> /// <remarks>2013-10-16 黄波 创建</remarks> public override void Add(int groupSysNo, int quantity, int promotionSysNo, Model.WorkflowStatus.CustomerStatus.购物车商品来源 source) { CrShoppingCartBo.Instance.Add(_customerSysNo, groupSysNo, quantity, promotionSysNo, source); }
/// <summary> /// 添加促销赠品至购物车 /// </summary> /// <param name="productSysNo">商品(赠品)系统编号</param> /// <param name="promotionSysNo">促销系统编号</param> /// <param name="source">购物车商品来源</param> /// <return></return> /// <remarks>2013-10-16 黄波 创建</remarks> public override void AddGift(int productSysNo, int promotionSysNo, Model.WorkflowStatus.CustomerStatus.购物车商品来源 source) { CrShoppingCartBo.Instance.AddGift(_customerSysNo, productSysNo, promotionSysNo, source); }