Dynamicweb.eCommerce.Products Namespace : GroupDeleting Class |
class MyPage : System.Web.UI.Page { public bool Run(string ShopId) { Dynamicweb.eCommerce.Shops.Shop shop = new Dynamicweb.eCommerce.Shops.Shop(ShopId); if (!shop.get_Granted(Dynamicweb.eCommerce.UserPermissions.UserPermissionRights.Delete)) { return false; } //Delete groups bool allGroupsDeleted = true; foreach (Dynamicweb.eCommerce.Products.Group @group in shop.Groups) { allGroupsDeleted = Dynamicweb.eCommerce.Products.GroupDeleting.Run(@group.ID) && allGroupsDeleted; } //Delete shop if (allGroupsDeleted) { shop.Delete(); Dynamicweb.eCommerce.Common.Application.KillShops(); return true; } else { return false; } } }
System.Object
Dynamicweb.eCommerce.Products.GroupDeleting
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2