Class CustomerProductList
- Namespace
- Dynamicweb.Ecommerce.CustomerCenter
- Assembly
- Dynamicweb.Ecommerce.dll
CustomerProductList class.
public class CustomerProductList : DbObject
- Inheritance
-
CustomerProductList
- Inherited Members
Constructors
CustomerProductList()
Initializes a new instance of the CustomerProductList class.
public CustomerProductList()
Properties
AccessUserId
Gets or sets the access user identifier.
public int AccessUserId { get; set; }
Property Value
- int
The access user identifier.
Description
Gets or sets the description.
public string Description { get; set; }
Property Value
- string
The description.
IsDefault
Gets or sets a value indicating whether this instance is default.
public bool IsDefault { get; set; }
Property Value
- bool
true
if this instance is default; otherwise,false
.
IsPublished
Gets or sets a value indicating whether this instance is published.
public bool IsPublished { get; set; }
Property Value
- bool
true
if this instance is published; otherwise,false
.
IsShared
Gets or sets a value indicating whether this instance is shared.
public bool IsShared { get; set; }
Property Value
- bool
true
if this instance is shared; otherwise,false
.
ListId
Gets or sets the list identifier.
public int ListId { get; set; }
Property Value
- int
The list identifier.
Name
Gets or sets the name.
public string Name { get; set; }
Property Value
- string
The name.
Products
Gets user's favorits products
public IEnumerable<CustomerProductListProduct> Products { get; }
Property Value
- IEnumerable<CustomerProductListProduct>
User's favorite products. The collection is read-only.
ProductsCount
Gets the count of products
public int ProductsCount { get; }
Property Value
- int
The count of products.
ProductsQuantity
Gets the quantity of products
public int ProductsQuantity { get; }
Property Value
- int
The quantity of products.
PublishedId
Gets or sets the published identifier.
public string PublishedId { get; set; }
Property Value
- string
The published identifier.
PublishedToDate
Gets or sets the published to date.
public DateTime? PublishedToDate { get; set; }
Property Value
- DateTime?
The published to date.
Type
Gets or sets the type.
public string Type { get; set; }
Property Value
- string
The type.
Methods
AddToFavorites(Product)
Adds to favorites.
public static void AddToFavorites(Product product)
Parameters
product
ProductThe product.
AddToFavorites(string, string)
Adds to favorites.
public static void AddToFavorites(string productId, string variantId)
Parameters
AddToFavorites(string, string, int)
Adds to favorites.
public static void AddToFavorites(string productId, string variantId, int favoriteListId)
Parameters
productId
stringThe product identifier.
variantId
stringThe variant identifier.
favoriteListId
intThe favorite list identifier.
AddToFavorites(string, string, string, string, string, int)
Adds to favorites.
public static void AddToFavorites(string productId, string variantId, string listName, string listType, string listDescription, int favoriteListId)
Parameters
productId
stringThe product identifier.
variantId
stringThe variant identifier.
listName
stringName of the list.
listType
stringType of the list.
listDescription
stringThe list description.
favoriteListId
intThe favorite list identifier.
AddToFavorites(string, string, string, string, string, int, int)
Adds to favorites.
public static void AddToFavorites(string productId, string variantId, string listName, string listType, string listDescription, int favoriteListId, int userId)
Parameters
productId
stringThe product identifier.
variantId
stringThe variant identifier.
listName
stringName of the list.
listType
stringType of the list.
listDescription
stringThe list description.
favoriteListId
intThe favorite list identifier.
userId
intThe user identifier.
ClearCache(User)
Clears the cache.
public static void ClearCache(User user)
Parameters
user
UserThe user.
ClearCache(UserGroup)
Clears the cache.
public static void ClearCache(UserGroup group)
Parameters
group
UserGroupThe group.
ClearCache(int)
Clears the cache.
public static void ClearCache(int userId)
Parameters
userId
intThe user identifier.
Delete(int)
Deletes the object with specified Id.
public override void Delete(int id)
Parameters
id
intSpecified Id.
Fill(IDataReader)
Fills the specified reader.
public override void Fill(IDataReader reader)
Parameters
reader
IDataReaderThe reader.
FillRow(DataRow)
Fills the row.
protected override void FillRow(DataRow row)
Parameters
row
DataRowThe row.
ForceInitializeAllProducts()
public void ForceInitializeAllProducts()
GeneratePublishedId()
Generates the published identifier.
public static string GeneratePublishedId()
Returns
- string
System.String.
GetDefaultList(IEnumerable<CustomerProductList>)
Gets the default favorite list by user id.
public static CustomerProductList GetDefaultList(IEnumerable<CustomerProductList> favouriteListCollection)
Parameters
favouriteListCollection
IEnumerable<CustomerProductList>The user id of favorite list.
Returns
- CustomerProductList
The favorites list
GetDefaultList(int)
Gets the default favorite list by user id.
public static CustomerProductList GetDefaultList(int userId)
Parameters
userId
intThe user id of favorite list.
Returns
- CustomerProductList
The favorites list
GetListByCustomerId(int)
Gets the favorites list by user id.
public static IEnumerable<CustomerProductList> GetListByCustomerId(int customerId)
Parameters
customerId
intThe id of user
Returns
- IEnumerable<CustomerProductList>
The favorites list
GetListById(int)
Gets the favorite list by id.
public static CustomerProductList GetListById(int id)
Parameters
id
intThe id of favorite list.
Returns
- CustomerProductList
The favorite list
GetListById(int, IEnumerable<CustomerProductList>)
Gets the list by identifier.
public static CustomerProductList GetListById(int id, IEnumerable<CustomerProductList> favouriteListCollection)
Parameters
id
intThe identifier.
favouriteListCollection
IEnumerable<CustomerProductList>The favourite list collection.
Returns
- CustomerProductList
CustomerProductList.
GetListByPublishedId(string)
Gets the favorite list by published id.
public static CustomerProductList GetListByPublishedId(string publishedId)
Parameters
publishedId
stringThe published id of favorite list.
Returns
- CustomerProductList
The favorite list
GetListByType(IEnumerable<CustomerProductList>, string)
Gets the favorites list by type.
public static IEnumerable<CustomerProductList> GetListByType(IEnumerable<CustomerProductList> productListCollection, string type)
Parameters
productListCollection
IEnumerable<CustomerProductList>The product list collection.
type
stringThe type.
Returns
- IEnumerable<CustomerProductList>
The favorites list by type
GetListByType(int, string)
Gets the favorites list by user id.
public static IEnumerable<CustomerProductList> GetListByType(int customerId, string type)
Parameters
Returns
- IEnumerable<CustomerProductList>
The favorites list
GetListTypesByCustomerNumber(string)
Gets the favorites list types by user customer number.
public static IEnumerable<string> GetListTypesByCustomerNumber(string customerNumber)
Parameters
customerNumber
stringThe user customer number
Returns
- IEnumerable<string>
The favorites list
GetListTypesByUser(int)
Gets the favorites list by user id.
public static IEnumerable<string> GetListTypesByUser(int customerId)
Parameters
customerId
intThe id of user
Returns
- IEnumerable<string>
The favorites list
GetListsByUserCustomerNumber(string)
Gets the lists by user customer number.
public static IEnumerable<CustomerProductList> GetListsByUserCustomerNumber(string customerNumber)
Parameters
customerNumber
stringThe customer number of user
Returns
- IEnumerable<CustomerProductList>
The favorites list
GetProductKey(string, string)
public static string GetProductKey(string productId, string variantId)
Parameters
Returns
GetProductLists(int, string, bool, string, bool, int, int)
Returns favorite lists for users or groups. They could be optionally sorted or filtered by search text and user/group id.
public static IEnumerable<CustomerProductList> GetProductLists(int userOrGroupId, string search, bool isShared, string sortField, bool isAscending, int startItem, int endItem)
Parameters
userOrGroupId
intThe user or group id.
search
stringThe text to search.
isShared
boolDescribes if favorite lists for groups should be get.
sortField
stringThe sorting property.
isAscending
boolThe order of sorting.
startItem
intStart index.
endItem
intEnd index.
Returns
GetProductLists(string, string, bool, int, int)
Returns all favorite lists. They could be optionally sorted of filtered by search text.
public static IEnumerable<CustomerProductList> GetProductLists(string search, string sortField, bool isAscending, int startItem, int endItem)
Parameters
search
stringThe text to search.
sortField
stringThe sorting property.
isAscending
boolThe order of sorting.
startItem
intStart index.
endItem
intEnd index.
Returns
GetProductListsCount(int, string, bool)
public static int GetProductListsCount(int userId, string search, bool isShared)
Parameters
Returns
GetProductLookup()
public Dictionary<string, Product> GetProductLookup()
Returns
RemoveFromFavorites(Order)
Removes from favorites.
public static void RemoveFromFavorites(Order order)
Parameters
order
OrderThe order.
RemoveFromFavorites(string, string)
Removes from favorites.
public static void RemoveFromFavorites(string productId, string variantId)
Parameters
RemoveFromFavorites(string, string, int, double)
Removes from favorites.
public static void RemoveFromFavorites(string productId, string variantId, int favoriteListId, double quantity)
Parameters
productId
stringThe product identifier.
variantId
stringThe variant identifier.
favoriteListId
intThe favorite list identifier.
quantity
doubleThe quantity.
RemoveFromFavorites(string, string, int, double, bool)
Removes from favorites.
public static void RemoveFromFavorites(string productId, string variantId, int favoriteListId, double quantity, bool isRemoveFromList)
Parameters
productId
stringThe product identifier.
variantId
stringThe variant identifier.
favoriteListId
intThe favorite list identifier.
quantity
doubleThe quantity.
isRemoveFromList
boolif set to
true
[is remove from list].
Save()
Saves current data to the database.
public override void Save()