private TaxonomyBranchOrganizationTypeExpenditure(OrganizationType organizationType, HtmlString taxonomyBranchName, HtmlString taxonomyTrunkName, decimal expenditureAmount)
 {
     OrganizationType   = organizationType;
     TaxonomyBranchName = taxonomyBranchName;
     TaxonomyTrunkName  = taxonomyTrunkName;
     ExpenditureAmount  = expenditureAmount;
 }
 /// <summary>
 /// Constructor for building a new simple object with the POCO class
 /// </summary>
 public OrganizationTypeSimple(OrganizationType organizationType)
     : this()
 {
     OrganizationTypeID           = organizationType.OrganizationTypeID;
     OrganizationTypeName         = organizationType.OrganizationTypeName;
     OrganizationTypeAbbreviation = organizationType.OrganizationTypeAbbreviation;
     LegendColor = organizationType.LegendColor;
 }
 public OrganizationTypeExpenditure(OrganizationType organizationType, List <ProjectGrantAllocationExpenditure> projectGrantAllocationExpendituresForThisOrganizationTypeAndCalendarYear, int?calendarYear)
 {
     _organizationType                = new OrganizationTypeSimple(organizationType);
     CalendarYear                     = calendarYear;
     CalendarYearExpenditureAmount    = projectGrantAllocationExpendituresForThisOrganizationTypeAndCalendarYear.Sum(x => x.ExpenditureAmount);
     GrantAllocationCount             = projectGrantAllocationExpendituresForThisOrganizationTypeAndCalendarYear.Select(x => x.GrantAllocationID).Distinct().Count();
     GrantAllocationOrganizationCount = projectGrantAllocationExpendituresForThisOrganizationTypeAndCalendarYear.Select(x => x.GrantAllocation.BottommostOrganization.OrganizationID).Distinct().Count();
 }
 public OrganizationTypeExpenditure(OrganizationType organizationType, decimal calendarYearExpenditureAmount, int grantAllocationCount, int grantAllocationOrganizationCount, int?calendarYear)
 {
     _organizationType                = new OrganizationTypeSimple(organizationType);
     CalendarYear                     = calendarYear;
     CalendarYearExpenditureAmount    = calendarYearExpenditureAmount;
     GrantAllocationCount             = grantAllocationCount;
     GrantAllocationOrganizationCount = grantAllocationOrganizationCount;
 }
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public OrganizationTypeRelationshipType(OrganizationType organizationType, RelationshipType relationshipType) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.OrganizationTypeRelationshipTypeID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.OrganizationTypeID = organizationType.OrganizationTypeID;
     this.OrganizationType   = organizationType;
     organizationType.OrganizationTypeRelationshipTypes.Add(this);
     this.RelationshipTypeID = relationshipType.RelationshipTypeID;
     this.RelationshipType   = relationshipType;
     relationshipType.OrganizationTypeRelationshipTypes.Add(this);
 }
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static OrganizationTypeRelationshipType CreateNewBlank(OrganizationType organizationType, RelationshipType relationshipType)
 {
     return(new OrganizationTypeRelationshipType(organizationType, relationshipType));
 }
示例#7
0
 public bool IsAssociatedWithOrganiztionType(OrganizationType organizationType)
 {
     return(OrganizationTypeRelationshipTypes.Select(x => x.OrganizationType).Contains(organizationType));
 }
 /// <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(string), default(bool), organizationType, default(bool)));
 }
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public Organization(string organizationName, string organizationShortName, bool isActive, OrganizationType organizationType, bool isEditable) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.OrganizationID        = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.OrganizationName      = organizationName;
     this.OrganizationShortName = organizationShortName;
     this.IsActive           = isActive;
     this.OrganizationTypeID = organizationType.OrganizationTypeID;
     this.OrganizationType   = organizationType;
     organizationType.Organizations.Add(this);
     this.IsEditable = isEditable;
 }
 public TaxonomyBranchOrganizationTypeExpenditure(OrganizationType organizationType, string taxonomyBranchName, string taxonomyTrunkName, decimal expenditureAmount)
     : this(organizationType, new HtmlString(taxonomyBranchName), new HtmlString(taxonomyTrunkName), expenditureAmount)
 {
 }
 public TaxonomyBranchOrganizationTypeExpenditure(OrganizationType organizationType, TaxonomyBranch taxonomyBranch, decimal expenditureAmount) : this(organizationType, taxonomyBranch.GetDisplayNameAsUrl(), taxonomyBranch.TaxonomyTrunk.GetDisplayNameAsUrl(), expenditureAmount)
 {
 }
 public static void DeleteOrganizationType(this IQueryable <OrganizationType> organizationTypes, OrganizationType organizationTypeToDelete)
 {
     DeleteOrganizationType(organizationTypes, new List <OrganizationType> {
         organizationTypeToDelete
     });
 }