Пример #1
0
        public ProjectBudgetsAnnualByCostTypeViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.Project project, List <ProjectFundingSourceCostTypeAmount> projectFundingSourceCostTypeAmounts, List <ProjectNoFundingSourceCostTypeAmount> projectNoFundingSourceCostTypeAmounts, string expectedFundingUpdateNote) : base(currentFirmaSession)
        {
            Project = project;
            FieldDefinitionForProject                      = FieldDefinitionEnum.Project.ToType();
            FieldDefinitionForFundingSource                = FieldDefinitionEnum.FundingSource.ToType();
            FieldDefinitionForCostType                     = FieldDefinitionEnum.CostType.ToType();
            FieldDefinitionForEstimatedTotalCost           = FieldDefinitionEnum.EstimatedTotalCost.ToType();
            FieldDefinitionForEstimatedAnnualOperatingCost = FieldDefinitionEnum.EstimatedAnnualOperatingCost.ToType();
            FieldDefinitionForProjectedFunding             = FieldDefinitionEnum.ProjectedFunding.ToType();
            FieldDefinitionForObligatedFunding             = FieldDefinitionEnum.ObligatedFunding.ToType();
            FieldDefinitionForExpendedFunding              = FieldDefinitionEnum.ExpendedFunding.ToType();

            ProjectFundingSourceCostTypeAmounts = projectFundingSourceCostTypeAmounts;
            var calendarYears     = project.CalculateCalendarYearRangeForBudgetsWithoutAccountingForExistingYears();
            var usedCalendarYears = projectFundingSourceCostTypeAmounts.Where(x => x.CalendarYear.HasValue && !calendarYears.Contains(x.CalendarYear.Value)).Select(x => x.CalendarYear.Value).Distinct().ToList();

            calendarYears.AddRange(usedCalendarYears);
            calendarYears.Sort();
            CalendarYears = calendarYears;

            ProjectNoFundingSourceCostTypeAmounts = projectNoFundingSourceCostTypeAmounts;

            ExpectedFundingUpdateNote    = expectedFundingUpdateNote;
            ObligationItemBudgetRollUps  = project.GetObligationItemBudgetRollUpByYearAndCostTypeAndFundingSourceSimples();
            ObligationItemInvoiceRollUps = project.GetObligationItemInvoiceRollUpByYearAndCostTypeAndFundingSourceSimples();
        }
Пример #2
0
 public EditProjectFundingSourceBudgetByCostTypeViewDataForAngular(ProjectFirmaModels.Models.Project project,
                                                                   List <FundingSourceSimple> allFundingSources,
                                                                   List <CostTypeSimple> allCostTypes,
                                                                   List <int> requiredCalendarYearRange,
                                                                   IEnumerable <SelectListItem> fundingTypes)
 {
     RequiredCalendarYearRange = requiredCalendarYearRange;
     AllFundingSources         = allFundingSources;
     AllCostTypes   = allCostTypes;
     ProjectID      = project.ProjectID;
     FundingTypes   = fundingTypes;
     MaxYear        = FirmaDateUtilities.CalculateCurrentYearToUseForUpToAllowableInputInReporting();
     UseFiscalYears = MultiTenantHelpers.UseFiscalYears();
     ObligationItemBudgetRollUps  = project.GetObligationItemBudgetRollUpByYearAndCostTypeAndFundingSourceSimples();
     ObligationItemInvoiceRollUps = project.GetObligationItemInvoiceRollUpByYearAndCostTypeAndFundingSourceSimples();
 }