Example #1
0
        public NestedSiteMapEntity[] GetEntities(string EntityType)
        {
            var _list = new Dictionary <int, NestedSiteMapEntity>();

            var getCommand = GetEntitySQL(EntityType);
            Action <System.Data.IDataReader> readEntities = rd =>
            {
                while (rd.Read())
                {
                    var entity = new NestedSiteMapEntity(Url, SiteMapEntityHelper, Settings)
                    {
                        EntityID       = rd.FieldInt("ID"),
                        Name           = XmlCommon.GetLocaleEntry(rd.Field("Name"), Customer.Current.LocaleSetting, false),
                        SEName         = rd.Field("SEName"),
                        ParentEntityID = rd.FieldInt("ParentID"),
                        EntityType     = EntityType,
                    };

                    entity.GetProducts();
                    _list.Add(entity.EntityID, entity);
                }
            };

            DB.UseDataReader(getCommand, readEntities);

            return(OrganizeEntities(_list).ToArray());
        }
Example #2
0
 public NestedSiteMapEntity(UrlHelper url, SiteMapEntityHelper siteMapEntityHelper, SiteMapSettings settings)
     : base(url, siteMapEntityHelper)
 {
     Settings = settings;
     Children = new NestedSiteMapEntity[0];
     Products = new SiteMapProduct[0];
 }
Example #3
0
        public string GetEntityProductURLNodes(string entityType, int EntityID)
        {
            var entity = new NestedSiteMapEntity(UrlHelper, SiteMapEntityHelper, Settings);

            entity.EntityType = entityType;
            entity.EntityID   = EntityID;
            entity.GetProducts();

            var sb = new StringBuilder();

            foreach (var siteMapProduct in entity.Products)
            {
                sb.Append(ProductXML(siteMapProduct));
            }

            return(sb.ToString());
        }
 public NestedSiteMapEntity(UrlHelper url, SiteMapEntityHelper siteMapEntityHelper)
     : base(url, siteMapEntityHelper)
 {
     Children = new NestedSiteMapEntity[0];
     Products = new SiteMapProduct[0];
 }