Google.GData.ContentForShopping.ContentForShoppingService.AddLocalId C# (CSharp) Method

AddLocalId() public method

Adds a local ID to an entry
public AddLocalId ( Google.GData.ContentForShopping.InventoryEntry entry, string language, string country, string productId, string storeCode ) : Google.GData.ContentForShopping.InventoryEntry
entry Google.GData.ContentForShopping.InventoryEntry the entry to add an ID to
language string The language for the entry.
country string The target country of the entry.
productId string The unique identifier for the product in the given locale.
storeCode string The store code for this local product.
return Google.GData.ContentForShopping.InventoryEntry
        public InventoryEntry AddLocalId(InventoryEntry entry, string language,
                                         string country, string productId,
                                         string storeCode)
        {
            return AddLocalId(entry, language, country, productId, storeCode, false, this.accountId);
        }

Same methods

ContentForShoppingService::AddLocalId ( Google.GData.ContentForShopping.InventoryEntry entry, string language, string country, string productId, string storeCode, bool setEditUri ) : Google.GData.ContentForShopping.InventoryEntry
ContentForShoppingService::AddLocalId ( Google.GData.ContentForShopping.InventoryEntry entry, string language, string country, string productId, string storeCode, bool setEditUri, string accountId ) : Google.GData.ContentForShopping.InventoryEntry
ContentForShoppingService::AddLocalId ( Google.GData.ContentForShopping.InventoryEntry entry, string language, string country, string productId, string storeCode, string accountId ) : Google.GData.ContentForShopping.InventoryEntry

Usage Example

Ejemplo n.º 1
0
        private static void RunSample(string username, string password, string accountId,
                                      string language, string country, string productId,
                                      string storeCode)
            {
            // Connect to the service
            ContentForShoppingService service = new ContentForShoppingService("Inventory-Sample", accountId);
            service.setUserCredentials(username, password);

            // Create a new inventory entry
            InventoryEntry entry = new InventoryEntry();
            entry.Availability = "in stock";
            entry.Price = new Price("usd", "250.00");
            entry.Quantity = 1000;
            entry.SalePrice = new SalePrice("usd", "199.90");
            entry.SalePriceEffectiveDate = "2012-01-09 2012-01-13";

            // Add necessary EditUri
            bool setEditUri = true;
            entry = service.AddLocalId(entry, language, country, productId, storeCode, setEditUri);

            // Update the product we just constructed
            Console.WriteLine("Updating local product");
            InventoryEntry updated = service.UpdateInventoryEntry(entry);

            // Attempt a similar update via batch
            updated.Quantity = 900;
            updated.Price = new Price("usd", "240.00");

            updated = service.AddLocalId(updated, language, country, productId, storeCode);
            InventoryFeed feed = service.UpdateInventoryFeed(new List<InventoryEntry> {updated});

            // Display title and id for each local product
            Console.WriteLine("Listing all inventory returned");
            foreach (InventoryEntry m in feed.Entries) {
                Console.WriteLine("Locsl Product: " + m.Title.Text + " (" + m.EditUri + ")");
            }
        }