Class GroupRelation
- Namespace
- Dynamicweb.Ecommerce.Products
- Assembly
- Dynamicweb.Ecommerce.dll
Class for parent-child relations between product groups
[Serializable]
public class GroupRelation
- Inheritance
-
GroupRelation
- Inherited Members
Constructors
GroupRelation()
Empty constructor
public GroupRelation()
GroupRelation(IDataReader)
Create relation object with data from given DataReader
public GroupRelation(IDataReader dataReader)
Parameters
dataReader
IDataReaderDataReader with selected relation
GroupRelation(string, string)
Create groups relation using group ID and parent group ID
public GroupRelation(string id, string groupParentId)
Parameters
Properties
Id
Group ID.
public string Id { get; set; }
Property Value
InheritCategories
Do inherit categories.
public bool InheritCategories { get; set; }
Property Value
IsPrimary
Is this group primary.
public bool IsPrimary { get; set; }
Property Value
ParentId
Parent group ID.
public string ParentId { get; set; }
Property Value
Sorting
Sort order of current group inside parent group's children collection.
public int Sorting { get; set; }
Property Value
Methods
ClearCache()
Clears the relations cache.
public static void ClearCache()
Clone()
Create in-memory copy of current relation
public GroupRelation Clone()
Returns
- GroupRelation
Copied relation
Copy()
Create a copy of current relation and save it to database
public GroupRelation Copy()
Returns
- GroupRelation
Copied relation
Delete()
Delete current relation
public void Delete()
Delete(IEnumerable<Group>)
Delete all relations for groups from given collection
public CommandBuilder Delete(IEnumerable<Group> groups)
Parameters
groups
IEnumerable<Group>Groups collection to delete from group relations
Returns
- CommandBuilder
SQL statement used to delete relations
Delete(IEnumerable<Group>, bool)
Create SQL statement to delete all relations for groups from given collection and optionally execute it
public CommandBuilder Delete(IEnumerable<Group> groups, bool run)
Parameters
groups
IEnumerable<Group>Groups collection to delete from group relations
run
boolExecute prepared SQL statement or not
Returns
- CommandBuilder
SQL statement used to delete relations
Delete(string, string)
Delete relation between given group and parent group
public void Delete(string theGroupId, string groupParentId = "")
Parameters
GetGroupRelationsByChildId(string)
Get all group relations for given child group ID
public static GroupRelationCollection GetGroupRelationsByChildId(string childId)
Parameters
childId
stringChild group ID
Returns
GetGroupRelationsByParentId(string)
Get all group relations for given parent group ID
public static GroupRelationCollection GetGroupRelationsByParentId(string theParentId)
Parameters
theParentId
stringParent group ID
Returns
Save(string, string)
Save relation object
public void Save(string theGroupId, string theParentId)
Parameters
Remarks
Fires Notifications.eCommerce.Group.RelationUpdated event