Class GroupRelationCollection
- Namespace
- Dynamicweb.Ecommerce.Products
- Assembly
- Dynamicweb.Ecommerce.dll
Collection class for parent-child relations between product groups
[Serializable]
public class GroupRelationCollection : Collection<GroupRelation>, IList<GroupRelation>, ICollection<GroupRelation>, IReadOnlyList<GroupRelation>, IReadOnlyCollection<GroupRelation>, IList, ICollection, IEnumerable<GroupRelation>, IEnumerable
- Inheritance
-
GroupRelationCollection
- Implements
- Inherited Members
- Extension Methods
Examples
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);
}
}
}
Methods
Find(string, string)
Find group relation based on given parent and child gorup IDs
public GroupRelation Find(string parentID, string childID)
Parameters
Returns
- GroupRelation
- Found group relation or Nothing
Load(string)
[Obsolete("", false)]
public void Load(string sql)
Parameters
sql
string