public PerformanceMeasureReportedValueFromProjectFirma(PerformanceMeasureReportedValue performanceMeasureReportedValue) { PerformanceMeasureID = performanceMeasureReportedValue.PerformanceMeasureID; PerformanceMeasureName = performanceMeasureReportedValue.PerformanceMeasure.PerformanceMeasureDisplayName; CalendarYear = performanceMeasureReportedValue.CalendarYear; ReportedValue = performanceMeasureReportedValue.GetReportedValue(); MeasurementUnitType = performanceMeasureReportedValue.PerformanceMeasure.MeasurementUnitType.MeasurementUnitTypeDisplayName; ProjectStage = performanceMeasureReportedValue.Project.ProjectStage.ProjectStageDisplayName; LeadImplementer = performanceMeasureReportedValue.Project.GetPrimaryContactOrganization()?.OrganizationShortName; ProjectName = performanceMeasureReportedValue.Project.GetDisplayName(); ProjectDetailUrl = $"/Project/Detail/{performanceMeasureReportedValue.Project.ProjectID}"; PerformanceMeasureSubcategoryOptions = performanceMeasureReportedValue .PerformanceMeasureActualSubcategoryOptions.Select(x => new PerformanceMeasureSubcategoryOptionFromProjectFirma(x)) .ToList(); PerformanceMeasureSubcategoriesAsString = performanceMeasureReportedValue.GetPerformanceMeasureSubcategoriesAsString(); }
public ReportedPerformanceMeasuresViewData(FirmaSession currentFirmaSession, ProjectUpdateBatch projectUpdateBatch, ViewDataForAngularEditor viewDataForAngularEditor, ProjectUpdateStatus projectUpdateStatus, List <PerformanceMeasuresValidationResult> performanceMeasuresValidationResults) : base(currentFirmaSession, projectUpdateBatch, projectUpdateStatus, PerformanceMeasuresValidationResult.GetAllWarningMessages(performanceMeasuresValidationResults), ProjectUpdateSection.ReportedAccomplishments.ProjectUpdateSectionDisplayName) { RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshReportedPerformanceMeasures(projectUpdateBatch.Project)); DiffUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.DiffReportedPerformanceMeasures(projectUpdateBatch.Project)); var performanceMeasureActualUpdates = projectUpdateBatch.PerformanceMeasureActualUpdates; var performanceMeasureSubcategoriesCalendarYearReportedValues = PerformanceMeasureSubcategoriesCalendarYearReportedValue.CreateFromPerformanceMeasuresAndCalendarYears(new List <IPerformanceMeasureReportedValue>(PerformanceMeasureReportedValue.MakeFromList(performanceMeasureActualUpdates))); PerformanceMeasureReportedValuesSummaryViewData = new PerformanceMeasureReportedValuesSummaryViewData(performanceMeasureSubcategoriesCalendarYearReportedValues, projectUpdateBatch.GetPerformanceMeasuresExemptReportingYears().Select(x => x.CalendarYear).ToList(), projectUpdateBatch.PerformanceMeasureActualYearsExemptionExplanation, performanceMeasureActualUpdates.Select(x => x.PerformanceMeasureReportingPeriod.PerformanceMeasureReportingPeriodCalendarYear).Distinct().Select(x => new CalendarYearString(x)).ToList()); ViewDataForAngular = viewDataForAngularEditor; SectionCommentsViewData = new SectionCommentsViewData(projectUpdateBatch.ReportedPerformanceMeasuresComment, projectUpdateBatch.IsReturned()); IsImplementationStartYearValid = projectUpdateBatch.ProjectUpdate.ImplementationStartYear.HasValue && projectUpdateBatch.ProjectUpdate.ImplementationStartYear < projectUpdateBatch.ProjectUpdate.CompletionYear; ReportingYearLabel = "Year"; }