예제 #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());
        }
예제 #2
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());
        }