Bagikan melalui


CatalogDefinitionPropertiesDataSet

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

The CatalogDefinitionPropertiesDataSet class contains information about the properties in the catalog definitions in the Catalog System. You can access the DataRowCollection of the dataset’s data table by using the CatalogDefinitionProperties property. You can access each row in the collection by using the properties of the CatalogDefinitionPropertiesDataSet..::.CatalogDefinitionProperty class.

The following table contains the strongly typed properties in this dataset.

Property

Description

DefinitionId

This property is internal to the Catalog System and should not be used.

DefinitionName

Gets a string that contains the name of the definition; maximum length is 128 characters.

DefinitionType

Gets an integer that specifies the definition type. This integer is one of the values of the CatalogDefinitionType enumeration. The possible values are as follows:

  • 0 - CategoryDefinition

  • 1 - ProductDefinition

PropertyName

Gets the name of the property as a string; maximum length is 128 characters.

PropertyOrder

Gets or sets an integer that specifies the order in which the property appears in this definition. This property can be used to change the ordering of properties in a definition.

PropertyType

Gets an integer that specifies the type of the property. This integer is one of the values of the DefinitionPropertyType enumeration. The possible values are as follows:

  • 0 - The property is a normal property.

  • 1 - The property is a variant property.

Variant properties can be added only to product definitions.

Constraints

The CatalogDefinitionPropertiesDataSet class defines a unique constraint on the DefinitionName and PropertyName columns.

Using the CatalogDefinitionPropertiesDataSet Class

The following example demonstrates how to access the properties of the CatalogDefinitionPropertiesDataSet class.

public static void UseDataset(CatalogContext context, string definitionName, string newPropertyName)
{
    // Get an existing definition.
    CatalogDefinition definition =   context.GetDefinition(definitionName);
    // Add an existing property to the definition and save the definition.
    definition.AddProperty(newPropertyName, DefinitionPropertyType.NormalProperty);
    definition.Save();

    // Iterate through the dataset and access each property name
    // and its order.
    // Write each item to the console.
    foreach( CatalogDefinitionPropertiesDataSet.CatalogDefinitionProperty definitionProperty in definition.DefinitionProperties.CatalogDefinitionProperties)
    {
        string propertyName = definitionProperty.PropertyName;
        DefinitionPropertyType propertyType = (DefinitionPropertyType)definitionProperty.PropertyType;
        int propertyOrder = definitionProperty.PropertyOrder;
        // Write the items to the console.
        Console.WriteLine("{0}, {1}, {2}",propertyName, propertyOrder, propertyType);
    }
}

The CatalogDefinitionPropertiesDataSetSchema Class

The CatalogDefinitionPropertiesDataSetSchema class provides constants for all the built-in columns in the dataset and defines all the associated methods. The following table contains the associated methods for this class.

Method

Description

IsReadOnlyColumn

Returns true if the columnName in the dataset cannot be updated, or false if the columnName in the dataset can be updated.

IsBuiltInColumn

Returns true if the columnName is a built-in column in the dataset, or false if the columnName is a user-defined property.

See Also

Other Resources

Typed Datasets in the Catalog System

Typed Datasets in the Inventory System