Class AssortmentService
- Namespace
- Dynamicweb.Ecommerce.Assortments
- Assembly
- Dynamicweb.Ecommerce.dll
public class AssortmentService : ICacheStorage<string, Assortment>, ICacheStorage<string>, ICacheStorage
- Inheritance
-
AssortmentService
- Implements
- Inherited Members
Methods
BuildAssortment(Assortment)
Starts the assortment building.
public void BuildAssortment(Assortment assortment)
Parameters
assortmentAssortment- The assortment object.
ClearAssortmentCache()
Clears the assortments cache.
[Obsolete("Use ClearCache() instead")]
public void ClearAssortmentCache()
ClearAssortmentItemCache()
Clears the assortment items cache.
[Obsolete("Use ClearCache() instead")]
public void ClearAssortmentItemCache()
ClearAssortmentPermissionCache()
Clears the assortment relations cache.
[Obsolete("Use ClearCache() instead")]
public void ClearAssortmentPermissionCache()
ClearAssortmentRelationCache()
Clears the assortment relations cache.
[Obsolete("Use ClearCache() instead")]
public void ClearAssortmentRelationCache()
ClearCache()
Resets all keys to the default value for objects stored in the object cache
public void ClearCache()
ClearCache(AssortmentKey)
[Obsolete("Use ClearCache(string) instead")]
public void ClearCache(AssortmentKey key)
Parameters
keyAssortmentKey
ClearCache(IEnumerable<AssortmentKey>)
[Obsolete("Use ClearCache(IEnumerable<string>) instead")]
public void ClearCache(IEnumerable<AssortmentKey> keys)
Parameters
keysIEnumerable<AssortmentKey>
ClearCache(IEnumerable<string>)
Resets the specified keys to the default value for objects stored in the object cache
public void ClearCache(IEnumerable<string> assortmentIds)
Parameters
assortmentIdsIEnumerable<string>
ClearCache(string)
Resets the specified key to the default value for objects stored in the object cache
public void ClearCache(string assortmentId)
Parameters
assortmentIdstring
DeleteAssortment(Assortment)
Deletes the Assortment and all its items, relations and permissions.
public void DeleteAssortment(Assortment assortment)
Parameters
assortmentAssortment- The assortment object.
DeleteAssortmentItem(AssortmentItem)
Deletes the AssortmentItem
public void DeleteAssortmentItem(AssortmentItem assortmentItem)
Parameters
assortmentItemAssortmentItem- The assortment item object.
DeleteAssortmentItems(Assortment)
Deletes the assortment items.
public void DeleteAssortmentItems(Assortment assortment)
Parameters
assortmentAssortment- The assortment object.
DeleteAssortmentItems(AssortmentRelation)
Deletes the assortment items.
[Obsolete("Don't use it. Items can't be deleted by assortment relations. Call BuildAssortment instead")]
public void DeleteAssortmentItems(AssortmentRelation assortmentRelation)
Parameters
assortmentRelationAssortmentRelation- The assortment relation object.
DeleteAssortmentItems(IEnumerable<AssortmentItem>)
Deletes the assortment items.
public void DeleteAssortmentItems(IEnumerable<AssortmentItem> assortmentItems)
Parameters
assortmentItemsIEnumerable<AssortmentItem>- The assortment items collection.
DeleteAssortmentItems(IEnumerable<AssortmentRelation>)
Deletes the assortment items.
[Obsolete("Don't use it. Items can't be deleted by assortment relations. Call BuildAssortment instead")]
public void DeleteAssortmentItems(IEnumerable<AssortmentRelation> assortmentRelations)
Parameters
assortmentRelationsIEnumerable<AssortmentRelation>- The assortment relations collection.
DeleteAssortmentItems(string)
Deletes the assortment items.
public void DeleteAssortmentItems(string assortmentId)
Parameters
assortmentIdstring- The assortment ID.
DeleteAssortmentItems(string, string)
Deletes the assortment items.
[Obsolete("Use DeleteAssortmentItems(string) instead")]
public void DeleteAssortmentItems(string assortmentId, string languageId)
Parameters
DeleteAssortmentPermission(AssortmentPermission)
Deletes the AssortmentPermission.
public void DeleteAssortmentPermission(AssortmentPermission assortmentPermission)
Parameters
assortmentPermissionAssortmentPermission- The assortment permission object.
DeleteAssortmentRelation(AssortmentRelation)
Deletes the AssortmentRelation.
public void DeleteAssortmentRelation(AssortmentRelation assortmentRelation)
Parameters
assortmentRelationAssortmentRelation- The assortment relation object.
DeleteAssortmentRelations(Assortment)
Deletes the assortment relations.
public void DeleteAssortmentRelations(Assortment assortment)
Parameters
assortmentAssortment- The assortment object.
DeleteAssortmentRelations(IEnumerable<AssortmentRelation>)
Deletes the assortment relations.
public void DeleteAssortmentRelations(IEnumerable<AssortmentRelation> assortmentRelations)
Parameters
assortmentRelationsIEnumerable<AssortmentRelation>- The collection of the assortment relations.
DeleteGroupAssortmentRelations(Assortment, string)
Deletes the group assortment relations.
public void DeleteGroupAssortmentRelations(Assortment assortment, string groupId)
Parameters
assortmentAssortment- The assortment object.
groupIdstring- The group ID.
DeleteGroupAssortmentRelations(IEnumerable<AssortmentGroupRelation>)
Deletes the group assortment relations.
public void DeleteGroupAssortmentRelations(IEnumerable<AssortmentGroupRelation> assortmentRelations)
Parameters
assortmentRelationsIEnumerable<AssortmentGroupRelation>- The group assortment relations collection.
DeleteProductAssortmentRelations(Assortment, string, string)
Deletes the product assortment relations.
public void DeleteProductAssortmentRelations(Assortment assortment, string productId, string productVariantId)
Parameters
assortmentAssortment- The assortment object.
productIdstring- The product ID.
productVariantIdstring- The product variant ID.
DeleteProductAssortmentRelations(IEnumerable<AssortmentProductRelation>)
Deletes the product assortment relations.
public void DeleteProductAssortmentRelations(IEnumerable<AssortmentProductRelation> assortmentRelations)
Parameters
assortmentRelationsIEnumerable<AssortmentProductRelation>- The product assortment relations collection.
DeleteShopAssortmentRelations(Assortment, string)
Deletes the assortment relations.
public void DeleteShopAssortmentRelations(Assortment assortment, string shopId)
Parameters
assortmentAssortment- The assortment object.
shopIdstring- The shop ID.
DeleteShopAssortmentRelations(IEnumerable<AssortmentShopRelation>)
Deletes the shop assortment relations.
public void DeleteShopAssortmentRelations(IEnumerable<AssortmentShopRelation> assortmentRelations)
Parameters
assortmentRelationsIEnumerable<AssortmentShopRelation>- The shop assortment relations collection.
FlagAssortmentForRebuild(Assortment)
Flags the assortment for rebuild.
public void FlagAssortmentForRebuild(Assortment assortment)
Parameters
assortmentAssortment- The assortment object.
GetActiveAssortmentIds()
Gets the IDs of the active assortments.
public IEnumerable<string> GetActiveAssortmentIds()
Returns
- IEnumerable<string>
- A collection of the assortment IDs.
GetActiveAssortments()
Gets all active assortments.
public IEnumerable<Assortment> GetActiveAssortments()
Returns
- IEnumerable<Assortment>
- A collection of the Assortment.
GetActiveAssortments(string)
Gets all active assortments.
[Obsolete("Use GetActiveAssortments() instead")]
public IEnumerable<Assortment> GetActiveAssortments(string languageId)
Parameters
languageIdstring
Returns
- IEnumerable<Assortment>
- A collection of the Assortment.
GetAllAssortmentItems()
Gets all assortment items.
[Obsolete("Dont use it")]
public IEnumerable<AssortmentItem> GetAllAssortmentItems()
Returns
- IEnumerable<AssortmentItem>
- A collection of the AssortmentItem.
GetAllAssortmentPermissions()
Gets all assortment permissions.
[Obsolete("Don't use this")]
public IEnumerable<AssortmentPermission> GetAllAssortmentPermissions()
Returns
- IEnumerable<AssortmentPermission>
- A collection of the AssortmentPermission.
GetAllAssortmentRelations()
Gets all assortment relations.
[Obsolete("Don't use it")]
public IEnumerable<AssortmentRelation> GetAllAssortmentRelations()
Returns
- IEnumerable<AssortmentRelation>
- A collection of the AssortmentRelation.
GetAllAssortments()
Gets all assortments.
public IEnumerable<Assortment> GetAllAssortments()
Returns
- IEnumerable<Assortment>
- A collection of the Assortment.
GetAllAssortments(string, bool)
Gets all assortments.
[Obsolete("Use GetAllAssortments() instead")]
public IEnumerable<Assortment> GetAllAssortments(string languageId, bool showUntranslated)
Parameters
Returns
- IEnumerable<Assortment>
- A collection of the Assortment.
GetAllowAnonymousUsersAssortmentIds()
Gets the ids of all active assortments for the current language that are available to anonymous uses.
public IEnumerable<string> GetAllowAnonymousUsersAssortmentIds()
Returns
- IEnumerable<string>
- A collection of the assortment IDs.
GetAssortmentById(string)
Gets the Assortment by ID.
public Assortment GetAssortmentById(string assortmentId)
Parameters
assortmentIdstring- The assortment ID.
Returns
- Assortment
- The Assortment.
GetAssortmentById(string, bool)
Gets the Assortment by ID.
[Obsolete("Use GetAssortmentById(string) instead")]
public Assortment GetAssortmentById(string assortmentId, bool showUntranslated)
Parameters
assortmentIdstring- The assortment ID.
showUntranslatedbool- Determines whether untranslated assortment could be returned.
Returns
- Assortment
- The Assortment.
GetAssortmentById(string, string)
Gets the Assortment by ID.
[Obsolete("Use GetAssortmentById(string) instead")]
public Assortment GetAssortmentById(string assortmentId, string languageId)
Parameters
Returns
- Assortment
- The Assortment.
GetAssortmentById(string, string, bool)
Gets the Assortment by ID.
[Obsolete("Use GetAssortmentById(string) instead")]
public Assortment GetAssortmentById(string assortmentId, string languageId, bool showUntranslated)
Parameters
assortmentIdstring- The assortment ID.
languageIdstringshowUntranslatedbool- Determines whether untranslated assortment could be returned.
Returns
- Assortment
- The Assortment.
GetAssortmentIdsByUser(User)
Gets the assortment IDs by user.
[Obsolete("Use GetAssortmentIdsByUser(User, bool) instead.")]
public IEnumerable<string> GetAssortmentIdsByUser(User user)
Parameters
userUser- The user.
Returns
- IEnumerable<string>
- A collection of the assortment IDs.
GetAssortmentIdsByUser(User, bool)
Gets the assortment IDs by user.
public IEnumerable<string> GetAssortmentIdsByUser(User user, bool onlyActive)
Parameters
Returns
- IEnumerable<string>
- A collection of the assortment IDs.
GetAssortmentIdsByUser(User, string, bool)
Gets the assortment IDs by user.
[Obsolete("Use GetAssortmentIdsByUser(User, bool) instead")]
public IEnumerable<string> GetAssortmentIdsByUser(User user, string languageId, bool onlyActive)
Parameters
userUser- The user.
languageIdstring- The language Id.
onlyActivebool- If true take only active assortments.
Returns
- IEnumerable<string>
- A collection of the assortment IDs.
GetAssortmentItemsByAssortmentId(string, string)
Gets the assortment items by assortment ID.
[Obsolete("Don't use it")]
public IEnumerable<AssortmentItem> GetAssortmentItemsByAssortmentId(string assortmentId, string languageId)
Parameters
Returns
- IEnumerable<AssortmentItem>
- A collection of the AssortmentItem.
GetAssortmentItemsByAssortmentRelation(string, int)
Gets the assortment items by relation type.
[Obsolete("Don't use it. Neither relationType neither relationAutoId is filled in items")]
public IEnumerable<AssortmentItem> GetAssortmentItemsByAssortmentRelation(string relationType, int relationAutoId)
Parameters
Returns
- IEnumerable<AssortmentItem>
- A collection of the AssortmentItem.
GetAssortmentItemsByLanguageId(string)
Gets the assortment items by language ID.
[Obsolete("Don't use it.")]
public IEnumerable<AssortmentItem> GetAssortmentItemsByLanguageId(string languageId)
Parameters
languageIdstring- The language ID.
Returns
- IEnumerable<AssortmentItem>
- A collection of the AssortmentItem.
GetAssortmentPermissionsByAssortmentId(string)
Gets the assortment permission IDs by user.
[Obsolete("Use Permission property of an assortment instead")]
public IEnumerable<AssortmentPermission> GetAssortmentPermissionsByAssortmentId(string assortmentId)
Parameters
assortmentIdstring- The assortment ID.
Returns
- IEnumerable<AssortmentPermission>
- A collection of the AssortmentPermission.
GetAssortmentPermissionsByUser(User)
Gets the assortment permission for user.
[Obsolete("Use GetAssortmentPermissionsByUser(User, bool) instead")]
public IEnumerable<AssortmentPermission> GetAssortmentPermissionsByUser(User user)
Parameters
userUser- The user.
Returns
- IEnumerable<AssortmentPermission>
- A collection of the AssortmentPermission.
GetAssortmentPermissionsByUser(User, bool)
Gets the assortment permission for user.
public IEnumerable<AssortmentPermission> GetAssortmentPermissionsByUser(User user, bool includeGroups)
Parameters
userUser- The user.
includeGroupsbool- Determines whether assortment permissions for user groups should be included in result collection.
Returns
- IEnumerable<AssortmentPermission>
- A collection of the AssortmentPermission.
GetAssortmentRelationsByAssortmentId(string)
Gets the assortment relations by assortment ID.
[Obsolete("Use ProductRelations, GroupRelations and ShopRelations properties of an assortment instead")]
public IEnumerable<AssortmentRelation> GetAssortmentRelationsByAssortmentId(string assortmentId)
Parameters
assortmentIdstring- The assortment ID.
Returns
- IEnumerable<AssortmentRelation>
- A collection of the AssortmentRelation.
GetAssortmentRelationsByAssortmentId(string, AssortmentRelationType)
Gets the assortment relations by assortment ID.
[Obsolete("Use ProductRelations, GroupRelations and ShopRelations properties of an assortment instead")]
public IEnumerable<AssortmentRelation> GetAssortmentRelationsByAssortmentId(string assortmentId, AssortmentRelationType relationType)
Parameters
assortmentIdstring- The assortment ID.
relationTypeAssortmentRelationType- The relation type.
Returns
- IEnumerable<AssortmentRelation>
- A collection of the AssortmentRelation.
GetAssortmentRelationsByGroupId(string)
Gets the assortment relations by group ID.
public IEnumerable<AssortmentGroupRelation> GetAssortmentRelationsByGroupId(string groupId)
Parameters
groupIdstring- The group ID.
Returns
- IEnumerable<AssortmentGroupRelation>
- A collection of the AssortmentGroupRelation.
GetAssortmentRelationsByProductId(string, string)
Gets the assortment relations by product ID.
public IEnumerable<AssortmentProductRelation> GetAssortmentRelationsByProductId(string productId, string productVariantId)
Parameters
Returns
- IEnumerable<AssortmentProductRelation>
- A collection of the AssortmentProductRelation.
GetAssortmentRelationsByRelationType(AssortmentRelationType)
Gets the assortment relations by relation type.
[Obsolete("Don't use it")]
public IEnumerable<AssortmentRelation> GetAssortmentRelationsByRelationType(AssortmentRelationType relationType)
Parameters
relationTypeAssortmentRelationType- The relation type.
Returns
- IEnumerable<AssortmentRelation>
- A collection of the AssortmentRelation.
GetAssortmentRelationsByShopId(string)
Gets the assortment relations by shop ID.
public IEnumerable<AssortmentShopRelation> GetAssortmentRelationsByShopId(string shopId)
Parameters
shopIdstring- The shop ID.
Returns
- IEnumerable<AssortmentShopRelation>
- A collection of the AssortmentShopRelation.
GetAssortmentsByProduct(Product)
Gets the assortments by product.
public IEnumerable<Assortment> GetAssortmentsByProduct(Product product)
Parameters
productProduct- The product object.
Returns
- IEnumerable<Assortment>
- A collection of the Assortment.
GetAssortmentsByProductId(string, string)
Gets the assortments by product ID.
[Obsolete("Use overload with languageId instead.")]
public IEnumerable<Assortment> GetAssortmentsByProductId(string productId, string variantId)
Parameters
Returns
- IEnumerable<Assortment>
- A collection of the Assortment.
GetAssortmentsByProductId(string, string, string)
Gets the assortments by product ID.
public IEnumerable<Assortment> GetAssortmentsByProductId(string productId, string variantId, string languageId)
Parameters
Returns
- IEnumerable<Assortment>
- A collection of the Assortment.
GetAssortmentsForBuild()
Gets assortments which require build.
public IEnumerable<Assortment> GetAssortmentsForBuild()
Returns
- IEnumerable<Assortment>
- A collection of the Assortment.
GetNotActiveAssortmentIds()
Gets the IDs of the not active assortments.
public IEnumerable<string> GetNotActiveAssortmentIds()
Returns
- IEnumerable<string>
- A collection of the assortment IDs.
HasAccessToProduct(Product, User)
public bool HasAccessToProduct(Product product, User user)
Parameters
Returns
HasActiveAssortments()
Determines whether there are active assortments.
public bool HasActiveAssortments()
Returns
- bool
True, if solution have one or more active assortments, otherwiseFalse.
LoadAssortmentGroupRelations(string)
public Dictionary<string, AssortmentGroupRelation> LoadAssortmentGroupRelations(string assortmentId)
Parameters
assortmentIdstring
Returns
LoadAssortmentPermissions(string)
public Dictionary<int, AssortmentPermission> LoadAssortmentPermissions(string assortmentId)
Parameters
assortmentIdstring
Returns
LoadAssortmentProductRelations(string)
public Dictionary<string, AssortmentProductRelation> LoadAssortmentProductRelations(string assortmentId)
Parameters
assortmentIdstring
Returns
LoadAssortmentShopRelations(string)
public Dictionary<string, AssortmentShopRelation> LoadAssortmentShopRelations(string assortmentId)
Parameters
assortmentIdstring
Returns
SaveAssortment(Assortment, bool)
Saves the Assortment.
public void SaveAssortment(Assortment assortment, bool doInstallStep = true)
Parameters
assortmentAssortment- The assortment object.
doInstallStepbool
SaveAssortmentItem(AssortmentItem)
Saves the AssortmentItem.
public void SaveAssortmentItem(AssortmentItem assortmentItem)
Parameters
assortmentItemAssortmentItem- The assortment item object.
SaveAssortmentPermission(AssortmentPermission)
Saves the AssortmentPermission.
public void SaveAssortmentPermission(AssortmentPermission assortmentPermission)
Parameters
assortmentPermissionAssortmentPermission- The assortment permission object.
SaveAssortmentRelation(AssortmentRelation)
Saves the AssortmentRelation.
public void SaveAssortmentRelation(AssortmentRelation assortmentRelation)
Parameters
assortmentRelationAssortmentRelation- The assortment relation object.