public async Task UpdateProductsAsync(ShopVisibleProductsInventory products)
 {
     var xml = XmlSerializeHelpers.Serialize(products);
     await ActionPolicies.GetAsync.Do(async() =>
     {
         await this._client.SetProductInventoryAsync(this._credentials.ClientName, this._credentials.Guid, "false", xml);
     });
 }
        public async Task <List <ShopVisibleProductInventory> > GetInventoryAsync()
        {
            var inventory = new ShopVisibleProductsInventory();
            await ActionPolicies.GetAsync.Do(async() =>
            {
                var xmlInventory = await this._client.GetProductInventoryAsync(this._credentials.ClientName, this._credentials.Guid);
                inventory        = XmlSerializeHelpers.Deserialize <ShopVisibleProductsInventory>(xmlInventory.OuterXml);
            });

            return(inventory.Products);
        }
        public List <ShopVisibleProductInventory> GetInventory()
        {
            var inventory = new ShopVisibleProductsInventory();

            ActionPolicies.Submit.Do(() =>
            {
                var xmlInventory = this._client.GetProductInventory(this._credentials.ClientName, this._credentials.Guid);
                inventory        = XmlSerializeHelpers.Deserialize <ShopVisibleProductsInventory>(xmlInventory.OuterXml);
            });
            return(inventory.Products);
        }
Пример #4
0
        public async Task UpdateProductsAsync()
        {
            var service  = this._factory.CreateProductsService(this._credentials);
            var products = new ShopVisibleProductsInventory
            {
                Products = new List <ShopVisibleProductInventory>
                {
                    new ShopVisibleProductInventory
                    {
                        Quantity = 0,
                        Sku      = "MWW291Z"
                    }
                }
            };

            await service.UpdateProductsAsync(products);
        }
Пример #5
0
        public void UpdateProducts()
        {
            var service  = this._factory.CreateProductsService(this._credentials);
            var products = new ShopVisibleProductsInventory
            {
                Products = new List <ShopVisibleProductInventory>
                {
                    new ShopVisibleProductInventory
                    {
                        Quantity = 44,
                        Sku      = ""
                    }
                }
            };

            service.UpdateProducts(products);
        }
Пример #6
0
        public void UpdateProductOptions()
        {
            var service  = this._factory.CreateProductsService(this._credentials);
            var products = new ShopVisibleProductsInventory
            {
                Products = new List <ShopVisibleProductInventory>
                {
                    new ShopVisibleProductInventory
                    {
                        Sku          = "Yes30",
                        Quantity     = 2,
                        OptionGroups = new ShopVisibleProductOptionGroups
                        {
                            Groups = new List <ShopVisibleProductOptionGroup>
                            {
                                new ShopVisibleProductOptionGroup
                                {
                                    Id             = 105,
                                    ProductOptions = new ShopVisibleProductOptions
                                    {
                                        Options = new List <ShopVisibleProductOption>
                                        {
                                            new ShopVisibleProductOption
                                            {
                                                Price    = "14.99",
                                                Quantity = 11,
                                                Sku      = "YES30-FU-00",
                                                Upc      = "812768614296"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            };

            service.UpdateProducts(products);
        }
        public void UpdateProducts(ShopVisibleProductsInventory products)
        {
            var xml = XmlSerializeHelpers.Serialize(products);

            ActionPolicies.Submit.Do(() => this._client.SetProductInventory(this._credentials.ClientName, this._credentials.Guid, "false", xml));
        }