Class Assortment
- Namespace
- Dynamicweb.Ecommerce.Assortments
- Assembly
- Dynamicweb.Ecommerce.dll
Assortment class.
[Serializable]
public class Assortment
- Inheritance
-
Assortment
- Inherited Members
Constructors
Assortment()
Creates an Assortment object with default property values.
public Assortment()
Assortment(IDataReader)
Creates an Assortment object using property values from the given IDataReader.
[Obsolete("This method is no longer used.")]
public Assortment(IDataReader dataReader)
Parameters
dataReader
IDataReader- DataReader containing the values to create the Assortment.
Properties
Active
Gets or sets a value indicating whether the Assortment is active.
public bool Active { get; set; }
Property Value
- bool
true
if active; otherwise,false
.
AllowAnonymousUsers
Gets or sets a value indicating whether the Assortment is available to anonymous uses.
public bool AllowAnonymousUsers { get; set; }
Property Value
- bool
true
if assortment is available to anonymous users; otherwise,false
.
AutoID
Gets the auto id of the Assortment.
[Obsolete("AutoID refers to language version of assortment. Now we use Translations for translated versions of assortment.")]
public int AutoID { get; }
Property Value
- int
- The automatic identifier.
GroupHierarchy
Gets the group hierarchy of assortment
public HashSet<string> GroupHierarchy { get; }
Property Value
GroupRelations
Gets the group relations of assortment
public Dictionary<string, AssortmentGroupRelation> GroupRelations { get; }
Property Value
HasRelations
Shows that assortment has any type of relation (product, group or shop relations)
public bool HasRelations { get; }
Property Value
ID
Gets or sets the the id of the Assortment.
public string ID { get; set; }
Property Value
- string
- The identifier.
IncludeSubgroups
Gets or sets a value indicating whether the Assortment should include subgroups of selected groups when building the Assortment.
public bool IncludeSubgroups { get; set; }
Property Value
- bool
true
if subgroups are included; otherwise,false
.
Items
Gets the assortment items
public Dictionary<ProductKey, AssortmentItem> Items { get; }
Property Value
LanguageID
Gets or sets the language id of the Assortment.
[Obsolete("Use Translations instead.")]
public string LanguageID { get; set; }
Property Value
- string
- The language identifier.
LastBuildDate
Gets the when the Assortment was last built.
public DateTime? LastBuildDate { get; }
Property Value
- DateTime?
- The last build date.
Name
Gets or sets the name of the Assortment.
[Obsolete("Use GetName and SetName instead.")]
public string Name { get; set; }
Property Value
- string
- The name.
Number
Gets or sets the number of the Assortment.
[Obsolete("Use GetNumber and SetNumber instead.")]
public string Number { get; set; }
Property Value
- string
- The number.
PeriodID
Gets or sets the period id of the Assortment.
public string PeriodID { get; set; }
Property Value
- string
- The period identifier.
Permissions
Gets the assortment permissions
public Dictionary<int, AssortmentPermission> Permissions { get; }
Property Value
ProductRelations
Gets the product relations of assortment
public Dictionary<string, AssortmentProductRelation> ProductRelations { get; }
Property Value
RebuildRequired
Gets or sets a value indicating whether a rebuild of the Assortment is required.
public bool RebuildRequired { get; set; }
Property Value
- bool
true
if rebuild is required; otherwise,false
.
ShopRelations
Gets the shop relations of assortment
public Dictionary<string, AssortmentShopRelation> ShopRelations { get; }
Property Value
Translations
Gets the translations of assortment
public TranslationCollection<AssortmentTranslation> Translations { get; }
Property Value
Methods
Build(Assortment)
Builds the Assortment. If the Assortment is already built, only new relations are appended.
[Obsolete("Use Services.Assortments.BuildAssortment instead.")]
public static void Build(Assortment assortment)
Parameters
assortment
Assortment- The Assortment to build.
ClearCache()
Clears the cache.
[Obsolete("Use Services.Assortments.ClearCache instead.")]
public static void ClearCache()
Delete()
Deletes this instance.
[Obsolete("Use Services.Assortments.DeleteAssortment instead.")]
public void Delete()
Fill(IDataReader)
Fills the Assortment object with property values from the given IDataReader.
[Obsolete("This method is no longer used.")]
public void Fill(IDataReader dataReader)
Parameters
dataReader
IDataReader- DataReader containing the values to fill the Assortment.
FlagForRebuild(Assortment)
Flags the assortment for rebuild without clearing the cache.
[Obsolete("Use Services.Assortments.FlagAssortmentForRebuild instead.")]
public static void FlagForRebuild(Assortment assortment)
Parameters
assortment
Assortment- The assortment to flag for rebuild.
GetActiveAssortmentIDs()
Gets the ids of all active Assortment versions in the current language.
[Obsolete("Use Services.Assortments.GetActiveAssortmentIds instead.")]
public static IEnumerable<string> GetActiveAssortmentIDs()
Returns
- IEnumerable<string>
- IEnumerable(Of System.String).
GetActiveAssortments()
Gets all active Assortment versions in the current language.
[Obsolete("Use Services.Assortments.GetActiveAssortments instead.")]
public static AssortmentCollection GetActiveAssortments()
Returns
- AssortmentCollection
- AssortmentCollection.
GetAllAssortments()
Gets all Assortments.
[Obsolete("Use Services.Assortments.GetAllAssortments instead.")]
public static AssortmentCollection GetAllAssortments()
Returns
- AssortmentCollection
- AssortmentCollection.
GetAllAssortmentsByLanguageID(string)
Gets all assortments by language id, both translated and untranslated.
[Obsolete("Use Services.Assortments.GetAllAssortments instead. Use Assortment.Translations to get translated versions of assortment.")]
public static Dictionary<string, Assortment> GetAllAssortmentsByLanguageID(string languageID)
Parameters
languageID
string- The language id.
Returns
- Dictionary<string, Assortment>
- Dictionary(Of System.String, Assortment).
GetAllowAnonymousUsersAssortmentIDs()
Gets the ids of all active Assortment versions in the current language that are available to anonymous uses.
[Obsolete("Use Services.Assortments.GetAllowAnonymousUsersAssortmentIds instead.")]
public static IEnumerable<string> GetAllowAnonymousUsersAssortmentIDs()
Returns
- IEnumerable<string>
- IEnumerable(Of System.String).
GetAssortmentByID(string)
Gets the Assortment with the given id.
[Obsolete("Use Services.Assortments.GetAssortmentById(string) instead.")]
public static Assortment GetAssortmentByID(string assortmentID)
Parameters
assortmentID
string- The assortment id.
Returns
- Assortment
- Assortment.
GetAssortmentByID(string, bool)
Gets the Assortment with the given id.
[Obsolete("Use Services.Assortments.GetAssortmentById(string) instead.")]
public static Assortment GetAssortmentByID(string assortmentID, bool showUntranslated)
Parameters
assortmentID
string- The assortment id.
showUntranslated
bool- If set to
true
and no assortment was translated to the current language, an untranslated assortment with the given id is return; otherwisenull
is returned.
Returns
- Assortment
- Assortment.
GetAssortmentByID(string, string)
Gets the Assortment with the given id that was translated into the language with the given id.
[Obsolete("Use Services.Assortments.GetAssortmentById(string) instead.")]
public static Assortment GetAssortmentByID(string assortmentID, string languageID)
Parameters
Returns
- Assortment
- Assortment.
GetAssortmentsByIDs(IEnumerable<string>)
Gets Assortments who's id is in the given list.
[Obsolete("Use Services.Assortments.GetAssortmentsByIds instead.")]
public static AssortmentCollection GetAssortmentsByIDs(IEnumerable<string> assortmentIDs)
Parameters
assortmentIDs
IEnumerable<string>- The ids of the assortments to get.
Returns
- AssortmentCollection
- AssortmentCollection.
GetName(string)
Gets the name of the assortment for the given language.
public string GetName(string languageId)
Parameters
languageId
string- Language id
Returns
GetNotActiveAssortmentIDs()
Gets the ids of all Assortment versions that are not active in the current language.
[Obsolete("Use Services.Assortments.GetNotActiveAssortmentIds instead.")]
public static IEnumerable<string> GetNotActiveAssortmentIDs()
Returns
- IEnumerable<string>
- IEnumerable(Of System.String).
GetNumber(string)
Gets the number of the assortment for the given language.
public string GetNumber(string languageId)
Parameters
languageId
string- Language id
Returns
Rebuild(Assortment)
Rebuilds the Assortment. All relations are rebuilt.
[Obsolete("Use Services.Assortments.BuildAssortment instead.")]
public static void Rebuild(Assortment assortment)
Parameters
assortment
Assortment- The assortment.
Save()
Saves this instance.
[Obsolete("Use Services.Assortments.SaveAssortment instead.")]
public void Save()
SetName(string, string)
Sets the name of the assortment for the given language.
public void SetName(string languageId, string name)
Parameters
SetNumber(string, string)
Sets the number of the assortment for the given language.
public void SetNumber(string languageId, string number)