次の方法で共有


GetUnassociatedProductCatalogs Method

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

Returns a ReadOnlyStringCollection containing the list of product catalogs in the catalog system that are not associated to existing inventory catalogs in the inventory system.

Namespace:  Microsoft.CommerceServer.Inventory
Assembly:  Microsoft.CommerceServer.Catalog (in Microsoft.CommerceServer.Catalog.dll)

Syntax

'Declaration
Public Function GetUnassociatedProductCatalogs As ReadOnlyStringCollection
'Usage
Dim instance As InventoryContext
Dim returnValue As ReadOnlyStringCollection

returnValue = instance.GetUnassociatedProductCatalogs()
public ReadOnlyStringCollection GetUnassociatedProductCatalogs()
public:
ReadOnlyStringCollection^ GetUnassociatedProductCatalogs()
public function GetUnassociatedProductCatalogs() : ReadOnlyStringCollection

Return Value

Type: Microsoft.CommerceServer.Runtime..::.ReadOnlyStringCollection
A ReadOnlyStringCollection containing the list of product catalogs in the catalog system that are not associated to existing inventory catalogs in the inventory system.

Remarks

The inventory system allows you to associate product catalogs to an inventory catalog. One inventory catalog can contain multiple product catalogs but one product catalog can be associated with one inventory catalog. When you associate a product catalog with an inventory catalog the inventory information for the products and variants in the product catalog is stored in the associated inventory catalog. You can use the GetUnassociatedProductCatalogs method to get a list of product catalogs that are not associated to any of the inventory catalogs. An empty collection will be returned if there are no product catalogs in the catalog system or if all the product catalogs are associated.

Examples

This example shows how to obtain and iterate through the list of unassociated product catalogs.

public ReadOnlyStringCollection GetUnassociatedProductCatalogs()
{
  ReadOnlyStringCollection unassociatedProductCatalogs = inventoryContext.GetUnassociatedProductCatalogs();
  int numberOfunassociatedProductCatalogs = unassociatedProductCatalogs.Count;
  foreach(string productCatalog in unassociatedProductCatalogs)
  {
    Console.WriteLine(productCatalog);
  }
  return unassociatedProductCatalogs;
} 

Permissions

See Also

Reference

InventoryContext Class

InventoryContext Members

Microsoft.CommerceServer.Inventory Namespace