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; }