/// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public OrganizationTypeOrganizationRelationshipType(OrganizationType organizationType, OrganizationRelationshipType organizationRelationshipType) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.OrganizationTypeOrganizationRelationshipTypeID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.OrganizationTypeID = organizationType.OrganizationTypeID;
     this.OrganizationType   = organizationType;
     organizationType.OrganizationTypeOrganizationRelationshipTypes.Add(this);
     this.OrganizationRelationshipTypeID = organizationRelationshipType.OrganizationRelationshipTypeID;
     this.OrganizationRelationshipType   = organizationRelationshipType;
     organizationRelationshipType.OrganizationTypeOrganizationRelationshipTypes.Add(this);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public Organization(string organizationName, bool isActive, OrganizationType organizationType, bool useOrganizationBoundaryForMatchmaker, bool isUnknownOrUnspecified) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.OrganizationID     = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.OrganizationName   = organizationName;
     this.IsActive           = isActive;
     this.OrganizationTypeID = organizationType.OrganizationTypeID;
     this.OrganizationType   = organizationType;
     organizationType.Organizations.Add(this);
     this.UseOrganizationBoundaryForMatchmaker = useOrganizationBoundaryForMatchmaker;
     this.IsUnknownOrUnspecified = isUnknownOrUnspecified;
 }
 public bool IsAssociatedWithOrganizationType(OrganizationType organizationType)
 {
     return(OrganizationTypeOrganizationRelationshipTypes.Select(x => x.OrganizationType).Contains(organizationType));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static Organization CreateNewBlank(OrganizationType organizationType)
 {
     return(new Organization(default(string), default(bool), organizationType, default(bool), default(bool)));
 }
        public static HtmlString GetOrganizationTypeHtmlStringWithColor(this OrganizationType organizationType)
        {
            var organizationTypeColor = organizationType.LegendColor;

            return(new HtmlString($"<span style=\"vertical-align:middle; width:10px; height:10px; margin-right:5px; display:inline-block; background:{organizationTypeColor};\"></span>{organizationType.OrganizationTypeName}"));
        }
 public static string GetDeleteUrl(OrganizationType organizationType)
 {
     return(SitkaRoute <OrganizationTypeAndOrganizationRelationshipTypeController> .BuildUrlFromExpression(c =>
                                                                                                           c.DeleteOrganizationType(organizationType.OrganizationTypeID)));
 }
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static OrganizationTypeOrganizationRelationshipType CreateNewBlank(OrganizationType organizationType, OrganizationRelationshipType organizationRelationshipType)
 {
     return(new OrganizationTypeOrganizationRelationshipType(organizationType, organizationRelationshipType));
 }