Table of Contents

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

id string

The ID.

name string

The name.

Fields

ProductId

Gets or sets the product ID.

public string ProductId

Field Value

string

Examples

Look at example for UniqueProduct class

ProductName

Gets or sets the product ID.

public string ProductName

Field Value

string

Examples

Look at example for UniqueProduct 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 to obj. Greater than zero This instance is greater than obj.

Exceptions

ArgumentException

obj is not the same type as this instance.

To top