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
dataReader
IDataReader- 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
relationProductId
string- DB field name is GroupProductRelationProductID.
groupId
string- 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
products
ProductCollection
Returns
Delete(ProductCollection, Group)
[Obsolete("Use CommandBuilder Delete(IEnumerable<Product> products, Group group) method instead.")]
public string Delete(ProductCollection products, Group group)
Parameters
products
ProductCollectiongroup
Group
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
products
ProductCollectiongroup
Grouprun
bool
Returns
Delete(IEnumerable<Product>)
Deletes the specified products.
[Obsolete("Use 'Services.ProductGroups.DeleteRelations' instead")]
public CommandBuilder Delete(IEnumerable<Product> products)
Parameters
products
IEnumerable<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
products
IEnumerable<Product>- The products.
group
Group- 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
products
IEnumerable<Product>- The products.
group
Group- The group.
run
bool- if set to
true
to 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
relationProductId
string- DB field name is GroupProductRelationProductID.
relationGroupId
string- 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
products
ProductCollection- The products
fromGroupId
string- 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
prod
Product- 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
relationProductId
string- 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
relationProductId
string- DB field name is GroupProductRelationProductID.
groupId
string- 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
products
ProductCollection- The products.
toGroupId
string- DB field name is GroupProductRelationGroupID.
fromGroupId
string- 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)