Class ProductGroupRelation
- Namespace
- Dynamicweb.Ecommerce.Products
- Assembly
- Dynamicweb.Ecommerce.dll
Represents information about related groups.
[Serializable]
public class ProductGroupRelation
- Inheritance
-
ProductGroupRelation
- Inherited Members
Examples
using Dynamicweb.Ecommerce.Products;
namespace Dynamicweb.Ecommerce.Examples.Products
{
public class ProductGroupRelationSaveHandlerSample
{
public void SaveProduct(string prodId, string groupId)
{
var productGroupRelation = new ProductGroupRelation(prodId, groupId)
{
ProductId = prodId,
GroupId = groupId
};
productGroupRelation.Save(prodId, groupId);
}
}
}
Constructors
ProductGroupRelation()
Initializes a new instance of the ProductGroupRelation class.
public ProductGroupRelation()
ProductGroupRelation(IDataReader)
Initializes a new instance of the ProductGroupRelation class.
[Obsolete("Use 'Services.ProductGroups.GetProductGroupRelation' instead")]
public ProductGroupRelation(IDataReader dataReader)
Parameters
dataReaderIDataReader- DataReader.
ProductGroupRelation(string, string)
Initializes a new instance of the ProductGroupRelation class.
[Obsolete("Use 'Services.ProductGroups.GetProductGroupRelation' instead")]
public ProductGroupRelation(string relationProductId, string groupId)
Parameters
relationProductIdstring- DB field name is GroupProductRelationProductID.
groupIdstring- DB field name is GroupProductRelationGroupID.
Properties
CreatedAt
Gets the created date and time
public DateTime CreatedAt { get; set; }
Property Value
GroupId
Gets or sets the group ID.
public string GroupId { get; set; }
Property Value
- string
- The group ID.
IsPrimary
Is this group primary
public bool IsPrimary { get; set; }
Property Value
ProductId
Gets or sets the product ID.
public string ProductId { get; set; }
Property Value
- string
- The product ID.
RuleId
Gets or sets the rule ID.
public string RuleId { get; set; }
Property Value
- string
- The rule ID.
Sorting
Gets or sets the sorting.
public int Sorting { get; set; }
Property Value
- int
- The sorting.
Methods
ClearCache()
Clears product group relation cache.
[Obsolete("Use 'Services.ProductGroups.ClearProductGroupRelationCache' instead")]
public static void ClearCache()
Clone()
Clones this instance.
public ProductGroupRelation Clone()
Returns
Copy()
Copies this instance.
public ProductGroupRelation Copy()
Returns
Delete()
Deletes this instance from DB.
[Obsolete("Use 'Services.ProductGroups.DeleteRelation' instead")]
public void Delete()
Delete(ProductCollection)
[Obsolete("Use CommandBuilder Delete(IEnumerable<Product> products) method instead.")]
public string Delete(ProductCollection products)
Parameters
productsProductCollection
Returns
Delete(ProductCollection, Group)
[Obsolete("Use CommandBuilder Delete(IEnumerable<Product> products, Group group) method instead.")]
public string Delete(ProductCollection products, Group group)
Parameters
productsProductCollectiongroupGroup
Returns
Delete(ProductCollection, Group, bool)
[Obsolete("Use CommandBuilder Delete(IEnumerable<Product> products, Group group, bool run) method instead.")]
public string Delete(ProductCollection products, Group group, bool run)
Parameters
productsProductCollectiongroupGrouprunbool
Returns
Delete(IEnumerable<Product>)
Deletes the specified products.
[Obsolete("Use 'Services.ProductGroups.DeleteRelations' instead")]
public CommandBuilder Delete(IEnumerable<Product> products)
Parameters
productsIEnumerable<Product>- The products.
Returns
- CommandBuilder
- The SQL query
Delete(IEnumerable<Product>, Group)
Deletes the specified products.
[Obsolete("Use 'Services.ProductGroups.DeleteRelations' instead")]
public CommandBuilder Delete(IEnumerable<Product> products, Group group)
Parameters
productsIEnumerable<Product>- The products.
groupGroup- The group.
Returns
- CommandBuilder
- The SQL query
Delete(IEnumerable<Product>, Group, bool)
Deletes the specified products.
[Obsolete("Use 'Services.ProductGroups.DeleteRelations' instead")]
public CommandBuilder Delete(IEnumerable<Product> products, Group group, bool run)
Parameters
productsIEnumerable<Product>- The products.
groupGroup- The group.
runbool- if set to
trueto delete.
Returns
- CommandBuilder
- The SQL query
Delete(string, string)
Deletes the instance from DB.
[Obsolete("Use 'Services.ProductGroups.DeleteRelation' instead")]
public void Delete(string relationProductId, string relationGroupId = "")
Parameters
relationProductIdstring- DB field name is GroupProductRelationProductID.
relationGroupIdstring- DB field name is GroupProductRelationGroupID.
DetachFromGroup(ProductCollection, string)
Detach products from group
[Obsolete("Use 'Services.ProductGroups.DeleteRelations' instead")]
public static int DetachFromGroup(ProductCollection products, string fromGroupId)
Parameters
productsProductCollection- The products
fromGroupIdstring- DB field name is GroupProductRelationGroupID.
Returns
- int
- The number of rows affected by the command.
GetProductGroupRelations(Product)
Gets the product group relations.
[Obsolete("Use 'Services.ProductGroups.GetProductGroupRelations' instead")]
public static ProductGroupRelationCollection GetProductGroupRelations(Product prod)
Parameters
prodProduct- DB field name is GroupProductRelationProductID.
Returns
GetProductGroupRelations(string)
Gets the product group relations.
[Obsolete("Use 'Services.ProductGroups.GetProductGroupRelations' instead")]
public static ProductGroupRelationCollection GetProductGroupRelations(string relationProductId)
Parameters
relationProductIdstring- DB field name is GroupProductRelationProductID.
Returns
GetProductGroupRelations(string, string)
Gets the product group relations.
[Obsolete("Use 'Services.ProductGroups.GetProductGroupRelations' instead")]
public static ProductGroupRelationCollection GetProductGroupRelations(string relationProductId, string groupId)
Parameters
relationProductIdstring- DB field name is GroupProductRelationProductID.
groupIdstring- DB field name is GroupProductRelationGroupID.
Returns
MoveToGroup(ProductCollection, string, string)
Moves to group.
[Obsolete("Use 'Services.ProductGroups.MoveToGroup' instead")]
public static int MoveToGroup(ProductCollection products, string toGroupId, string fromGroupId)
Parameters
productsProductCollection- The products.
toGroupIdstring- DB field name is GroupProductRelationGroupID.
fromGroupIdstring- DB field name is GroupProductRelationGroupID.
Returns
- int
- The number of rows affected by the command.
Save(string, string)
Saves the properties into DB.
[Obsolete("Use 'Services.ProductGroups.Save' instead")]
public void Save(string relationProductId, string relationGroupId)