/// <summary> /// Constructor for building a new simple object with the POCO class /// </summary> public OrganizationSimple(Organization organization) : this() { OrganizationID = organization.OrganizationID; OrganizationGuid = organization.OrganizationGuid; OrganizationName = organization.OrganizationName; OrganizationShortName = organization.OrganizationShortName; OrganizationTypeID = organization.OrganizationTypeID; PrimaryContactPersonID = organization.PrimaryContactPersonID; PrimaryContactPersonDisplayName = organization.PrimaryContactPerson != null ? organization.PrimaryContactPerson.FullNameFirstLastAndOrgShortName : "nobody"; IsActive = organization.IsActive; URL = organization.OrganizationUrl; DetailUrl = organization.GetDetailUrl(); LogoFileResourceID = organization.LogoFileResourceID; ValidRelationshipTypeSimples = organization.OrganizationType?.OrganizationTypeRelationshipTypes.Select(x => x.RelationshipType).ToList() .Select(x => new RelationshipTypeSimple(x)) .ToList() ?? new List <RelationshipTypeSimple>(); }
public static HtmlString GetShortNameAsUrl(this Organization organization) { return(organization != null?UrlTemplate.MakeHrefString(organization.GetDetailUrl(), organization.OrganizationShortName ?? organization.OrganizationName) : new HtmlString(null)); }
public static HtmlString GetDisplayNameWithoutAbbreviationAsUrl(this Organization organization) { return(organization != null ? UrlTemplate.MakeHrefString(organization.GetDetailUrl(), organization.DisplayNameWithoutAbbreviation) : new HtmlString(null)); }
public static HtmlString GetDisplayNameAsUrlBlankTarget(this Organization organization) { return(organization != null?UrlTemplate.MakeHrefStringBlankTarget(organization.GetDetailUrl(), organization.DisplayName) : new HtmlString(null)); }