Example #1
0
        public static FancyTreeNode ToFancyTreeNode(this TaxonomyBranch taxonomyBranch, FirmaSession currentFirmaSession)
        {
            var fancyTreeNode = new FancyTreeNode($"{UrlTemplate.MakeHrefString(taxonomyBranch.GetDetailUrl(), taxonomyBranch.GetDisplayName())}", taxonomyBranch.TaxonomyBranchID.ToString(), false)
            {
                ThemeColor = string.IsNullOrWhiteSpace(taxonomyBranch.ThemeColor) ? taxonomyBranch.TaxonomyTrunk.ThemeColor : taxonomyBranch.ThemeColor,
                MapUrl     = taxonomyBranch.GetCustomizedMapUrl(),
                Children   = taxonomyBranch.TaxonomyLeafs.SortByOrderThenName().Select(x => x.ToFancyTreeNode(currentFirmaSession)).ToList()
            };

            return(fancyTreeNode);
        }
Example #2
0
 public TaxonomyTier(TaxonomyBranch taxonomyBranch)
 {
     TaxonomyTierID   = taxonomyBranch.TaxonomyBranchID;
     ThemeColor       = taxonomyBranch.ThemeColor;
     DisplayName      = taxonomyBranch.GetDisplayName();
     DisplayNameAsUrl = taxonomyBranch.GetDisplayNameAsUrl();
     DetailUrl        = taxonomyBranch.GetDetailUrl();
     TaxonomyTierPerformanceMeasures = taxonomyBranch.GetTaxonomyTierPerformanceMeasures();
     SortOrder      = taxonomyBranch.TaxonomyBranchSortOrder;
     TaxonomyLevel  = TaxonomyLevelEnum.Branch;
     TaxonomyLeaf   = null;
     TaxonomyBranch = taxonomyBranch;
     TaxonomyTrunk  = null;
 }
        public string GetDisplayNameAsDetailUrl()
        {
            switch (TaxonomyLevel)
            {
            case TaxonomyLevelEnum.Trunk:
                return($"{UrlTemplate.MakeHrefString(TaxonomyTrunk.GetDetailUrl(), GetDisplayName())}");

            case TaxonomyLevelEnum.Branch:
                return($"{UrlTemplate.MakeHrefString(TaxonomyBranch.GetDetailUrl(), GetDisplayName())}");

            case TaxonomyLevelEnum.Leaf:
                return($"{UrlTemplate.MakeHrefString(TaxonomyLeaf.GetDetailUrl(), GetDisplayName())}");

            default:
                return(string.Empty);
            }
        }
Example #4
0
 public static HtmlString GetDisplayNameAsUrl(this TaxonomyBranch taxonomyBranch)
 {
     return(UrlTemplate.MakeHrefString(taxonomyBranch.GetDetailUrl(), taxonomyBranch.GetDisplayName()));
 }