Dynamicweb.eCommerce.Prices Namespace > PriceMatrix Class : paramKeyValue Method |
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(); } }
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