Dynamicweb 8 Documentation
paramKeyValue Method
Example 

The object.
DB field name.
The value.
Sets the params of different way depends from type of object: VariantOption, VariantCombination, Period, MultiplePrice.
Syntax
'Declaration
 
Public Sub paramKeyValue( _ 
   ByVal obj As Object, _ 
   ByRef key As String, _ 
   ByRef value As Object _ 
) 
public void paramKeyValue( 
   object obj,
   ref string key,
   ref object value 
)

Parameters

obj
The object.
key
DB field name.
value
The value.
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