Class UniqueProduct
- Namespace
- Dynamicweb.Ecommerce.Orders
- Assembly
- Dynamicweb.Ecommerce.dll
Class to represent an unique product of customer order collection
public class UniqueProduct : IComparable
- Inheritance
-
UniqueProduct
- Implements
- Inherited Members
Examples
using System.Collections;
using Dynamicweb.Ecommerce.Orders;
using Dynamicweb.Rendering;
namespace Dynamicweb.Ecommerce.Examples.Orders
{
public class CustomerOrdersProductsRendererSample
{
public void RenderProductList(Template t, CustomerOrderCollection orders, int paragraphId)
{
// Fill list with unique products
ArrayList uniqueProducts = orders.UniqueProducts;
string productsHtml = "";
foreach (UniqueProduct up in uniqueProducts)
{
productsHtml += "<option";
if (Context.Current.Request["CCFilterProductID" + paragraphId] == up.ProductId)
{
productsHtml += " selected";
}
productsHtml += " value='" + up.ProductId + "'>" + up.ProductName + "</option>";
}
t.SetTag("CustomerOrderUniqueProducts", productsHtml);
}
}
}
Constructors
UniqueProduct(string, string)
Initializes a new instance of the UniqueProduct class.
public UniqueProduct(string id, string name)
Parameters
Fields
ProductId
Gets or sets the product ID.
public string ProductId
Field Value
Examples
Look at example forUniqueProduct
class
ProductName
Gets or sets the product ID.
public string ProductName
Field Value
Examples
Look at example forUniqueProduct
class
Methods
CompareTo(object)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(object obj)
Parameters
obj
object- An object to compare with this instance.
Returns
- int
- A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings:
Value
Meaning
Less than zero
This instance is less than
obj
. Zero This instance is equal toobj
. Greater than zero This instance is greater thanobj
.
Examples
class MyPage : System.Web.UI.Page
{
public ArrayList getSortedListOfProducts( ArrayList uniqueProducts )
{
return uniqueProducts.Sort();
}
}
Exceptions
- ArgumentException
obj
is not the same type as this instance.