public override XmlNode ToSiteMapNode(XmlDocument context) { XmlNode node = SiteMapNode(Name, SE.MakeEntityLink(EntityType, EntityID, SEName), context); if (SiteMap.Settings.ShowProducts) { foreach (SiteMapProduct prod in Products) { node.AppendChild(prod.ToSiteMapNode(context)); } foreach (NestedSiteMapEntity ent in Children) { node.AppendChild(ent.ToSiteMapNode(context)); } } return(node); }
public static String GetEntityBreadcrumb(int EntityID, String EntityInstanceName, String SourceEntity, Customer ThisCustomer) { String CacheName = String.Empty; if (AppLogic.CachingOn) { CacheName = String.Format("e_{0}_{1}_{2}_{3}", EntityID.ToString(), EntityInstanceName, SourceEntity, ThisCustomer.LocaleSetting); if (m_EntityHT.ContainsKey(CacheName)) { return(m_EntityHT[CacheName].ToString()); } } String separator = AppLogic.AppConfig("BreadcrumbSeparator"); if (separator.Length == 0) { separator = "→"; } EntityHelper hlp = AppLogic.LookupHelper(SourceEntity, 0); StringBuilder st = new StringBuilder(1024); int ParentID = hlp.GetParentEntity(EntityID); while (ParentID != 0) { st.Insert(0, String.Format("<a class=\"SectionTitleText\" href=\"{0}\">{1}</a> {2} ", SE.MakeEntityLink(SourceEntity, ParentID, ""), hlp.GetEntityName(ParentID, ThisCustomer.LocaleSetting), separator)); ParentID = hlp.GetParentEntity(ParentID); } st.Append(EntityInstanceName); st.Insert(0, "<span class=\"SectionTitleText\">"); st.Append("</span>"); String s = st.ToString(); if (AppLogic.CachingOn) { m_EntityHT.Add(CacheName, s); } return(s); }
public virtual XmlNode ToSiteMapNode(XmlDocument context) { return(SiteMapNode(Name, SE.MakeEntityLink(EntityType, EntityID, SEName), context)); }
public static String GetProductBreadcrumb(int ProductID, String ProductName, String SourceEntity, int SourceEntityID, Customer ThisCustomer) { String CacheName = String.Empty; if (AppLogic.CachingOn) { CacheName = String.Format("p_{0}_{1}_{2}_{3}", ProductID.ToString(), SourceEntity, SourceEntityID.ToString(), ThisCustomer.LocaleSetting); if (m_ProductHT.ContainsKey(CacheName)) { return(m_ProductHT[CacheName].ToString()); } } String separator = AppLogic.AppConfig("BreadcrumbSeparator"); if (separator.Length == 0) { separator = "→"; } StringBuilder st = new StringBuilder(2048); if (SourceEntityID != 0) { EntityHelper hlp = AppLogic.LookupHelper(SourceEntity, 0); int ThisID = SourceEntityID; while (ThisID != 0) { st.Insert(0, String.Format("<a class=\"SectionTitleText\" href=\"{0}\">{1}</a> {2} ", SE.MakeEntityLink(SourceEntity, ThisID, ""), hlp.GetEntityName(ThisID, ThisCustomer.LocaleSetting), separator)); ThisID = hlp.GetParentEntity(ThisID); } } st.Append(ProductName); st.Insert(0, "<span class=\"SectionTitleText\">"); st.Append("</span>"); String s = st.ToString(); if (AppLogic.CachingOn) { // possible race condition... check again... if (m_ProductHT.ContainsKey(CacheName) == false) { m_ProductHT.Add(CacheName, s); } } return(s); }