Exemplo n.º 1
0
        protected string GetFullURL(int sitemapID)
        {
            tbl_SiteMap sitemap = WebContentService.GetSitemapByID(sitemapID);

            if (sitemap == null)
            {
                return("");
            }

            string baseUrl = "";

            if (sitemap.SM_ParentID == 0 || this.Domain.DO_CustomRouteHandler)
            {
                return(sitemap.SM_URL);
            }

            var parent = WebContentService.GetSitemapByID(sitemap.SM_ParentID);

            while (parent.SM_ParentID > 0)
            {
                parent = WebContentService.GetSitemapByID(parent.SM_ParentID);
            }
            if (parent.SM_TypeID != null)
            {
                baseUrl = "/" + WebContentService.GetSitemapUrlByType((SiteMapType)parent.SM_TypeID, this.DomainID).Trim('/');
            }

            return(String.Format("{0}{1}", baseUrl, sitemap.SM_URL));
        }