Dynamicweb 8 Documentation
writeMatrixDimension Method
Example 

The dimensions.
The level.
The params.
The currency default price.
Writes the matrix dimension.
Syntax
'Declaration
 
Public Function writeMatrixDimension( _ 
   ByVal Dimensions As SortedList, _ 
   ByVal level As Integer, _ 
   ByVal Params As Hashtable, _ 
   ByVal CurrencyDefaultPrice As Hashtable _ 
) As String
public string writeMatrixDimension( 
   SortedList Dimensions,
   int level,
   Hashtable Params,
   Hashtable CurrencyDefaultPrice 
)

Parameters

Dimensions
The dimensions.
level
The level.
Params
The params.
CurrencyDefaultPrice
The currency default price.
Example
class MyPage : System.Web.UI.Page
{
    private Dynamicweb.eCommerce.Products.Product product;
    private SortedList _objectList;

    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        product = (Dynamicweb.eCommerce.Products.Product)Session["Ecom.Backend.Product"];
    }

    public SortedList objectList
    {
        get { return _objectList; }
        set { _objectList = value; }
    }

    public string writeMatrix(bool showEmpty)
    {
        Dynamicweb.eCommerce.Prices.PriceMatrix pm = new Dynamicweb.eCommerce.Prices.PriceMatrix();
        pm.generateMatrix();

        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        string PriceCss = null;

        Hashtable CurrencyDefaultPrice = new Hashtable();
        CurrencyDefaultPrice.Add(Dynamicweb.eCommerce.Common.Application.DefaultCurrency.Code, product.DefaultPrice);

        if (Dynamicweb.eCommerce.Common.Context.LanguageID != Dynamicweb.eCommerce.Common.Application.DefaultLanguage.LanguageID)
        {
            PriceCss = "style='filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);opacity:0.4;width:100%;'";
        }
        else
        {
            PriceCss = "style='width:100%;'";
        }

        sb.Append("<table border=0 cellpadding=0 cellspacing=0 width='100%' class=OutlookTableBorder " + PriceCss + ">");

        if (objectList.Count > 0)
        {
            sb.Append(pm.writeMatrixCurrencyHeader());
            sb.Append(pm.writeMatrixDimension(objectList, 0, new Hashtable(), CurrencyDefaultPrice));
        }

        if (showEmpty)
        {
            sb.Append(pm.writeMatrixCurrencyHeader(Translate.Translate("Ingen prioritet valgt !!!")));

            sb.Append("<tr height=20px id=rowMatrix name=rowMatrix className=OutlookItem class=OutlookItem>");
            sb.Append("<td>" + product.Name + "</td>");

            sb.Append(pm.writeMatrixPriceLine(new Hashtable(), CurrencyDefaultPrice));
            sb.Append("</tr>");
        }
        sb.Append("</table>");

        sb.Append("<input type=hidden name=HideTheMatrix id=HideTheMatrix value=0>");

        return sb.ToString();
    }
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

PriceMatrix Class
PriceMatrix Members

Send Feedback