Class ProductGroupRelationCollection
- Namespace
- Dynamicweb.Ecommerce.Products
- Assembly
- Dynamicweb.Ecommerce.dll
Represents a collection of ProductGroupRelation objects.
[Serializable]
[Obsolete]
public class ProductGroupRelationCollection : Collection<ProductGroupRelation>, IList<ProductGroupRelation>, ICollection<ProductGroupRelation>, IReadOnlyList<ProductGroupRelation>, IReadOnlyCollection<ProductGroupRelation>, IEnumerable<ProductGroupRelation>, IList, ICollection, IEnumerable
- Inheritance
-
ProductGroupRelationCollection
- Implements
- Inherited Members
- Extension Methods
Examples
using Dynamicweb.Ecommerce.Products;
using Dynamicweb.Ecommerce.Shops;
using Dynamicweb.Ecommerce.UserPermissions;
namespace Dynamicweb.Ecommerce.Examples.Products
{
class ProductGroupDeleteHandlerSample
{
public bool Run(string shopId)
{
Shop shop = Ecommerce.Services.Shops.GetShop(shopId);
if (!shop.get_Granted(UserPermissionRights.Delete))
{
return false;
}
//Delete groups
bool allGroupsDeleted = true;
foreach (Group group in shop.GetTopLevelGroups(Services.Languages.GetDefaultLanguageId()))
{
allGroupsDeleted = GroupDeleting.Run(group.Id, shop.UsageType) && allGroupsDeleted;
}
//Delete shop
if (allGroupsDeleted)
{
Ecommerce.Services.Shops.Delete(shop.Id);
Dynamicweb.Ecommerce.Common.Application.KillShops();
return true;
}
return false;
}
}
}
Properties
GroupCollection
Gets the group collection.
[Obsolete("Use 'Services.ProductGroups.GetRelatedGroups' instead")]
public GroupCollection GroupCollection { get; }
Property Value
- GroupCollection
- The group collection.
Methods
Load(string)
Loads the ProductGroupRelation objects from DB.
[Obsolete("Use 'Services.ProductGroups.GetProductGroupRelations' instead")]
public void Load(string query)
Parameters
query
string- The sql query.