Dynamicweb 8 Documentation
drawMatrixLine Method
Example 

The object.
The level count.
The params.
The currency default price.
Draws the matrix line in HTML.
Syntax
'Declaration
 
Public Function drawMatrixLine( _ 
   ByVal obj As Object, _ 
   ByVal levelCount As Integer, _ 
   ByVal Params As Hashtable, _ 
   ByVal CurrencyDefaultPrice As Hashtable _ 
) As String
public string drawMatrixLine( 
   object obj,
   int levelCount,
   Hashtable Params,
   Hashtable CurrencyDefaultPrice 
)

Parameters

obj
The object.
levelCount
The level count.
Params
The params.
CurrencyDefaultPrice
The currency default price.
Example
class MyPage : System.Web.UI.Page
{
    private Dynamicweb.eCommerce.Prices.PriceMatrix price;

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

    public string writeMatrixDimension(SortedList Dimensions, int level, Hashtable Params, Hashtable CurrencyDefaultPrice)
    {
        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        ICollection col = null;
        ICollection collection = null;

        col = (ICollection)Dimensions.GetValueList()[0];
        collection = price.getCollection(col);

        SortedList subDimensions = new SortedList();
        for (int i = 1; i <= Dimensions.Count - 1; i++)
        {
            subDimensions.Add(i, Dimensions.GetByIndex(i));
        }

        foreach (object obj in collection)
        {
            string key = string.Empty;
            object value = null;

            price.paramKeyValue(obj, ref key, ref value);
            Params.Add(key, value);

            Hashtable DefaultHash = new Hashtable();
            foreach (DictionaryEntry ItemCurr in CurrencyDefaultPrice)
            {
                DefaultHash[ItemCurr.Key] = ItemCurr.Value;
            }

            sb.Append(price.drawMatrixLine(obj, level, Params, CurrencyDefaultPrice));
            if (subDimensions.Count > 0)
            {
                sb.Append(writeMatrixDimension(subDimensions, level + 1, Params, CurrencyDefaultPrice));
            }

            CurrencyDefaultPrice.Clear();
            foreach (DictionaryEntry ItemReset in DefaultHash)
            {
                CurrencyDefaultPrice[ItemReset.Key] = ItemReset.Value;
            }

            Params.Remove(key);
        }
        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