public void GetAllBrand() { hst = AppLocalized.getLocale(modulePath); List<BrandItemsInfo> lstBrand = AspxShopOptionController.ShoppingOptionsByBrand(aspxCommonObj); BrandCount = lstBrand.Count; StringBuilder brandContent = new StringBuilder(); if (lstBrand != null && lstBrand.Count > 0) { StringBuilder brandHeader = new StringBuilder(); brandHeader.Append("<div class=\"divTitle\"><b><label class=\"cssClassShoppingOptionByPrice\" style=\"color:#006699\">"); brandHeader.Append(getLocale("By Brand")); brandHeader.Append("</label></b><img align=\"right\" alt=\"\" title=\"\" src=\""); brandHeader.Append(aspxTemplateFolderPath); brandHeader.Append("/images/arrow_up.png\"/></div>"); ltrBrandHeader.Text = brandHeader.ToString(); brandContent.Append("<ul class=\"cssShoppingBrand\">"); foreach (BrandItemsInfo item in lstBrand) { brandContent.Append("<li><label><input type=\"checkbox\" class=\"chkShopByBrand\" name=\""); brandContent.Append(item.BrandName); brandContent.Append("\" value=\""); brandContent.Append(item.BrandID); brandContent.Append("\"/><span>"); brandContent.Append(item.BrandName); brandContent.Append(" (" + item.ItemCount + ")"); brandContent.Append("</span></label></li>"); } brandContent.Append("</ul>"); if (lstBrand.Count > 7) { ltrBrandScroll.Text = brandContent.ToString(); } else if (lstBrand.Count <= 7) { ltrBrandList.Text = brandContent.ToString(); } } else { StringBuilder noBrandItems = new StringBuilder(); noBrandItems.Append("<div class=\"divTitle\"><b><label class=\"cssClassShoppingOptionByPrice\" style=\"color:#006699\">"); noBrandItems.Append(getLocale("By Brand")); noBrandItems.Append("</label></b><img align=\"right\" src=\""); noBrandItems.Append(aspxTemplateFolderPath); noBrandItems.Append("/images/arrow_up.png\"/></div>"); noBrandItems.Append("<div id=\"divBrandNotFound\"><span class=\"cssClassNotFound\">"); noBrandItems.Append(getLocale("There is no any Brand!")); noBrandItems.Append("</span></div>"); ltrBrandList.Text = noBrandItems.ToString(); } }
public void GetShoppingOptionForSlider() { hst = AppLocalized.getLocale(modulePath); List<ShoppingOptionInfoForSlider> lstShopOpt = AspxShopOptionController.ShoppingOptionForSlider(aspxCommonObj); StringBuilder brandContent = new StringBuilder(); ArrayList arrPrice = new ArrayList(); List<string> priceList = new List<string>(); if (lstShopOpt != null && lstShopOpt.Count > 0) { foreach (ShoppingOptionInfoForSlider item in lstShopOpt) { arrPrice.Add(item); priceList.Add(item.Price.ToString()); if (item.Price > maxPrice) { maxPrice = item.Price; } if (item.Price < minPrice || minPrice == 0) { minPrice = item.Price; } } foreach (ShoppingOptionInfoForSlider value in arrPrice) { if (value.Price >= minPrice && value.Price <= maxPrice) { IdsByPrice += value.ItemID + ","; } } IdsByPrice = IdsByPrice.Substring(0, IdsByPrice.LastIndexOf(",")); ArryPrice = string.Join(",", priceList.ToArray()); } else { } }
public void GetShoppingOptionsByPrice() { hst = AppLocalized.getLocale(modulePath); List<ShoppingOptionsInfo> lstShoppingOptionByprc = AspxShopOptionController.ShoppingOptionsByPrice(aspxCommonObj, Convert.ToInt32(ShoppingOptionRange)); StringBuilder divTitle = new StringBuilder(); divTitle.Append("<b><label class=\"cssClassShoppingOptionByPrice\" style=\"color:#006699\">"); divTitle.Append(getLocale("By Price")); divTitle.Append("</label></b><img align=\"right\" src=\""); divTitle.Append(aspxTemplateFolderPath); divTitle.Append("/images/arrow_up.png\"/>"); ltrByPriceTitle.Text = divTitle.ToString(); StringBuilder shopOptionByPrc = new StringBuilder(); if (lstShoppingOptionByprc != null && lstShoppingOptionByprc.Count > 0) { shopOptionByPrc.Append("<table id=\"tblShoppingOptionsByPrice\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"); shopOptionByPrc.Append("<tbody>"); for (int index = 0; index < lstShoppingOptionByprc.Count; index++) { if (index != 0) { if (index != lstShoppingOptionByprc.Count - 1) { if (index % 2 == 0) { shopOptionByPrc.Append("<tr class=\"sfEven\"><td><a onclick=\"ShopingOptions.ShoppingByPriceAndBrand("); shopOptionByPrc.Append(lstShoppingOptionByprc[index].LowerOption); shopOptionByPrc.Append(","); shopOptionByPrc.Append(lstShoppingOptionByprc[index].UpperOption); shopOptionByPrc.Append(");\" href=\"#\">"); shopOptionByPrc.Append("<span class=\"cssClassFormatCurrency\">"); shopOptionByPrc.Append(lstShoppingOptionByprc[index].LowerOption * Rate); shopOptionByPrc.Append("</span> - <span class=\"cssClassFormatCurrency\">"); shopOptionByPrc.Append(lstShoppingOptionByprc[index].UpperOption * Rate); shopOptionByPrc.Append("</span> ("); shopOptionByPrc.Append(lstShoppingOptionByprc[index].Count); shopOptionByPrc.Append(")</a></td></tr>"); } else { shopOptionByPrc.Append("<tr class=\"sfEven\"><td><a onclick=\"ShopingOptions.ShoppingByPriceAndBrand("); shopOptionByPrc.Append(lstShoppingOptionByprc[index].LowerOption); shopOptionByPrc.Append(","); shopOptionByPrc.Append(lstShoppingOptionByprc[index].UpperOption); shopOptionByPrc.Append(");\" href=\"#\">"); shopOptionByPrc.Append("<span class=\"cssClassFormatCurrency\">"); shopOptionByPrc.Append(lstShoppingOptionByprc[index].LowerOption * Rate); shopOptionByPrc.Append("</span> - <span class=\"cssClassFormatCurrency\">"); shopOptionByPrc.Append(lstShoppingOptionByprc[index].UpperOption * Rate); shopOptionByPrc.Append("</span> ("); shopOptionByPrc.Append(lstShoppingOptionByprc[index].Count); shopOptionByPrc.Append(")</a></td></tr>"); } } else { if (index % 2 == 0) { shopOptionByPrc.Append("<tr class=\"sfEven\"><td><a onclick=\"ShopingOptions.ShoppingByPriceAndBrand("); shopOptionByPrc.Append(lstShoppingOptionByprc[index].LowerOption); shopOptionByPrc.Append(","); shopOptionByPrc.Append(lstShoppingOptionByprc[index].UpperOption); shopOptionByPrc.Append(");\" href=\"#\">"); shopOptionByPrc.Append("<span> "); shopOptionByPrc.Append(getLocale("Above")); shopOptionByPrc.Append(" </span><span class=\"cssClassFormatCurrency\">"); shopOptionByPrc.Append(lstShoppingOptionByprc[index].LowerOption * Rate); shopOptionByPrc.Append("</span> ("); shopOptionByPrc.Append(lstShoppingOptionByprc[index].Count); shopOptionByPrc.Append(")</a></td></tr>"); } else { shopOptionByPrc.Append("<tr class=\"sfEven\"><td><a onclick=\"ShopingOptions.ShoppingByPriceAndBrand("); shopOptionByPrc.Append(lstShoppingOptionByprc[index].LowerOption); shopOptionByPrc.Append(","); shopOptionByPrc.Append(lstShoppingOptionByprc[index].UpperOption); shopOptionByPrc.Append(");\" href=\"#\">"); shopOptionByPrc.Append("<span> "); shopOptionByPrc.Append(getLocale("Above")); shopOptionByPrc.Append(" </span><span class=\"cssClassFormatCurrency\">"); shopOptionByPrc.Append(lstShoppingOptionByprc[index].LowerOption * Rate); shopOptionByPrc.Append("</span> ("); shopOptionByPrc.Append(lstShoppingOptionByprc[index].Count); shopOptionByPrc.Append(")</a></td></tr>"); } } } else { shopOptionByPrc.Append("<tr class=\"sfEven\"><td><a onclick=\"ShopingOptions.ShoppingByPriceAndBrand("); shopOptionByPrc.Append(lstShoppingOptionByprc[index].LowerOption); shopOptionByPrc.Append(","); shopOptionByPrc.Append(lstShoppingOptionByprc[index].UpperOption); shopOptionByPrc.Append(");\" href=\"#\">"); shopOptionByPrc.Append("<span> "); shopOptionByPrc.Append(getLocale("Below")); shopOptionByPrc.Append(" </span><span class=\"cssClassFormatCurrency\">"); shopOptionByPrc.Append(lstShoppingOptionByprc[index].UpperOption * Rate); shopOptionByPrc.Append("</span> ("); shopOptionByPrc.Append(lstShoppingOptionByprc[index].Count); shopOptionByPrc.Append(")</a></td></tr>"); } } } else { shopOptionByPrc.Append("<tr><td><span class=\"cssClassNotFound\">"); shopOptionByPrc.Append(getLocale("No Data Found!")); shopOptionByPrc.Append("</span></td></tr>"); } shopOptionByPrc.Append("</tbody></table>"); ltrShopByPrice.Text = shopOptionByPrc.ToString(); }