Dynamicweb.eCommerce.Products Namespace : GroupRelationCollection Class |
'Declaration
<SerializableAttribute()> Public Class GroupRelationCollection Inherits System.Collections.ObjectModel.Collection(Of GroupRelation)
[SerializableAttribute()] public class GroupRelationCollection : System.Collections.ObjectModel.Collection<GroupRelation>
class MyPage : System.Web.UI.Page { private void SaveGroupRelations(Group grp) { // using additioal collection - to save sorting order // load group relations GroupRelationCollection relationsList = new GroupRelationCollection(); for (int i = 0; i <= int.MaxValue; i++) { string pId = Request["GRPREL_ID" + i]; if (string.IsNullOrEmpty(pId)) break; GroupRelation g = new GroupRelation(grp.ID, pId); g.ID = grp.ID; g.ParentID = pId; relationsList.Add(g); } // remove all relations GroupRelation grpRelDel = new GroupRelation(); grpRelDel.Delete(grp.ID); // save loaded relations foreach (GroupRelation g in relationsList) { g.Save(g.ID, g.ParentID); } } }
System.Object
System.Collections.ObjectModel.Collection<T>
Dynamicweb.eCommerce.Products.GroupRelationCollection
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