/// <summary>
        /// Gets the specified product stock.
        /// </summary>
        /// <param name="stockInfo">The stock info.</param>
        /// <param name="args">The arguments.</param>
        /// <returns>The product stock.</returns>
        public ProductStock Get(ProductStockInfo stockInfo, ServiceClientArgs args)
        {
            SiteContext site = Utils.GetExistingSiteContext(args);
              using (new SiteContextSwitcher(site))
              {
            IProductStockManager stockManager = Context.Entity.Resolve<IProductStockManager>();

            return stockManager.GetStock(stockInfo);
              }
        }
        /// <summary>
        /// Updates the specified product stock.
        /// </summary>
        /// <param name="code">The code.</param>
        /// <param name="newAmount">The new amount.</param>
        /// <param name="args">The arguments.</param>
        public void Update(string code, long newAmount, ServiceClientArgs args)
        {
            ProductStockInfo stockInfo = new ProductStockInfo { ProductCode = code };

              SiteContext site = Utils.GetExistingSiteContext(args);
              using (new SiteContextSwitcher(site))
              {
            IProductStockManager stockManager = Context.Entity.Resolve<IProductStockManager>();

            stockManager.Update(stockInfo, newAmount);
              }
        }
Exemple #3
0
 public override void Update(Sitecore.Ecommerce.DomainModel.Products.ProductStockInfo stockInfo, System.Linq.Expressions.Expression <Func <long, long> > expression)
 {
     return;
 }
Exemple #4
0
 public override void Update(Sitecore.Ecommerce.DomainModel.Products.ProductStockInfo stockInfo, long newAmount)
 {
     return;
 }
Exemple #5
0
        public override Sitecore.Ecommerce.DomainModel.Products.ProductStock GetStock(Sitecore.Ecommerce.DomainModel.Products.ProductStockInfo stockInfo)
        {
            var client = new Services.ProductServiceClient();
            var stock  = client.GetStock(stockInfo.ProductCode);

            return(new Sitecore.Ecommerce.DomainModel.Products.ProductStock
            {
                Code = stockInfo.ProductCode,
                Stock = stock
            });
        }