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"; }
public PerformanceMeasuresViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.Project project, ViewDataForAngularEditor viewDataForAngularEditor, ProposalSectionsStatus proposalSectionsStatus) : base(currentFirmaSession, project, ProjectCreateSection.ReportedAccomplishments.ProjectCreateSectionDisplayName, proposalSectionsStatus) { RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshReportedPerformanceMeasures(project)); DiffUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.DiffReportedPerformanceMeasures(project)); var performanceMeasureActuals = project.GetPerformanceMeasureReportedValues(); var performanceMeasureSubcategoriesCalendarYearReportedValues = PerformanceMeasureSubcategoriesCalendarYearReportedValue.CreateFromPerformanceMeasuresAndCalendarYears(new List <IPerformanceMeasureReportedValue>(performanceMeasureActuals)); PerformanceMeasureReportedValuesSummaryViewData = new PerformanceMeasureReportedValuesSummaryViewData(performanceMeasureSubcategoriesCalendarYearReportedValues, project.GetPerformanceMeasuresExemptReportingYears().Select(x => x.CalendarYear).ToList(), project.PerformanceMeasureActualYearsExemptionExplanation, performanceMeasureActuals.Select(x => x.CalendarYear).Distinct().Select(x => new CalendarYearString(x)).ToList()); ViewDataForAngular = viewDataForAngularEditor; IsImplementationStartYearValid = project.ImplementationStartYear.HasValue && project.ImplementationStartYear < project.CompletionYear; ReportingYearLabel = "Year"; if (new PerformanceMeasureManageFeature().HasPermissionByFirmaSession(currentFirmaSession)) { ConfigurePerformanceMeasuresUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(pmc => pmc.Manage()); } ShowCommentsSection = project.IsPendingApproval() || (project.ReportedAccomplishmentsComment != null && project.ProjectApprovalStatus == ProjectApprovalStatus.Returned); CanEditComments = project.IsPendingApproval() && new ProjectEditAsAdminRegardlessOfStageFeature().HasPermission(currentFirmaSession, project).HasPermission; }
public ExpectedPerformanceMeasuresViewData(FirmaSession currentFirmaSession, ProjectUpdateBatch projectUpdateBatch, ProjectUpdateStatus projectUpdateStatus, ViewDataForAngularEditor viewDataForAngular, PerformanceMeasureExpectedValuesSummaryViewData performanceMeasureExpectedValuesSummaryViewData) : base(currentFirmaSession, projectUpdateBatch, projectUpdateStatus, new List <string>(), ProjectUpdateSection.ExpectedAccomplishments.ProjectUpdateSectionDisplayName) { RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshExpectedPerformanceMeasures(projectUpdateBatch.Project)); DiffUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.DiffExpectedPerformanceMeasures(projectUpdateBatch.Project)); ViewDataForAngular = viewDataForAngular; PerformanceMeasureExpectedValuesSummaryViewData = performanceMeasureExpectedValuesSummaryViewData; SectionCommentsViewData = new SectionCommentsViewData(projectUpdateBatch.ExpectedPerformanceMeasuresComment, projectUpdateBatch.IsReturned()); }
public PerformanceMeasuresViewData(Person currentPerson, Models.Project project, ViewDataForAngularEditor viewDataForAngularEditor, ProposalSectionsStatus proposalSectionsStatus) : base(currentPerson, project, ProjectCreateSection.ReportedPerformanceMeasures.ProjectCreateSectionDisplayName, proposalSectionsStatus) { RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshPerformanceMeasures(project)); DiffUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.DiffPerformanceMeasures(project)); var performanceMeasureActuals = project.GetReportedPerformanceMeasures(); var performanceMeasureSubcategoriesCalendarYearReportedValues = PerformanceMeasureSubcategoriesCalendarYearReportedValue.CreateFromPerformanceMeasuresAndCalendarYears(new List <IPerformanceMeasureReportedValue>(performanceMeasureActuals)); PerformanceMeasureReportedValuesSummaryViewData = new PerformanceMeasureReportedValuesSummaryViewData(performanceMeasureSubcategoriesCalendarYearReportedValues, project.GetPerformanceMeasuresExemptReportingYears().Select(x => x.CalendarYear).ToList(), project.PerformanceMeasureActualYearsExemptionExplanation, performanceMeasureActuals.Select(x => x.CalendarYear).Distinct().Select(x => new CalendarYearString(x)).ToList()); ViewDataForAngular = viewDataForAngularEditor; IsImplementationStartYearValid = project.GetImplementationStartYear().HasValue&& project.GetImplementationStartYear() < project.GetCompletionYear(); ReportingYearLabel = "Year"; }