protected void page_init(object sender, EventArgs e) { try { SageFrameRoute parentPage = (SageFrameRoute)this.Page; Categorykey = parentPage.Key; Categorykey = AspxUtility.fixedDecodeURIComponent(Categorykey); StoreID = GetStoreID; PortalID = GetPortalID; CustomerID = GetCustomerID; UserName = GetUsername; CultureName = GetCurrentCultureName; if (HttpContext.Current.Session.SessionID != null) { SessionCode = HttpContext.Current.Session.SessionID.ToString(); } if (!IsPostBack) { UserIp = HttpContext.Current.Request.UserHostAddress; IPAddressToCountryResolver ipToCountry = new IPAddressToCountryResolver(); ipToCountry.GetCountry(UserIp, out CountryName); OverRideSEOInfo(Categorykey, StoreID, PortalID, UserName, CultureName); StoreSettingConfig ssc = new StoreSettingConfig(); NoImageCategoryDetailPath = ssc.GetStoreSettingsByKey(StoreSetting.DefaultProductImageURL, StoreID, PortalID, CultureName); AllowAddToCart = ssc.GetStoreSettingsByKey(StoreSetting.ShowAddToCartButton, StoreID, PortalID, CultureName); AllowOutStockPurchase = ssc.GetStoreSettingsByKey(StoreSetting.AllowOutStockPurchase, StoreID, PortalID, CultureName); NoOfItemsInARow = 3;//int.Parse(ssc.GetStoreSettingsByKey(StoreSetting.NoOfDisplayItems, StoreID, PortalID, CultureName)); ItemDisplayMode = ssc.GetStoreSettingsByKey(StoreSetting.ItemDisplayMode, StoreID, PortalID, CultureName); } } catch (Exception ex) { ProcessException(ex); } }
public string BindChildCategory(List <CategoryInfo> response, int categoryID) { StringBuilder strListmaker = new StringBuilder(); string childNodes = string.Empty; foreach (CategoryInfo eachCat in response) { if (eachCat.CategoryLevel > 0) { if (eachCat.ParentID == categoryID) { strListmaker.Append("<li><a href=\""); strListmaker.Append(aspxRedirectPath); strListmaker.Append("category/"); string strRet = AspxUtility.fixedEncodeURIComponent(eachCat.AttributeValue); strListmaker.Append(strRet); strListmaker.Append(SageFrameSettingKeys.PageExtension); strListmaker.Append("\">"); strListmaker.Append(eachCat.AttributeValue); strListmaker.Append("</a>"); childNodes = BindChildCategory(response, eachCat.CategoryID); if (childNodes != string.Empty) { strListmaker.Append("<ul>"); strListmaker.Append(childNodes); strListmaker.Append("</ul>"); } strListmaker.Append("</li>"); } } } return(strListmaker.ToString()); }
private string GetCategoryOnly(List <BreadCrumInfo> bcfList, bool reverse) { StringBuilder breadCrumbsLi = new StringBuilder(); if (bcfList.Count > 0) { breadCrumbsLi.Append("<li class=\"first\"><a href="); breadCrumbsLi.Append(sageRedirectPath); breadCrumbsLi.Append("home"); breadCrumbsLi.Append(pageExtension); breadCrumbsLi.Append(" class=\"i-home\">home</a></li>"); if (reverse) { bcfList.Reverse(); } for (int i = 0; i < bcfList.Count - 1; i++) { breadCrumbsLi.Append("<li><a href=\""); breadCrumbsLi.Append(sageRedirectPath); breadCrumbsLi.Append("category/"); breadCrumbsLi.Append(AspxUtility.fixedEncodeURIComponent(bcfList[i].TabPath)); breadCrumbsLi.Append(pageExtension); breadCrumbsLi.Append("\">"); breadCrumbsLi.Append(bcfList[i].TabPath); breadCrumbsLi.Append("</a></li>"); } breadCrumbsLi.Append("<li class=\"last\">"); breadCrumbsLi.Append(System.Web.HttpUtility.HtmlDecode(bcfList[bcfList.Count - 1].TabPath)); breadCrumbsLi.Append("</li>"); } return(breadCrumbsLi.ToString()); }
public void GetAllBrandForSlider() { AspxCommonInfo aspxCommonObj = new AspxCommonInfo(); aspxCommonObj.StoreID = StoreID; aspxCommonObj.PortalID = PortalID; aspxCommonObj.UserName = UserName; aspxCommonObj.CultureName = CultureName; string aspxRootPath = ResolveUrl("~/"); hst = AppLocalized.getLocale(BrandModulePath); string pageExtension = SageFrameSettingKeys.PageExtension; AspxBrandViewController objBrand = new AspxBrandViewController(); List <BrandViewInfo> lstBrand = objBrand.GetAllBrandForSlider(aspxCommonObj, BrandCount); StringBuilder element = new StringBuilder(); if (lstBrand != null && lstBrand.Count > 0) { element.Append("<ul id=\"brandSlider\">"); foreach (BrandViewInfo value in lstBrand) { var imagepath = aspxRootPath + value.BrandImageUrl; string [] imageFile = value.BrandImageUrl.ToString().Split('/'); if (value.BrandImageUrl != "") { //Resize Image Dynamically InterceptImageController.ImageBuilder(imageFile[imageFile.Length - 1], ImageType.Small, ImageCategoryType.Brand, aspxCommonObj); } element.Append("<li><a href=\""); element.Append(aspxRedirectPath); element.Append("brand/"); element.Append(AspxUtility.fixedEncodeURIComponent(value.BrandName)); element.Append(pageExtension); element.Append("\"><img brandId=\""); element.Append(value.BrandID); element.Append("\" src=\""); element.Append(imagepath.Replace("uploads", "uploads/Small")); element.Append("\" alt=\""); element.Append(value.BrandName); element.Append("\" title=\""); element.Append(value.BrandName); element.Append("\" /></a></li>"); } element.Append("</ul>"); element.Append("<span class=\"cssClassViewMore\"><a href=\""); element.Append(aspxRedirectPath); element.Append(BrandAllPage); element.Append(pageExtension); element.Append("\">" + getLocale("View All Brands") + "</a></span>"); } else { element.Append("<span class='cssClassNotFound'>"); element.Append(getLocale("The store has no brand!")); element.Append("</span>"); } litSlide.Text = element.ToString(); }
private string GetSageBreadCrumb(string breadCrumbTitle) { List <BreadCrumInfo> breadCrumbList = AspxBreadCrumbController.GetBreadCrumb(breadCrumbTitle, aspxCommonObj); StringBuilder breadCrumbListHtml = new StringBuilder(); if (breadCrumbList.Count > 0) { breadCrumbListHtml.Append("<li class=\"first\"><a href="); breadCrumbListHtml.Append(sageRedirectPath); breadCrumbListHtml.Append("home"); breadCrumbListHtml.Append(pageExtension); breadCrumbListHtml.Append(" class=\"i-home\">"); breadCrumbListHtml.Append("home</a></li>"); for (int i = 1; i < breadCrumbList.Count - 1; i++) { breadCrumbListHtml.Append("<li><a href=\""); breadCrumbListHtml.Append(sageRedirectPath); breadCrumbListHtml.Append(AspxUtility.fixedEncodeURIComponent(breadCrumbList[i].TabPath)); breadCrumbListHtml.Append(pageExtension); breadCrumbListHtml.Append("\" >"); breadCrumbListHtml.Append(breadCrumbList[i].TabPath); breadCrumbListHtml.Append("</a></li>"); } breadCrumbListHtml.Append("<li class=\"last\">"); breadCrumbListHtml.Append(AspxUtility.fixedDecodeURIComponent(breadCrumbList[breadCrumbList.Count - 1].TabPath)); breadCrumbListHtml.Append("</li>"); } return(breadCrumbListHtml.ToString()); }
private void GetCategoryMenuList(AspxCommonInfo aspxCommonObj) { List <CategoryInfo> catInfo = AspxCategoryListController.GetCategoryMenuList(aspxCommonObj); if (catInfo.Count > 0) { int categoryID = 0; int parentID = 0; int? categoryLevel; string attributeValue = string.Empty;; StringBuilder catListmaker = new StringBuilder(); string catList = string.Empty; catListmaker.Append("<div class=\"cssClassCategoryNavHor\"><ul class='sf-menu'>"); string css, hrefParentCategory, pageExtension = SageFrameSettingKeys.PageExtension; foreach (CategoryInfo eachCat in catInfo) { css = string.Empty; if (eachCat.ChildCount > 0) { css = " class=\"cssClassCategoryParent\""; } else { css = ""; } categoryID = eachCat.CategoryID; parentID = eachCat.ParentID; categoryLevel = eachCat.CategoryLevel; attributeValue = eachCat.AttributeValue; if (eachCat.CategoryLevel == 0) { hrefParentCategory = string.Empty; hrefParentCategory = aspxRedirectPath + "category/" + AspxUtility.fixedEncodeURIComponent(eachCat.AttributeValue) + pageExtension; catListmaker.Append("<li"); catListmaker.Append(css); catListmaker.Append("><a href="); catListmaker.Append(hrefParentCategory); catListmaker.Append(">"); catListmaker.Append(eachCat.AttributeValue); catListmaker.Append("</a>"); if (eachCat.ChildCount > 0) { catListmaker.Append("<ul>"); itemPath += eachCat.AttributeValue; catListmaker.Append(BindChildCategory(catInfo, categoryID)); catListmaker.Append("</ul>"); } catListmaker.Append("</li>"); } itemPath = string.Empty; } catListmaker.Append("<div class=\"cssClassclear\"></div></ul></div>"); divCategoryListerH.InnerHtml = catListmaker.ToString(); } else { string strText = ("<span class=\"cssClassNotFound\">" + getLocale("This store has no category found!") + "</span>");//Need to add Local Text divCategoryListerH.InnerHtml = strText; } }
private void BindAllServices() { string serviceModulePath = this.AppRelativeTemplateSourceDirectory; string aspxTemplateFolderPath = ResolveUrl("~/") + "Templates/" + TemplateName; string aspxRootPath = ResolveUrl("~/"); hst = AppLocalized.getLocale(serviceModulePath); string pageExtension = SageFrameSettingKeys.PageExtension; ServiceItemController objService = new ServiceItemController(); List <ServiceItemSettingInfo> lstServiceSetting = objService.GetServiceItemSetting(aspxCommonObj); if (lstServiceSetting != null && lstServiceSetting.Count > 0) { foreach (var serviceSetting in lstServiceSetting) { isEnableService = serviceSetting.IsEnableService.ToString(); serviceCategoryInARow = serviceSetting.ServiceCategoryInARow.ToString(); serviceCategoryCount = serviceSetting.ServiceCategoryCount.ToString(); isEnableServiceRss = serviceSetting.IsEnableServiceRss.ToString(); serviceRssCount = serviceSetting.ServiceRssCount.ToString(); serviceDetailsPage = serviceSetting.ServiceDetailsPage; serviceRssPage = serviceSetting.ServiceRssPage; } } List <ServiceCategoryInfo> lstAllService = objService.GetAllServices(aspxCommonObj); StringBuilder allServiceViewBld = new StringBuilder(); allServiceViewBld.Append("<div id=\"divBindAllServices\" class=\"cssClassAllService\">"); if (lstAllService != null && lstAllService.Count > 0) { foreach (var allserviceInfo in lstAllService) { string serviceName = allserviceInfo.ServiceName; string imagePath = "Modules/AspxCommerce/AspxCategoryManagement/uploads/" + allserviceInfo.ServiceImagePath; if (allserviceInfo.ServiceImagePath == "") { imagePath = NoImageService; } else { //Resize Image Dynamically InterceptImageController.ImageBuilder(allserviceInfo.ServiceImagePath, ImageType.Medium, ImageCategoryType.Category, aspxCommonObj); } var hrefServices = aspxRedirectPath + serviceDetailsPage + "/" + AspxUtility.fixedEncodeURIComponent(serviceName) + pageExtension; allServiceViewBld.Append("<li><h3><a href=\"" + hrefServices + "\">"); allServiceViewBld.Append("<div class=\"cssClassImgWrapper\">"); allServiceViewBld.Append("<img src=\"" + aspxRootPath + imagePath.Replace("uploads", "uploads/Medium") + "\"/>"); allServiceViewBld.Append("</div>" + serviceName + "</a></h3></li>"); } } else { allServiceViewBld.Append("<span class=\"cssClassNotFound\">" + getLocale("There are no services available!") + "</span>"); } allServiceViewBld.Append("</div>"); ltrBindAllServices.Text = allServiceViewBld.ToString(); }
public string BindChildCategory(List <MegaCategoryViewInfo> response, int categoryID, AspxCommonInfo aspxCommonObj) { StringBuilder strListmaker = new StringBuilder(); string childNodes = string.Empty; foreach (MegaCategoryViewInfo eachCat in response) { if (eachCat.CategoryLevel > 0) { if (eachCat.ParentID == categoryID) { strListmaker.Append("<li>"); strListmaker.Append("<a href=\""); strListmaker.Append(aspxRedirectPath); strListmaker.Append("category/"); string strRet = AspxUtility.fixedEncodeURIComponent(eachCat.AttributeValue); strListmaker.Append(strRet); strListmaker.Append(SageFrameSettingKeys.PageExtension); strListmaker.Append("\">"); strListmaker.Append(eachCat.AttributeValue); strListmaker.Append("</a>"); childNodes = BindChildCategory(response, eachCat.CategoryID, aspxCommonObj); if (childNodes != string.Empty) { strListmaker.Append("<ul>"); strListmaker.Append(childNodes); strListmaker.Append("</ul>"); } if (showSubCatImage == true) { if (eachCat.CategoryLevel == 1) { if (eachCat.CategoryImagePath != null && eachCat.CategoryImagePath != "") { //Resize Image Dynamically InterceptImageController.ImageBuilder(eachCat.CategoryImagePath, ImageType.Medium, ImageCategoryType.Category, aspxCommonObj); string imagePath = aspxRedirectPath + categoryImagePath + eachCat.CategoryImagePath; strListmaker.Append("<div class=\"classMegaSubCatImage\"><img src=\""); strListmaker.Append(imagePath.Replace("uploads", "uploads/Small")); strListmaker.Append("\" alt=\""); strListmaker.Append(eachCat.AttributeValue); strListmaker.Append("\" title=\""); strListmaker.Append(eachCat.AttributeValue); strListmaker.Append("\" /></div>"); } } } strListmaker.Append("</li>"); } } } return(strListmaker.ToString()); }
protected void Page_Load(object sender, EventArgs e) { //Check more to decide where to put in page_init or here SageFrameRoute parentPage = (SageFrameRoute)this.Page; Categorykey = parentPage.Key; Categorykey = AspxUtility.fixedDecodeURIComponent(Categorykey); GetPortalCommonInfo(out StoreID, out PortalID, out CustomerID, out UserName, out CultureName, out SessionCode); AspxCommonInfo aspxCommonObj = new AspxCommonInfo(StoreID, PortalID, UserName, CultureName); if (!IsPostBack) { OverRideSEOInfo(Categorykey, aspxCommonObj); } string sortByOptionsDefault = string.Empty; string viewAsOptionsDefault = string.Empty; StoreSettingConfig ssc = new StoreSettingConfig(); ssc.GetStoreSettingParamEight(StoreSetting.DefaultProductImageURL, StoreSetting.ShowAddToCartButton, StoreSetting.AllowOutStockPurchase, StoreSetting.ItemDisplayMode, StoreSetting.SortByOptions, StoreSetting.SortByOptionsDefault, StoreSetting.ViewAsOptions, StoreSetting.ViewAsOptionsDefault, out NoImageCategoryDetailPath, out AllowAddToCart, out AllowOutStockPurchase, out ItemDisplayMode, out SortByOptions, out sortByOptionsDefault, out ViewAsOptions, out viewAsOptionsDefault, StoreID, PortalID, CultureName); NoOfItemsInARow = 3; SortByOptionsDefault = Int32.Parse(sortByOptionsDefault); ViewAsOptionsDefault = Int32.Parse(viewAsOptionsDefault); //Untill this if (!IsPostBack) { string templateName = TemplateName; IncludeCss("CategoryDetailcss", "/Templates/" + templateName + "/css/MessageBox/style.css", "/Templates/" + templateName + "/css/JQueryUIFront/jquery-ui.css", "/Templates/" + templateName + "/css/ToolTip/tooltip.css", "/Templates/" + templateName + "/css/JQueryCheckBox/uniform.default.css", "/Templates/" + templateName + "/css/MessageBox/style.css", "/Templates/" + templateName + "/css/CategoryBanner/cycle.css"); IncludeJs("CategoryDetailjs", "/js/Templating/tmpl.js", "/js/encoder.js", "/js/Paging/jquery.pagination.js", "/js/jquery.cycle.min.js", "/js/DateTime/date.js", "/js/MessageBox/jquery.easing.1.3.js", "/js/MessageBox/alertbox.js", "/js/jquery.cookie.js", "/js/Scroll/jquery.tinyscrollbar.min.js", "/js/JQueryCheckBox/jquery.uniform.js", "/Modules/AspxCommerce/DetailsBrowse/js/CategoryDetails.js"); } IncludeLanguageJS(); GetAspxTemplates(); GetAllSubCategoryForFilter(aspxCommonObj); if (IsCategoryHasItems == 1) { CreateSortViewOption(); GetShoppingFilterItemsResult(aspxCommonObj); } }
private void GetCategoryMenuList() { AspxCommonInfo aspxCommonObj = new AspxCommonInfo(); aspxCommonObj.StoreID = GetStoreID; aspxCommonObj.PortalID = GetPortalID; aspxCommonObj.UserName = GetUsername; aspxCommonObj.CultureName = GetCurrentCultureName; List <CategoryInfo> catInfo = AspxCategoryListController.GetCategoryMenuList(aspxCommonObj); if (catInfo != null && catInfo.Count > 0) { int categoryID = 0; StringBuilder catListmaker = new StringBuilder(); string catList = string.Empty; catListmaker.Append("<ul class='mega-menu' id='divMegaMenu'>"); foreach (CategoryInfo eachCat in catInfo) { categoryID = eachCat.CategoryID; if (eachCat.CategoryLevel == 0) { string hrefParentCategory = string.Empty; catListmaker.Append("<li><a href=\""); catListmaker.Append(aspxRedirectPath); catListmaker.Append("category/"); string strRet = AspxUtility.fixedEncodeURIComponent(eachCat.AttributeValue); catListmaker.Append(strRet); catListmaker.Append(SageFrameSettingKeys.PageExtension); catListmaker.Append("\">"); catListmaker.Append(eachCat.AttributeValue); catListmaker.Append("</a>"); if (eachCat.ChildCount > 0) { catListmaker.Append("<ul>"); catListmaker.Append(BindChildCategory(catInfo, categoryID)); catListmaker.Append("</ul>"); } catListmaker.Append("</li>"); } } catListmaker.Append("</ul>"); divCategoryVertical.InnerHtml = ("<div class=\"cssClassCategoryNav\">" + catListmaker + "</div>"); } else { string strText = ("<span id=\"spanCatNotFound\" class=\"cssClassNotFound\">" + getLocale("This store has no category found!") + " </span>");//Need to add Local Text divCategoryVertical.InnerHtml = strText; } }
public void GetShoppingOptionsByCategory() { AspxCommonInfo aspxCommonObj = new AspxCommonInfo(); aspxCommonObj.StoreID = StoreID; aspxCommonObj.PortalID = PortalID; aspxCommonObj.UserName = UserName; aspxCommonObj.CultureName = CultureName; int categoryId = 0; string pageExtension = SageFrameSettingKeys.PageExtension; string modulePath = this.AppRelativeTemplateSourceDirectory; hst = AppLocalized.getLocale(modulePath); List <CategoryDetailsInfo> lstCategory = AspxBrowseCategoryController.BindCategoryDetails(categoryId, count, level, aspxCommonObj); StringBuilder categoryOptions = new StringBuilder(); categoryOptions.Append("<div class=\"cssClassBrowseByCategory\" id=\"divCategoryItemsOptions\">"); if (lstCategory != null && lstCategory.Count > 0) { categoryOptions.Append("<h2>"); categoryOptions.Append(getLocale("Browse by")); categoryOptions.Append("</h2><ul>"); foreach (CategoryDetailsInfo item in lstCategory) { categoryOptions.Append("<li><a href=\""); categoryOptions.Append(aspxRedirectPath); categoryOptions.Append("category/"); categoryOptions.Append(AspxUtility.fixedEncodeURIComponent(item.CategoryName)); categoryOptions.Append(pageExtension); categoryOptions.Append("\" alt=\""); categoryOptions.Append(item.CategoryName); categoryOptions.Append("\" title=\""); categoryOptions.Append(item.CategoryName); categoryOptions.Append("\">"); categoryOptions.Append(item.CategoryName); categoryOptions.Append("</a></li>"); } categoryOptions.Append("</ul><div class=\"cssClassclear\"></div>"); } else { categoryOptions.Append("<span class=\"cssClassNotFound\">"); categoryOptions.Append(getLocale("No category with item is found!")); categoryOptions.Append("</span>"); } categoryOptions.Append("</div>"); ltrCategoryItemsOptions.Text = categoryOptions.ToString(); }
public string BindChildCategory(List <MegaCategoryViewInfo> response, int categoryID) { StringBuilder strListmaker = new StringBuilder(); string childNodes = string.Empty; foreach (MegaCategoryViewInfo eachCat in response) { if (eachCat.CategoryLevel > 0) { if (eachCat.ParentID == categoryID) { strListmaker.Append("<li>"); strListmaker.Append("<a href=\""); strListmaker.Append(aspxRedirectPath); strListmaker.Append("category/"); string strRet = AspxUtility.fixedEncodeURIComponent(eachCat.AttributeValue); strListmaker.Append(strRet); strListmaker.Append(SageFrameSettingKeys.PageExtension); strListmaker.Append("\">"); strListmaker.Append(eachCat.AttributeValue); strListmaker.Append("</a>"); childNodes = BindChildCategory(response, eachCat.CategoryID); if (childNodes != string.Empty) { strListmaker.Append("<ul>"); strListmaker.Append(childNodes); strListmaker.Append("</ul>"); } if (showSubCatImage == "true") { if (eachCat.CategoryLevel == 1) { if (eachCat.CategoryImagePath != null || eachCat.CategoryImagePath != "") { strListmaker.Append("<div class=\"classMegaSubCatImage\"><img src=\""); strListmaker.Append(categoryImagePath + eachCat.CategoryImagePath); strListmaker.Append("\" alt=" + eachCat.AttributeValue + " title=" + eachCat.AttributeValue + " /></div>"); } } } strListmaker.Append("</li>"); } } } return(strListmaker.ToString()); }
private string BindChildCategory(List <CategoryInfo> response, int categoryID) { StringBuilder strListmaker = new StringBuilder(); string childNodes = string.Empty;; string path = string.Empty;; itemPath += "/"; string pageExtension = SageFrameSettingKeys.PageExtension; foreach (CategoryInfo eachCat in response) { if (eachCat.CategoryLevel > 0) { if (eachCat.ParentID == categoryID) { string css = string.Empty; if (eachCat.ChildCount > 0) { css = " class=\"cssClassCategoryParent\""; } else { css = ""; } string hrefCategory = aspxRedirectPath + "category/" + AspxUtility.fixedEncodeURIComponent(eachCat.AttributeValue) + pageExtension; itemPath += eachCat.AttributeValue; strListmaker.Append("<li"); strListmaker.Append(css); strListmaker.Append("><a href="); strListmaker.Append(hrefCategory); strListmaker.Append(">"); strListmaker.Append(eachCat.AttributeValue); strListmaker.Append("</a>"); childNodes = BindChildCategory(response, eachCat.CategoryID); itemPath = itemPath.Replace(itemPath.LastIndexOf(eachCat.AttributeValue).ToString(), ""); if (childNodes != string.Empty) { strListmaker.Append("<ul>"); strListmaker.Append(childNodes); strListmaker.Append("</ul>"); } strListmaker.Append("</li>"); } } } return(strListmaker.ToString()); }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { IncludeCss("BrandItems1", "/Templates/" + TemplateName + "/css/MessageBox/style.css", "/Templates/" + TemplateName + "/css/ToolTip/tooltip.css", "/Templates/" + TemplateName + "/css/FancyDropDown/fancy.css"); IncludeJs("BrandItems1", "/js/jquery.cookie.js", "/js/Templating/tmpl.js", "/js/encoder.js", "/js/Paging/jquery.pagination.js", "/js/Templating/AspxTemplate.js", "/js/MessageBox/jquery.easing.1.3.js", "/js/MessageBox/alertbox.js", "/js/jquery.tipsy.js", "/js/FancyDropDown/itemFancyDropdown.js", "/js/SageFrameCorejs/itemTemplateView.js"); StoreID = GetStoreID; PortalID = GetPortalID; CustomerID = GetCustomerID; UserName = GetUsername; CultureName = GetCurrentCultureName; StoreSettingConfig ssc = new StoreSettingConfig(); DefaultShoppingOptionImgPath = ssc.GetStoreSettingsByKey(StoreSetting.DefaultProductImageURL, StoreID, PortalID, CultureName); AllowAddToCart = ssc.GetStoreSettingsByKey(StoreSetting.ShowAddToCartButton, StoreID, PortalID, CultureName); AllowOutStockPurchase = ssc.GetStoreSettingsByKey(StoreSetting.AllowOutStockPurchase, StoreID, PortalID, CultureName); NoOfItemsInARow = int.Parse(ssc.GetStoreSettingsByKey(StoreSetting.NoOfDisplayItems, StoreID, PortalID, CultureName)); ItemDisplayMode = ssc.GetStoreSettingsByKey(StoreSetting.ItemDisplayMode, StoreID, PortalID, CultureName); if (HttpContext.Current.Session.SessionID != null) { SessionCode = HttpContext.Current.Session.SessionID.ToString(); } UserIP = HttpContext.Current.Request.UserHostAddress; IPAddressToCountryResolver ipToCountry = new IPAddressToCountryResolver(); ipToCountry.GetCountry(UserIP, out CountryName); SageFrameRoute parentPage = (SageFrameRoute)this.Page; BrandName = AspxUtility.fixedDecodeURIComponent(parentPage.Key); IncludeLanguageJS(); GetAspxTemplates(); } IncludeLanguageJS(); } catch (Exception ex) { ProcessException(ex); } }
private void BindBrandRss(List <BrandRssInfo> brandRssContent, AspxCommonInfo aspxCommonObj) { string x = HttpContext.Current.Request.ApplicationPath; string authority = HttpContext.Current.Request.Url.Authority; string pageUrl = authority + x; string pageURL = Request.Url.AbsoluteUri; string[] path = pageURL.Split('?'); string pagepath = path[0]; HttpContext.Current.Response.Clear(); HttpContext.Current.Response.ContentType = "text/xml"; XmlTextWriter rssXml = new XmlTextWriter(HttpContext.Current.Response.OutputStream, Encoding.UTF8); rssXml.WriteStartDocument(); rssXml.WriteStartElement("rss"); rssXml.WriteAttributeString("version", "2.0"); rssXml.WriteStartElement("channel"); rssXml.WriteElementString("link", pagepath); switch (rssOption) { case "brands": rssXml.WriteElementString("title", getLocale("AspxCommerce Popular Brands")); break; case "fbrands": rssXml.WriteElementString("title", getLocale("AspxCommerce Featured Brands")); break; case "abrands": rssXml.WriteElementString("title", getLocale("AspxCommerce All Brands")); break; default: break; } if (brandRssContent.Count > 0) { foreach (BrandRssInfo rssFeedBrand in brandRssContent) { rssXml.WriteStartElement("item"); rssXml.WriteElementString("title", rssFeedBrand.BrandName); rssXml.WriteElementString("link", "http://" + pageUrl + "/brand/" + AspxUtility.fixedEncodeURIComponent(rssFeedBrand.BrandName) + SageFrameSettingKeys.PageExtension); rssXml.WriteStartElement("description"); string description = ""; description += "<div>"; string [] brandURL = rssFeedBrand.BrandImageUrl.Split('/'); string brandImage = brandURL[brandURL.Length - 1]; if (brandImage != "") { //Resize Image Dynamically InterceptImageController.ImageBuilder(brandImage, ImageType.Small, ImageCategoryType.Brand, aspxCommonObj); } description += "<div><a href=http://" + pageUrl + "/brand/" + rssFeedBrand.BrandName + SageFrameSettingKeys.PageExtension + ">"; description += "<img src=http://" + pageUrl + "/" + rssFeedBrand.BrandImageUrl.Replace("uploads", "uploads/Small") + " />"; description += "</a></div>"; description += "<p>" + HttpUtility.HtmlDecode(rssFeedBrand.BrandDescription) + "</p>"; description += "</div>"; rssXml.WriteCData(description); rssXml.WriteEndElement(); rssXml.WriteElementString("pubDate", rssFeedBrand.AddedOn); rssXml.WriteEndElement(); } } else { rssXml.WriteStartElement("item"); rssXml.WriteElementString("title", ""); rssXml.WriteElementString("link", ""); rssXml.WriteStartElement("description"); var description = ""; description = "<div><h2><span>" + getLocale("This store has no items listed yet!") + "</span></h2></div>"; rssXml.WriteCData(description); rssXml.WriteEndElement(); rssXml.WriteEndElement(); } rssXml.WriteEndElement(); rssXml.WriteEndElement(); rssXml.WriteEndDocument(); rssXml.Flush(); rssXml.Close(); HttpContext.Current.Response.End(); }
private void GetCategoryMenuList(AspxCommonInfo aspxCommonObj) { categoryImagePath = "Modules/AspxCommerce/AspxCategoryManagement/uploads/"; string scriptAdd = string.Empty; string modulePath = this.AppRelativeTemplateSourceDirectory; hst = AppLocalized.getLocale(modulePath); MegaCategoryController objCat = new MegaCategoryController(); List <MegaCategoryViewInfo> megaCatIfo = objCat.GetCategoryMenuList(aspxCommonObj); if (megaCatIfo != null && megaCatIfo.Count > 0) { int categoryID = 0; StringBuilder catListmaker = new StringBuilder(); if (modeOfView == "vertical") { catListmaker.Append( "<div id=\"divCatHeader\" class=\"divHeaderTitle\"><h2 class=\"cssClassLeftHeader\"><span>"); catListmaker.Append(getLocale("Categories")); catListmaker.Append("</span>"); catListmaker.Append( "<a class=\"cssRssImage\" href=\"#\" style=\"display: none\"><img id=\"categoryRssImage\" alt=\"\" src=\"\" title=\"\" /></a></h2></div>"); catListmaker.Append("<ul class='mega-menuV' id='divMegaMenu'>"); } else if (modeOfView == "horizontal") { catListmaker.Append("<ul class='mega-menuH' id='mega-menuH'>"); } else { catListmaker.Append("<div id=\"divCatHeader\" style='display:none'><span>"); catListmaker.Append(getLocale("Categories")); catListmaker.Append("</span></div>"); catListmaker.Append("<ul class='mega-menuV cssMegaCategoryLi' id='divMegaMenu'>"); catListmaker.Append("<div class=\"cssCollapable\"><h2><span>"); catListmaker.Append(getLocale("All Categories")); catListmaker.Append("</span><a class=\"cssRssImage\" href=\"#\" style=\"display: none\"><img id=\"categoryRssImage\" alt=\"\" src=\"\" title=\"\" /></a></h2></div>"); } foreach (MegaCategoryViewInfo eachCat in megaCatIfo) { categoryID = eachCat.CategoryID; if (eachCat.CategoryLevel == 0) { catListmaker.Append("<li><a href=\""); catListmaker.Append(aspxRedirectPath); catListmaker.Append("category/"); string strRet = AspxUtility.fixedEncodeURIComponent(eachCat.AttributeValue); catListmaker.Append(strRet); catListmaker.Append(SageFrameSettingKeys.PageExtension); catListmaker.Append("\">"); catListmaker.Append(eachCat.AttributeValue); catListmaker.Append("</a>"); if (eachCat.ChildCount > 0) { catListmaker.Append("<ul>"); catListmaker.Append(BindChildCategory(megaCatIfo, categoryID, aspxCommonObj)); if (showCatImage == true) { if (eachCat.CategoryImagePath != null && eachCat.CategoryImagePath != "") { //Resize Image Dynamically InterceptImageController.ImageBuilder(eachCat.CategoryImagePath, ImageType.Medium, ImageCategoryType.Category, aspxCommonObj); string imagePath = aspxRedirectPath + categoryImagePath + eachCat.CategoryImagePath; catListmaker.Append("<div class=\"classCatImage\"><img src=\""); catListmaker.Append(imagePath.Replace("uploads", "uploads/Medium")); catListmaker.Append("\" alt=\""); catListmaker.Append(eachCat.AttributeValue); catListmaker.Append("\" title=\""); catListmaker.Append(eachCat.AttributeValue); catListmaker.Append("\" /></div>"); } } catListmaker.Append("</ul>"); } catListmaker.Append("</li>"); } } catListmaker.Append("</ul>"); catListmaker.Append("<div id=\"sf-Responsive-Cat\" style=\"display:none;\">"); catListmaker.Append("<div id=\"sf-CatMenu\">"); catListmaker.Append(getLocale("Categories")); catListmaker.Append("</div>"); catListmaker.Append("<ul class=\"sf-CatContainer\" style=\"display:none;\">"); foreach (MegaCategoryViewInfo eachCat in megaCatIfo) { categoryID = eachCat.CategoryID; if (eachCat.CategoryLevel == 0) { if (eachCat.ChildCount > 0) { catListmaker.Append("<li class=\"parent\">"); } else { catListmaker.Append("<li>"); } catListmaker.Append("<a href=\""); catListmaker.Append(aspxRedirectPath); catListmaker.Append("category/"); string strRet = AspxUtility.fixedEncodeURIComponent(eachCat.AttributeValue); catListmaker.Append(strRet); catListmaker.Append(SageFrameSettingKeys.PageExtension); catListmaker.Append("\">"); catListmaker.Append(eachCat.AttributeValue); catListmaker.Append("</a>"); if (eachCat.ChildCount > 0) { catListmaker.Append("<ul style=\"display:none;\">"); catListmaker.Append(BindResChildCategory(megaCatIfo, categoryID, aspxCommonObj)); catListmaker.Append("</ul style=\"display:none;\">"); } catListmaker.Append("</li>"); } } catListmaker.Append("</ul></div>"); divMegaCategory.InnerHtml = catListmaker.ToString(); } else { string strText = string.Empty; if (modeOfView == "collapseable") { strText = "<div class=\"cssCollapable\"><h2><span>" + getLocale("All Categories") + "</span><a class=\"cssRssImage\" href=\"#\" style=\"display: none\"><img id=\"categoryRssImage\" alt=\"\" src=\"\" title=\"\" /></a></h2></div>"; } strText += ("<span id=\"spanCatNotFound\" class=\"cssClassNotFound\">" + getLocale("This store has no category found!") + "</span>");//Need to add Local Text divMegaCategory.InnerHtml = strText; } }
public void GetAllSubCategoryForFilter(AspxCommonInfo aspxCommonObj) { string resolvedUrl = ResolveUrl("~/"); string modulePath = this.AppRelativeTemplateSourceDirectory; hst = AppLocalized.getLocale(modulePath); string aspxTemplateFolderPath = resolvedUrl + "Templates/" + TemplateName; DataSet ds = AspxFilterController.GetCategoryDetailInfoForFilter(Categorykey, aspxCommonObj); if (ds != null && ds.Tables != null && ds.Tables.Count > 0) { StringBuilder elem = new StringBuilder(); DataTable dtSubCatWithItems = ds.Tables[0]; elem.Append("<div class=\"filter\">"); if (dtSubCatWithItems != null && dtSubCatWithItems.Rows.Count > 0) { elem.Append("<div id=\"divCat\" value=\"b01\" class=\"cssClasscategorgy\">"); elem.Append("<div class=\"divTitle\"><b><label style=\"color:#006699\">"); elem.Append(getLocale("Categories")); elem.Append("</label></b><img align=\"right\" src=\""); elem.Append(aspxTemplateFolderPath); elem.Append("/images/arrow_up.png\"/></div> <div id=\"scrollbar1\" class=\"cssClassScroll\"><div class=\"viewport\"><div class=\"overview\" id=\"catOverview\"><div class=\"divContentb01\"><ul id=\"cat\">"); for (int i = 0; i < dtSubCatWithItems.Rows.Count; i++) { elem.Append("<li><label><input class=\"chkCategory\" type=\"checkbox\" name=\""); elem.Append(dtSubCatWithItems.Rows[i]["CategoryName"]); elem.Append("\" ids=\""); elem.Append(dtSubCatWithItems.Rows[i]["CategoryID"]); elem.Append("\" value=\""); elem.Append(dtSubCatWithItems.Rows[i]["CategoryName"]); elem.Append("\"/> "); elem.Append(dtSubCatWithItems.Rows[i]["CategoryName"]); elem.Append("<span> ("); elem.Append(dtSubCatWithItems.Rows[i]["ItemCount"]); elem.Append(")</span></label></li>"); } elem.Append("</ul></div></div></div></div></div>"); } string brandFilter = GetAllBrandForCategory(aspxCommonObj); elem.Append(brandFilter); elem.Append("</div>"); ltrFilter.Text = elem.ToString(); DataTable dtCatSlider = ds.Tables[1]; if (dtCatSlider != null && dtCatSlider.Rows.Count > 0) { string Imagelist = string.Empty; StringBuilder strCatHeadSlider = new StringBuilder(); StringBuilder strCatHeadScript = new StringBuilder(); bool isNoCategoryImage = false; string categoryImagePath = "Modules/AspxCommerce/AspxCategoryManagement/uploads/"; int imgCount = 0; strCatHeadSlider.Append("<div id=\"divHeader\" class=\"cssClassSlider\" style=\"display: none;\">"); strCatHeadSlider.Append("<div id=\"slider-container\"><div id=\"sliderObj\" class=\"cat-slideshow-wrap\">"); strCatHeadSlider.Append("<div class=\"cat_Slides cat-slide-container\">"); for (int i = 0; i < dtCatSlider.Rows.Count; i++) { if (dtCatSlider.Rows[i]["CategoryImage"].ToString() != string.Empty) { string[] imgUrlSegments = dtCatSlider.Rows[i]["CategoryImage"].ToString().Split('/'); string imgToBeAdded = imgUrlSegments[imgUrlSegments.Length - 1] + ';'; Imagelist += imgToBeAdded; isNoCategoryImage = true; string catDesc = dtCatSlider.Rows[i]["CategoryShortDesc"].ToString(); if (catDesc.Length > 300) { catDesc = catDesc.Substring(0, 300); int index = 0; index = catDesc.LastIndexOf(' '); catDesc = catDesc.Substring(0, index); catDesc = catDesc + "..."; } //check for this string href = resolvedUrl + "category/" + AspxUtility.fixedEncodeURIComponent(dtCatSlider.Rows[i]["CategoryName"].ToString()) + SageFrameSettingKeys.PageExtension; imgCount++; string catImagePath = dtCatSlider.Rows[i]["CategoryImage"].ToString(); strCatHeadSlider.Append("<div class=\"cat-slide-container-inner\"><div class=\"cssCatImage\"><a href="); strCatHeadSlider.Append(href); strCatHeadSlider.Append("><img src='"); strCatHeadSlider.Append(resolvedUrl); strCatHeadSlider.Append(categoryImagePath); strCatHeadSlider.Append(catImagePath); strCatHeadSlider.Append("' alt='"); strCatHeadSlider.Append(dtCatSlider.Rows[i]["CategoryName"]); strCatHeadSlider.Append("' title='"); strCatHeadSlider.Append(dtCatSlider.Rows[i]["CategoryName"]); strCatHeadSlider.Append("' /></a></div><div class=\"cssCatDesc\"><span>"); strCatHeadSlider.Append(dtCatSlider.Rows[i]["CategoryName"]); strCatHeadSlider.Append("</span><p>"); strCatHeadSlider.Append(catDesc); strCatHeadSlider.Append("</p></div></div>"); } } if (isNoCategoryImage) { InterceptImageController objImageResize = new InterceptImageController(); objImageResize.DynamicImageResizer(Imagelist, "Medium", "Category", aspxCommonObj); } strCatHeadSlider.Append("</div>"); strCatHeadSlider.Append("<div class=\"slideshow-progress-bar-wrap\" style=\"display: none;\">"); strCatHeadSlider.Append("<div class=\"highlight-bar\">"); strCatHeadSlider.Append("<div class=\"edge left\"></div><div class=\"edge right\"></div>"); strCatHeadSlider.Append("</div><div class=\"slideshow-progress-bar\"></div></div></div></div>"); strCatHeadSlider.Append("</div>"); strCatHeadScript.Append("$('#divHeader').show();"); if (imgCount > 1) { strCatHeadScript.Append("var catSlideshowWrap = jQuery('#slider-container').find('#sliderObj');"); strCatHeadScript.Append("var catSlidesContainer = catSlideshowWrap.find('div.cat-slide-container');"); strCatHeadScript.Append("var catSlides = catSlidesContainer.children('div');"); strCatHeadScript.Append("var pager = catSlideshowWrap.find('div.slideshow-progress-bar-wrap div.slideshow-progress-bar');"); strCatHeadScript.Append("var highlightBar = catSlideshowWrap.find('div.highlight-bar');"); strCatHeadScript.Append("var pagerMarkup = new Array();"); strCatHeadScript.Append("var pagerElPercentW = 1 / catSlides.length * 100;"); strCatHeadScript.Append("catSlides.each(function (i) {"); strCatHeadScript.Append("var oneBasedIndex = i + 1;"); strCatHeadScript.Append("pagerMarkup.push('<div class=pagerLink style=width: ' + pagerElPercentW + '%;><div class=pager' + oneBasedIndex + '></div></div>');"); strCatHeadScript.Append("});"); strCatHeadScript.Append("pager.append(pagerMarkup.join(''));"); strCatHeadScript.Append("highlightBar.css('width', pagerElPercentW + '%');"); strCatHeadScript.Append("var TRANSITION_SPEED = 500;"); strCatHeadScript.Append("catSlidesContainer.cycle({"); strCatHeadScript.Append("activePagerClass: 'active',"); strCatHeadScript.Append("before: function (curr, next, opts) {"); strCatHeadScript.Append("highlightBar.stop(true).animate("); strCatHeadScript.Append("{"); strCatHeadScript.Append("'left': pager.find('div.pagerLink').eq(jQuery(next).index()).position().left"); strCatHeadScript.Append("},"); strCatHeadScript.Append("TRANSITION_SPEED"); strCatHeadScript.Append(");"); strCatHeadScript.Append("},"); strCatHeadScript.Append("fx: 'fade',"); strCatHeadScript.Append("speed: TRANSITION_SPEED,"); strCatHeadScript.Append("timeout: 5000,"); strCatHeadScript.Append("pause: 1,"); strCatHeadScript.Append("pauseOnPagerHover: 1,"); strCatHeadScript.Append("pager: '#slider-container #sliderObj div.slideshow-progress-bar-wrap div.slideshow-progress-bar',"); strCatHeadScript.Append("pagerAnchorBuilder: function (idx, slide) {"); strCatHeadScript.Append("return '#slider-container #sliderObj div.slideshow-progress-bar-wrap div.slideshow-progress-bar div.pagerLink:eq(' + idx + ')';"); strCatHeadScript.Append("},"); strCatHeadScript.Append("pagerEvent: 'mouseenter.cycle'"); strCatHeadScript.Append("});"); strCatHeadScript.Append("$('.slideshow-progress-bar-wrap').show();"); strCatHeadScript.Append("}"); } if (!isNoCategoryImage) { strCatHeadScript.Append(" $('#divHeader').remove();"); } string script = GetStringScript(strCatHeadScript.ToString()); strCatHeadSlider.Append(script); ltrCatSlider.Text = strCatHeadSlider.ToString(); } } }
private void GetCategoryMenuList() { categoryImagePath = "/Modules/AspxCommerce/AspxCategoryManagement/uploads/"; AspxCommonInfo aspxCommonObj = new AspxCommonInfo(); aspxCommonObj.StoreID = GetStoreID; aspxCommonObj.PortalID = GetPortalID; aspxCommonObj.UserName = GetUsername; aspxCommonObj.CultureName = GetCurrentCultureName; string scriptAdd = string.Empty; string modulePath = this.AppRelativeTemplateSourceDirectory; hst = AppLocalized.getLocale(modulePath); List <MegaCategoryViewInfo> megaCatIfo = MegaCategoryController.GetCategoryMenuList(aspxCommonObj); if (megaCatIfo != null && megaCatIfo.Count > 0) { int categoryID = 0; StringBuilder catListmaker = new StringBuilder(); if (modeOfView == "vertical") { catListmaker.Append( "<div class=\"divHeaderTitle\"><h2 class=\"cssClassLeftHeader\"><span>" + getLocale("Categories") + "</span>"); catListmaker.Append( "<a class=\"cssRssImage\" href=\"#\" style=\"display: none\"><img id=\"categoryRssImage\" alt=\"\" src=\"\" title=\"\" /></a></h2></div>"); catListmaker.Append("<ul class='mega-menuV' id='divMegaMenu'>"); scriptAdd = "$(\"#divMegaCategoryContainer\").show();$('#divMegaMenu').dcVerticalMegaMenu({rowItems:" + "'" + noOfColumn + "'" + ",speed: " + "'" + speed + "'" + ",effect:" + "'" + effect + "'" + ",direction: " + "'" + direction + "'" + "});"; } else if (modeOfView == "horizontal") { catListmaker.Append("<ul class='mega-menuH' id='mega-menuH'>"); scriptAdd = "$(\"#divMegaCategoryContainer\").show();$('#mega-menuH').dcMegaMenu({rowItems:" + "'" + noOfColumn + "'" + ",speed:" + "'" + speed + "'" + ",effect:" + "'" + effect + "'" + ",event:" + "'" + eventMega + "'" + ",fullWidth: true});"; } else { catListmaker.Append("<ul class='mega-menuV cssMegaCategoryLi' id='divMegaMenu'>"); catListmaker.Append( "<div class=\"cssCollapable\"><h2><span>" + getLocale("All Categories") + "</span><a class=\"cssRssImage\" href=\"#\" style=\"display: none\"><img id=\"categoryRssImage\" alt=\"\" src=\"\" title=\"\" /></a></h2></div>"); scriptAdd = "$(\"#divMegaCategoryContainer\").show();$('#divMegaMenu').dcVerticalMegaMenu({rowItems:" + "'" + noOfColumn + "'" + ",speed: " + "'" + speed + "'" + ",effect:" + "'" + effect + "'" + ",direction: " + "'" + direction + "'" + "});$('#divMegaMenu li').hide();$('#divMegaMenu').mouseover(function(){$('#divMegaMenu li').show();});$('#divMegaMenu').mouseout(function(){$('#divMegaMenu li').hide();});"; } foreach (MegaCategoryViewInfo eachCat in megaCatIfo) { categoryID = eachCat.CategoryID; if (eachCat.CategoryLevel == 0) { catListmaker.Append("<li><a href=\""); catListmaker.Append(aspxRedirectPath); catListmaker.Append("category/"); string strRet = AspxUtility.fixedEncodeURIComponent(eachCat.AttributeValue); catListmaker.Append(strRet); catListmaker.Append(SageFrameSettingKeys.PageExtension); catListmaker.Append("\">"); catListmaker.Append(eachCat.AttributeValue); catListmaker.Append("</a>"); if (eachCat.ChildCount > 0) { catListmaker.Append("<ul>"); catListmaker.Append(BindChildCategory(megaCatIfo, categoryID)); if (showCatImage == "true") { if (eachCat.CategoryImagePath != null || eachCat.CategoryImagePath != "") { catListmaker.Append("<div class=\"classCatImage\"><img src=\""); catListmaker.Append(categoryImagePath + eachCat.CategoryImagePath); catListmaker.Append("\" alt=" + eachCat.AttributeValue + " title=" + eachCat.AttributeValue + " /></div>"); } } catListmaker.Append("</ul>"); } catListmaker.Append("</li>"); } } catListmaker.Append("</ul>"); catListmaker.Append(GetStringScript(scriptAdd)); divMegaCategory.InnerHtml = catListmaker.ToString(); } else { string strText = string.Empty; if (modeOfView == "collapseable") { strText = "<div class=\"cssCollapable\"><h2><span>" + getLocale("All Categories") + "</span><a class=\"cssRssImage\" href=\"#\" style=\"display: none\"><img id=\"categoryRssImage\" alt=\"\" src=\"\" title=\"\" /></a></h2></div>"; } strText += ("<span id=\"spanCatNotFound\" class=\"cssClassNotFound\">" + getLocale("This store has no category found!") + "</span>");//Need to add Local Text scriptAdd = "$(\"#divMegaCategoryContainer\").show();"; strText += GetStringScript(scriptAdd); divMegaCategory.InnerHtml = strText; } }
private string switchCase(string breadCrumbApplicationPath, string breadCrumbFileName, string compareSegment) { breadCrumbApplicationPath = AspxUtility.fixedDecodeURIComponent(System.Web.HttpUtility.UrlDecode(breadCrumbApplicationPath).Replace("/", "").Trim()); breadCrumbFileName = AspxUtility.fixedDecodeURIComponent(System.Web.HttpUtility.UrlDecode(breadCrumbFileName).Replace("/", "").Trim()).Split('.')[0]; StringBuilder breadCrumblist = new StringBuilder(); List <BreadCrumInfo> list = new List <BreadCrumInfo>(); string current = string.Empty; if (breadCrumbApplicationPath == "category") { list = AspxBreadCrumbProvider.GetCategoryName(breadCrumbFileName, aspxCommonObj); breadCrumblist.Append(GetCategoryOnly(list, true)); } else if (breadCrumbApplicationPath == "item") { list = AspxBreadCrumbProvider.GetItemCategories(breadCrumbFileName, aspxCommonObj); breadCrumblist.Append(GetCategoryOnly(list, false)); } else if (breadCrumbApplicationPath == "tagsitems") { breadCrumblist.Append(listBuilder("Tags")); } else if (breadCrumbApplicationPath == "Search") { breadCrumblist.Append(listBuilder("Search")); } else if (breadCrumbApplicationPath == "option") { breadCrumblist.Append(listBuilder("Shopping Options")); } else if (breadCrumbApplicationPath == "brand" || breadCrumbApplicationPath == "service") { breadCrumblist.Append(listBuilder(breadCrumbFileName)); } else if (string.IsNullOrEmpty(breadCrumbApplicationPath)) { if (resolveUrl == "/") { current = urlSegments[1].Split('.')[0].Replace("/", "").Trim(); if (current != "portal") { current = AspxUtility.fixedDecodeURIComponent(current); if (current.ToLower() != "default" && current.ToLower() != "home") { breadCrumblist.Append(GetSageBreadCrumb(current)); } } else { current = urlSegments[urlSegments.Length - 1].Split('.')[0].Replace("/", "").Trim(); current = AspxUtility.fixedDecodeURIComponent(current); if (current.ToLower() != "default" && current.ToLower() != "home") { breadCrumblist.Append(GetSageBreadCrumb(current)); } } } else { current = urlSegments[urlSegments.Length - 1].Split('.')[0].Replace("/", "").Trim(); if (current != "portal") { current = AspxUtility.fixedDecodeURIComponent(current); if (current.ToLower() != "default" && current.ToLower() != "home") { breadCrumblist.Append(GetSageBreadCrumb(current)); } } else { current = urlSegments[3].Split('.')[0].Replace("/", "").Trim(); current = AspxUtility.fixedDecodeURIComponent(current); if (current.ToLower() != "default" && current.ToLower() != "home") { breadCrumblist.Append(GetSageBreadCrumb(current)); } } } } else if (resolveUrl == "/") { if (compareSegment.Replace("/", "").Trim() == "portal") { if (urlSegments.Length <= 4) { breadCrumblist.Append(switchCase("", urlSegments[3], "")); } else { breadCrumblist.Append(switchCase(urlSegments[3], urlSegments[4], urlSegments[3])); } } else { string urlValue = urlSegments[3].Split('.')[0].Replace("/", "").Trim(); if (!string.IsNullOrEmpty(urlValue) && urlValue != "default" && urlValue.ToLower() != "home") { breadCrumblist.Append(GetSageBreadCrumb(urlValue)); } } } else { if (compareSegment.Replace("/", "").Trim() == "portal") { if (urlSegments.Length <= 5) { breadCrumblist.Append(switchCase("", urlSegments[4], "")); } else { breadCrumblist.Append(switchCase(urlSegments[4], urlSegments[5], urlSegments[4])); } } else { string urlValue = urlSegments[4].Split('.')[0].Replace("/", "").Trim(); if (!string.IsNullOrEmpty(urlValue) && urlValue != "default" && urlValue.ToLower() != "home") { breadCrumblist.Append(GetSageBreadCrumb(urlValue)); } } } return(breadCrumblist.ToString()); }
public void BindFrontServiceView() { string serviceModulePath = ResolveUrl(this.AppRelativeTemplateSourceDirectory); string aspxTemplateFolderPath = ResolveUrl("~/") + "Templates/" + TemplateName; string aspxRootPath = ResolveUrl("~/"); hst = AppLocalized.getLocale(serviceModulePath); string pageExtension = SageFrameSettingKeys.PageExtension; ServiceItemController objService = new ServiceItemController(); List <ServiceItemSettingInfo> lstServiceSetting = objService.GetServiceItemSetting(aspxCommonObj); if (lstServiceSetting != null && lstServiceSetting.Count > 0) { foreach (var serviceSetting in lstServiceSetting) { isEnableService = serviceSetting.IsEnableService.ToString(); serviceCategoryInARow = serviceSetting.ServiceCategoryInARow.ToString(); serviceCategoryCount = serviceSetting.ServiceCategoryCount.ToString(); isEnableServiceRss = serviceSetting.IsEnableServiceRss.ToString(); serviceRssCount = serviceSetting.ServiceRssCount.ToString(); serviceDetailsPage = serviceSetting.ServiceDetailsPage; serviceRssPage = serviceSetting.ServiceRssPage; } } count = int.Parse(serviceCategoryCount); List <FrontServiceCategoryView> lstService = objService.GetFrontServices(aspxCommonObj, count); rowTotal = lstService.Count; if (rowTotal > count) { lstService.RemoveAt(lstService.Count - 1); } StringBuilder frontServiceView = new StringBuilder(); if (lstService != null && lstService.Count > 0) { frontServiceView.Append("<div id=\"divFrontService\"><ul>"); foreach (var serviceView in lstService) { string serviceDesc = ""; int index = 0; string serviceDetails = ""; if (serviceView.ServiceDetail != "" || serviceView.ServiceDetail != "null") { serviceDesc = serviceView.ServiceDetail; if (serviceDesc.IndexOf(' ') > 1) { if (serviceDesc.LastIndexOf(' ') > 60) { index = serviceDesc.Substring(0, 60).LastIndexOf(' '); serviceDetails = serviceDesc.Substring(0, index); serviceDetails = serviceDetails + "..."; } } else { serviceDetails = serviceDesc; } } else { serviceDetails = ""; } string imagePath = "Modules/AspxCommerce/AspxCategoryManagement/uploads/" + serviceView.ServiceImagePath; if (serviceView.ServiceImagePath == "") { imagePath = NoImageService; } else { //Resize Image Dynamically InterceptImageController.ImageBuilder(serviceView.ServiceImagePath, ImageType.Medium, ImageCategoryType.Category, aspxCommonObj); } var hrefServices = aspxRedirectPath + "service/" + AspxUtility.fixedEncodeURIComponent(serviceView.ServiceName) + pageExtension; frontServiceView.Append("<li><a href=\""); frontServiceView.Append(hrefServices); frontServiceView.Append("\"><img title=\""); frontServiceView.Append(serviceView.ServiceName); frontServiceView.Append("\" alt=\""); frontServiceView.Append(serviceView.ServiceName); frontServiceView.Append("\" src=\""); frontServiceView.Append(aspxRootPath); frontServiceView.Append(imagePath.Replace("uploads", "uploads/Medium")); frontServiceView.Append("\"/></a><a href=\""); frontServiceView.Append(hrefServices); frontServiceView.Append("\"><span class=\"cssClassImgWrapper\">"); frontServiceView.Append(serviceView.ServiceName); frontServiceView.Append("</span></a><p>"); frontServiceView.Append(serviceDetails); frontServiceView.Append("</p></li>"); } frontServiceView.Append("</ul></div>"); if (rowTotal > count) { frontServiceView.Append("<div id=\"divViewMoreServices\" class=\"cssViewMore\">"); frontServiceView.Append("<a href=\"" + aspxRootPath + serviceDetailsPage + pageExtension + "\">" + getLocale("View More") + "</a>"); frontServiceView.Append("</div>"); } } else { frontServiceView.Append("<div id=\"divFrontService\"><span class=\"cssClassNotFound\">" + getLocale("There are no services available!") + "</span></div>"); } ltrForntServiceView.Text = frontServiceView.ToString(); }
private void GetCategoryMenuList() { AspxCommonInfo aspxCommonObj = new AspxCommonInfo(); aspxCommonObj.StoreID = GetStoreID; aspxCommonObj.PortalID = GetPortalID; aspxCommonObj.UserName = GetUsername; aspxCommonObj.CultureName = GetCurrentCultureName; List <CategoryInfo> catInfo = AspxCategoryListController.GetCategoryMenuList(aspxCommonObj); if (catInfo.Count > 0) { int categoryID = 0; int parentID = 0; int? categoryLevel; string attributeValue = string.Empty;; StringBuilder catListmaker = new StringBuilder(); string catList = string.Empty; catListmaker.Append("<div class=\"cssClassCategoryNavHor\"><ul class='sf-menu'>"); foreach (CategoryInfo eachCat in catInfo) { string css = string.Empty; if (eachCat.ChildCount > 0) { css = "class=cssClassCategoryParent"; } else { css = ""; } categoryID = eachCat.CategoryID; parentID = eachCat.ParentID; categoryLevel = eachCat.CategoryLevel; attributeValue = eachCat.AttributeValue; if (eachCat.CategoryLevel == 0) { string hrefParentCategory = string.Empty; hrefParentCategory = aspxRedirectPath + "category/" + AspxUtility.fixedEncodeURIComponent(eachCat.AttributeValue) + SageFrameSettingKeys.PageExtension; catListmaker.Append("<li " + css + "><a href=" + hrefParentCategory + ">"); catListmaker.Append(eachCat.AttributeValue); catListmaker.Append("</a>"); if (eachCat.ChildCount > 0) { catListmaker.Append("<ul>"); itemPath += eachCat.AttributeValue; catListmaker.Append(BindChildCategory(catInfo, categoryID)); catListmaker.Append("</ul>"); } catListmaker.Append("</li>"); } itemPath = string.Empty; } catListmaker.Append("<div class=\"cssClassclear\"></div></ul></div>"); divCategoryListerH.InnerHtml = catListmaker.ToString(); } else { string strText = ("<span class=\"cssClassNotFound\">" + getLocale("This store has no category found!") + "</span>");//Need to add Local Text divCategoryListerH.InnerHtml = strText; } //if ($('.cssClassCategoryNav>ul>li').length > 4) { // $('.cssClassCategoryNav>ul>li:last').addClass('cssClassLastMenu'); //} }