public InstructionsViewData(FirmaSession currentFirmaSession, ProjectUpdateBatch projectUpdateBatch, ProjectUpdateStatus projectUpdateStatus, ProjectFirmaModels.Models.FirmaPage firmaPage) : base(currentFirmaSession, projectUpdateBatch, projectUpdateStatus, new List <string>(), "Instructions") { PerformanceMeasuresUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(x => x.Index()); InstructionsViewPageContentViewData = new ViewPageContentViewData(firmaPage, new FirmaPageManageFeature().HasPermission(currentFirmaSession, firmaPage).HasPermission); }
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 ExpectedFundingByCostTypeViewData(FirmaSession currentFiramSession, ProjectUpdateBatch projectUpdateBatch, ViewDataForAngularClass viewDataForAngularClass, ProjectBudgetSummaryViewData projectBudgetSummaryViewData, ProjectBudgetsAnnualByCostTypeViewData projectBudgetsAnnualByCostTypeViewData, ProjectUpdateStatus projectUpdateStatus, ExpectedFundingValidationResult expectedFundingValidationResult ) : base(currentFiramSession, projectUpdateBatch, projectUpdateStatus, expectedFundingValidationResult.GetWarningMessages(), ProjectUpdateSection.Budget.ProjectUpdateSectionDisplayName) { RequestFundingSourceUrl = SitkaRoute <HelpController> .BuildUrlFromExpression(x => x.MissingFundingSource()); RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshExpectedFundingByCostType(projectUpdateBatch.Project)); DiffUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.DiffExpectedFundingByCostType(projectUpdateBatch.Project)); ViewDataForAngular = viewDataForAngularClass; ProjectBudgetSummaryViewData = projectBudgetSummaryViewData; ProjectBudgetsAnnualByCostTypeViewData = projectBudgetsAnnualByCostTypeViewData; SectionCommentsViewData = new SectionCommentsViewData(projectUpdateBatch.ExpectedFundingComment, projectUpdateBatch.IsReturned()); FieldDefinitionForProject = FieldDefinitionEnum.Project.ToType(); FieldDefinitionForFundingSource = FieldDefinitionEnum.FundingSource.ToType(); FieldDefinitionForCostType = FieldDefinitionEnum.CostType.ToType(); FieldDefinitionForNoFundingSourceIdentified = FieldDefinitionEnum.NoFundingSourceIdentified.ToType(); FieldDefinitionForSecuredFunding = FieldDefinitionEnum.SecuredFunding.ToType(); FieldDefinitionForTargetedFunding = FieldDefinitionEnum.TargetedFunding.ToType(); FieldDefinitionForPlanningDesignStartYear = FieldDefinitionEnum.PlanningDesignStartYear.ToType(); FieldDefinitionForCompletionYear = FieldDefinitionEnum.CompletionYear.ToType(); }
private static List <ProjectSectionSimple> GetProjectUpdateSectionsImpl(ProjectUpdateBatch projectUpdateBatch, List <ProjectUpdateSection> projectUpdateSections, ProjectUpdateStatus projectUpdateStatus, bool ignoreStatus) { var sections = projectUpdateSections.Select(x => new ProjectSectionSimple(x, x.GetSectionUrl(projectUpdateBatch.Project), !ignoreStatus && x.IsComplete(projectUpdateBatch), projectUpdateStatus != null && x.SectionIsUpdated(projectUpdateStatus))).OrderBy(x => x.SortOrder).ToList(); return(sections); }
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 GeospatialAreaViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.ProjectUpdate projectUpdate, EditProjectGeospatialAreasViewData editProjectGeospatialAreasViewData, ProjectLocationSummaryViewData projectLocationSummaryViewData, GeospatialAreaValidationResult geospatialAreaValidationResult, ProjectUpdateStatus projectUpdateStatus, GeospatialAreaType geospatialAreaType) : base(currentFirmaSession, projectUpdate.ProjectUpdateBatch, projectUpdateStatus, geospatialAreaValidationResult.GetWarningMessages(), geospatialAreaType.GeospatialAreaTypeNamePluralized) { EditProjectGeospatialAreasViewData = editProjectGeospatialAreasViewData; ProjectLocationSummaryViewData = projectLocationSummaryViewData; RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshProjectGeospatialArea(projectUpdate.ProjectUpdateBatch.Project, geospatialAreaType)); SectionCommentsViewData = new SectionCommentsViewData(projectUpdate.ProjectUpdateBatch.LocationSimpleComment, projectUpdate.ProjectUpdateBatch.IsReturned()); GeospatialAreaType = geospatialAreaType; }
public ProjectUpdateViewData(FirmaSession currentFirmaSession, ProjectUpdateBatch projectUpdateBatch, ProjectUpdateStatus projectUpdateStatus, List <string> validationWarnings, string currentSectionDisplayName) : base(currentFirmaSession, null) { IsInstructionsPage = currentSectionDisplayName.Equals("Instructions", StringComparison.InvariantCultureIgnoreCase); InstructionsPageUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.Instructions(projectUpdateBatch.Project)); ProjectWorkflowSectionGroupings = ProjectWorkflowSectionGrouping.All.OrderBy(x => x.SortOrder).ToList(); if (!MultiTenantHelpers.TrackAccomplishments()) { ProjectWorkflowSectionGroupings = ProjectWorkflowSectionGroupings.Where(x => x != ProjectWorkflowSectionGrouping.Accomplishments).ToList(); } ProjectUpdateBatch = projectUpdateBatch; Project = projectUpdateBatch.Project; PrimaryContactPerson = projectUpdateBatch.Project.GetPrimaryContact(); EntityName = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} Update"; PageTitle = $"Update: {Project.GetDisplayName()}"; ProjectUpdateMyProjectsUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.MyProjectsRequiringAnUpdate()); ProjectUpdateHistoryUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.History(Project)); DeleteProjectUpdateUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.DeleteProjectUpdate(Project)); SubmitUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.Submit(Project)); ApproveUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.Approve(Project)); ReturnUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.Return(Project)); ProvideFeedbackUrl = SitkaRoute <HelpController> .BuildUrlFromExpression(x => x.UpdateFeedback()); TrainingUrl = SitkaRoute <HomeController> .BuildUrlFromExpression(x => x.Training()); var isApprover = new ProjectUpdateAdminFeatureWithProjectContext().HasPermission(currentFirmaSession, Project).HasPermission; ShowApproveAndReturnButton = projectUpdateBatch.IsSubmitted() && isApprover; IsEditable = projectUpdateBatch.InEditableState() || ShowApproveAndReturnButton; IsReadyToApprove = projectUpdateBatch.IsReadyToApprove(); AreProjectBasicsValid = projectUpdateBatch.AreProjectBasicsValid(); HasCustomAttributesEditableByUser = projectUpdateBatch.Project.HasEditableCustomAttributes(CurrentFirmaSession); //Neuter UpdateStatus for non-approver users until we go live with "Show Changes" for all users. ProjectUpdateStatus = currentFirmaSession.Person.IsApprover() ? projectUpdateStatus : new ProjectUpdateStatus(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false); HasUpdateStarted = ModelObjectHelpers.IsRealPrimaryKeyValue(projectUpdateBatch.ProjectUpdateBatchID); ValidationWarnings = validationWarnings; CurrentSectionDisplayName = currentSectionDisplayName; }
public ProjectCustomAttributesViewData(FirmaSession currentFirmaSession, ProjectUpdateBatch projectUpdateBatch, ProjectUpdateStatus projectUpdateStatus, List <string> validationWarnings, string sectionDisplayName, EditProjectCustomAttributesViewData editCustomAttributesViewData, DisplayProjectCustomAttributesViewData displayProjectCustomAttributesViewData) : base(currentFirmaSession, projectUpdateBatch, projectUpdateStatus, validationWarnings, sectionDisplayName) { EditCustomAttributesViewData = editCustomAttributesViewData; SectionCommentsViewData = new SectionCommentsViewData(projectUpdateBatch.CustomAttributesComment, projectUpdateBatch.IsReturned()); RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshProjectCustomAttributes(projectUpdateBatch.Project)); DiffUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.DiffProjectCustomAttributes(projectUpdateBatch.Project)); DisplayProjectCustomAttributesViewData = displayProjectCustomAttributesViewData; }
public EditProposalClassificationsViewData(FirmaSession currentFirmaSession , ProjectFirmaModels.Models.ProjectUpdateBatch projectUpdateBatch , List <ProjectFirmaModels.Models.ClassificationSystem> classificationSystems , ClassificationsValidationResult classificationsValidationResult , ProjectUpdateStatus projectUpdateStatus , string diffUrl , string refreshUrl) : base(currentFirmaSession, projectUpdateBatch, projectUpdateStatus, classificationsValidationResult.GetWarningMessages(), ProjectUpdateSection.Classifications.ProjectUpdateSectionDisplayName) { ProjectName = projectUpdateBatch.Project.GetDisplayName(); ClassificationSystems = classificationSystems; FieldDefinitionForProject = FieldDefinitionEnum.Project.ToType(); FieldDefinitionForClassification = FieldDefinitionEnum.Classification.ToType(); if (new SitkaAdminFeature().HasPermissionByFirmaSession(currentFirmaSession)) { ConfigureClassificationSystemsUrl = SitkaRoute <TenantController> .BuildUrlFromExpression(tc => tc.Detail()); } DiffUrl = diffUrl; RefreshUrl = refreshUrl; }
public BasicsViewData(FirmaSession currentFirmaSession , ProjectFirmaModels.Models.ProjectUpdate projectUpdate, IEnumerable <ProjectStage> projectStages , ProjectUpdateStatus projectUpdateStatus, BasicsValidationResult basicsValidationResult) : base(currentFirmaSession, projectUpdate.ProjectUpdateBatch, projectUpdateStatus, basicsValidationResult.GetWarningMessages(), ProjectUpdateSection.Basics.ProjectUpdateSectionDisplayName) { ProjectUpdate = projectUpdate; TaxonomyLeafDisplayName = projectUpdate.ProjectUpdateBatch.Project.TaxonomyLeaf.GetDisplayName(); ProjectStages = projectStages.OrderBy(x => x.SortOrder).ToSelectListWithEmptyFirstRow(x => x.ProjectStageID.ToString(CultureInfo.InvariantCulture), y => y.ProjectStageDisplayName); ProjectStagesModels = projectStages; PlanningDesignStartYearRange = FirmaDateUtilities.YearsForUserInput().ToSelectListWithEmptyFirstRow(x => x.CalendarYear.ToString(CultureInfo.InvariantCulture), x => x.CalendarYearDisplay).ToList(); ImplementationStartYearRange = FirmaDateUtilities.YearsForUserInput().ToSelectListWithEmptyFirstRow(x => x.CalendarYear.ToString(CultureInfo.InvariantCulture), x => x.CalendarYearDisplay).ToList(); CompletionYearRange = FirmaDateUtilities.YearsForUserInput().ToSelectListWithEmptyFirstRow(x => x.CalendarYear.ToString(CultureInfo.InvariantCulture), x => x.CalendarYearDisplay).ToList(); RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshBasics(Project)); DiffUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.DiffBasics(Project)); SectionCommentsViewData = new SectionCommentsViewData(projectUpdate.ProjectUpdateBatch.BasicsComment, projectUpdate.ProjectUpdateBatch.IsReturned()); StartYearForTotalCostCalculation = projectUpdate.StartYearForTotalCostCalculations(); TenantUsesFiscalYears = MultiTenantHelpers.UseFiscalYears(); }
public override bool SectionIsUpdated(ProjectUpdateStatus projectUpdateStatus) { return(projectUpdateStatus.IsOrganizationsUpdated); }
public override bool SectionIsUpdated(ProjectUpdateStatus projectUpdateStatus) { return(projectUpdateStatus.IsExternalLinksUpdated); }
public override bool SectionIsUpdated(ProjectUpdateStatus projectUpdateStatus) { return(projectUpdateStatus.IsReportedPerformanceMeasuresUpdated); }
public override bool SectionIsUpdated(ProjectUpdateStatus projectUpdateStatus) { return(projectUpdateStatus.IsLocationDetailUpdated); }
public abstract bool SectionIsUpdated(ProjectUpdateStatus projectUpdateStatus);
public override bool SectionIsUpdated(ProjectUpdateStatus projectUpdateStatus) { return(projectUpdateStatus.IsClassificationsUpdated); }
public EditProjectFundingSourceBudgetByCostTypeUpdateWorkflowContainerViewData(FirmaSession currentFirmaSession, ProjectUpdateBatch projectUpdateBatch, EditProjectFundingSourceBudgetByCostTypeViewData.EditProjectFundingSourceBudgetByCostTypeViewDataForAngular viewDataForAngularClass, ProjectBudgetSummaryViewData projectBudgetSummaryViewData, ProjectBudgetsAnnualByCostTypeViewData projectBudgetsAnnualByCostTypeViewData, ProjectUpdateStatus projectUpdateStatus, EditProjectFundingSourceBudgetByCostTypeValidationResult editProjectFundingSourceBudgetByCostTypeValidationResult, EditProjectFundingSourceBudgetByCostTypeViewModel viewModelForPartial ) : base(currentFirmaSession, projectUpdateBatch, projectUpdateStatus, editProjectFundingSourceBudgetByCostTypeValidationResult.GetWarningMessages(), ProjectUpdateSection.Budget.ProjectUpdateSectionDisplayName) { ProjectBudgetSummaryViewData = projectBudgetSummaryViewData; ProjectBudgetsAnnualByCostTypeViewData = projectBudgetsAnnualByCostTypeViewData; bool showApproveAndReturnButton = ProjectFundingSourceByCostTypeViewDataHelper.ShowApproveAndReturnButtonForUpdateWorkflow(projectUpdateBatch, currentFirmaSession); ViewDataForPartial = new EditProjectFundingSourceBudgetByCostTypeViewData(viewDataForAngularClass, ProjectFundingSourceBudgetViewEnum.Update, projectUpdateBatch, projectUpdateStatus.IsBudgetsUpdated, showApproveAndReturnButton); ViewModelForPartial = viewModelForPartial; }
public override bool SectionIsUpdated(ProjectUpdateStatus projectUpdateStatus) { // Has no saved values, so never updated. return(false); }
public override bool SectionIsUpdated(ProjectUpdateStatus projectUpdateStatus) { return(projectUpdateStatus.IsExpendituresUpdated); }
public static List <ProjectSectionSimple> GetProjectUpdateSections(this ProjectWorkflowSectionGrouping projectWorkflowSectionGrouping, FirmaSession currentFirmaSession, ProjectUpdateBatch projectUpdateBatch, ProjectUpdateStatus projectUpdateStatus, bool ignoreStatus, bool hasEditableCustomAttributes) { switch (projectWorkflowSectionGrouping.ToEnum) { case ProjectWorkflowSectionGroupingEnum.Overview: // remove the custom attributes section from the overview section to begin with var projectUpdateSectionForCustomAttributes = projectWorkflowSectionGrouping.ProjectUpdateSections.Except(new List <ProjectUpdateSection> { ProjectUpdateSection.CustomAttributes }).ToList(); // If there are custom attribute types for this tenant, we can add the section back if (hasEditableCustomAttributes) { projectUpdateSectionForCustomAttributes.Add(ProjectUpdateSection.CustomAttributes); } return(GetProjectUpdateSectionsImpl(projectUpdateBatch, projectUpdateSectionForCustomAttributes, projectUpdateStatus, ignoreStatus)); case ProjectWorkflowSectionGroupingEnum.SpatialInformation: var geospatialAreaTypes = HttpRequestStorage.DatabaseEntities.GeospatialAreaTypes; var updateSections = projectWorkflowSectionGrouping.ProjectUpdateSections.Except(new List <ProjectUpdateSection> { ProjectUpdateSection.BulkSetSpatialInformation }).ToList(); if (geospatialAreaTypes.Count() > 1) { updateSections.Add(ProjectUpdateSection.BulkSetSpatialInformation); } var projectUpdateSections = GetProjectUpdateSectionsImpl(projectUpdateBatch, updateSections, projectUpdateStatus, ignoreStatus); //Bulk Set is the only section setup for spatial areas in the DB. so we always want to start with that sort order int maxSortOrder = ProjectUpdateSection.BulkSetSpatialInformation.SortOrder; projectUpdateSections.AddRange(geospatialAreaTypes .OrderBy(x => x.GeospatialAreaTypeName).ToList().Select((geospatialAreaType, index) => new ProjectSectionSimple(geospatialAreaType.GeospatialAreaTypeNamePluralized, maxSortOrder + index + 1, !projectUpdateBatch.IsNew(), projectWorkflowSectionGrouping, projectUpdateBatch.IsNew() ? null : SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(y => y.GeospatialArea(projectUpdateBatch.Project, geospatialAreaType)), projectUpdateStatus != null && projectUpdateBatch.IsProjectGeospatialAreaValid(geospatialAreaType), projectUpdateStatus != null && IsGeospatialAreaUpdated(projectUpdateBatch, geospatialAreaType) ))); return(projectUpdateSections); case ProjectWorkflowSectionGroupingEnum.Accomplishments: var projectUpdateSectionsForPerformanceMeasures = projectWorkflowSectionGrouping.ProjectUpdateSections.Except(new List <ProjectUpdateSection> { ProjectUpdateSection.ReportedAccomplishments }).ToList(); if (projectUpdateBatch.AreAccomplishmentsRelevant()) { projectUpdateSectionsForPerformanceMeasures.Add(ProjectUpdateSection.ReportedAccomplishments); } return(GetProjectUpdateSectionsImpl(projectUpdateBatch, projectUpdateSectionsForPerformanceMeasures, projectUpdateStatus, ignoreStatus)); case ProjectWorkflowSectionGroupingEnum.Financials: var projectUpdateSectionsForExpenditures = projectWorkflowSectionGrouping.ProjectUpdateSections.Except(new List <ProjectUpdateSection> { ProjectUpdateSection.Budget }).ToList(); if (projectUpdateBatch.Project.IsExpectedFundingRelevant()) { projectUpdateSectionsForExpenditures.Add(ProjectUpdateSection.Budget); } return(GetProjectUpdateSectionsImpl(projectUpdateBatch, projectUpdateSectionsForExpenditures, projectUpdateStatus, ignoreStatus)); case ProjectWorkflowSectionGroupingEnum.AdditionalData: var additionalDataProjectUpdateSections = projectWorkflowSectionGrouping.ProjectUpdateSections.ToList(); var sections = GetProjectUpdateSectionsImpl(projectUpdateBatch, additionalDataProjectUpdateSections, projectUpdateStatus, ignoreStatus); // Remove Technical Assistance Requests for all tenants except Idaho if (!MultiTenantHelpers.UsesTechnicalAssistanceParameters()) { sections = sections.Where(x => x.SectionDisplayName != ProjectUpdateSection.TechnicalAssistanceRequests.ProjectUpdateSectionDisplayName).ToList(); } return(sections); // Partner Finder // Whole section is conditional case ProjectWorkflowSectionGroupingEnum.Partners: bool shouldShowPartnerFinder = new MatchMakerViewPotentialPartnersFeature().HasPermissionForProjectByFirmaSession(currentFirmaSession, projectUpdateBatch.Project); if (!shouldShowPartnerFinder) { // An empty group won't be shown. return(new List <ProjectSectionSimple>()); } var projectUpdateSectionsForPartners = projectWorkflowSectionGrouping.ProjectUpdateSections.Except(new List <ProjectUpdateSection> { ProjectUpdateSection.Budget }).ToList(); return(GetProjectUpdateSectionsImpl(projectUpdateBatch, projectUpdateSectionsForPartners, projectUpdateStatus, ignoreStatus)); default: throw new ArgumentOutOfRangeException($"Unhandled Workflow Section Grouping: {projectWorkflowSectionGrouping.ToEnum}"); } }
public OrganizationsViewData(FirmaSession currentFirmaSession, ProjectUpdateBatch projectUpdateBatch, ProjectUpdateStatus projectUpdateStatus, EditOrganizationsViewData editOrganizationsViewData, OrganizationsValidationResult organizationsValidationResult, ProjectOrganizationsDetailViewData projectOrganizationsDetailViewData) : base( currentFirmaSession, projectUpdateBatch, projectUpdateStatus, organizationsValidationResult.GetWarningMessages(), ProjectUpdateSection.Organizations.ProjectUpdateSectionDisplayName) { EditOrganizationsViewData = editOrganizationsViewData; ProjectOrganizationsDetailViewData = projectOrganizationsDetailViewData; SectionCommentsViewData = new SectionCommentsViewData(projectUpdateBatch.OrganizationsComment, projectUpdateBatch.IsReturned()); RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshOrganizations(projectUpdateBatch.Project)); DiffUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.DiffOrganizations(projectUpdateBatch.Project)); }
public ExpendituresViewData(FirmaSession currentFirmaSession, ProjectUpdateBatch projectUpdateBatch, ViewDataForAngularClass viewDataForAngularClass, ProjectExpendituresDetailViewData projectExpendituresDetailViewData, ProjectUpdateStatus projectUpdateStatus, List <string> expendituresValidationErrors) : base(currentFirmaSession, projectUpdateBatch, projectUpdateStatus, expendituresValidationErrors, "OBSOLETE Expenditures") //: base(currentFirmaSession, projectUpdateBatch, projectUpdateStatus, expendituresValidationErrors, ProjectUpdateSection.Expenditures.ProjectUpdateSectionDisplayName) { ProjectID = projectUpdateBatch.ProjectID; ViewDataForAngular = viewDataForAngularClass; RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshExpenditures(projectUpdateBatch.Project)); DiffUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.DiffExpenditures(projectUpdateBatch.Project)); RequestFundingSourceUrl = SitkaRoute <HelpController> .BuildUrlFromExpression(x => x.MissingFundingSource()); ProjectExpendituresDetailViewData = projectExpendituresDetailViewData; SectionCommentsViewData = new SectionCommentsViewData(projectUpdateBatch.ExpendituresComment, projectUpdateBatch.IsReturned()); TotalOperatingCostInYearOfExpenditure = ProjectUpdateBatch.ProjectUpdate.CalculateTotalRemainingOperatingCost(); StartYearForTotalOperatingCostCalculation = projectUpdateBatch.ProjectUpdate.StartYearForTotalCostCalculations(); FieldDefinitionForProject = FieldDefinitionEnum.Project.ToType(); FieldDefinitionForFundingSource = FieldDefinitionEnum.FundingSource.ToType(); FieldDefinitionForCompletionYear = FieldDefinitionEnum.CompletionYear.ToType(); }
public ExternalLinksViewData(FirmaSession currentFirmaSession, ProjectUpdateBatch projectUpdateBatch, ProjectUpdateStatus projectUpdateStatus, ViewDataForAngularClass viewDataForAngular, EntityExternalLinksViewData entityExternalLinksViewData, string refreshUrl, string diffUrl) : base(currentFirmaSession, projectUpdateBatch, projectUpdateStatus, new List <string>(), ProjectUpdateSection.ExternalLinks.ProjectUpdateSectionDisplayName) { ViewDataForAngular = viewDataForAngular; EntityExternalLinksViewData = entityExternalLinksViewData; RefreshUrl = refreshUrl; DiffUrl = diffUrl; }
public override bool SectionIsUpdated(ProjectUpdateStatus projectUpdateStatus) { return(projectUpdateStatus.IsContactsUpdated); }
public override bool SectionIsUpdated(ProjectUpdateStatus projectUpdateStatus) { return(projectUpdateStatus.IsCustomAttributesUpdated); }
public PhotosViewData(FirmaSession currentFirmaSession, ProjectUpdateBatch projectUpdateBatch, ProjectUpdateStatus projectUpdateStatus) : base(currentFirmaSession, projectUpdateBatch, projectUpdateStatus, new List <string>(), ProjectUpdateSection.Photos.ProjectUpdateSectionDisplayName) { var addNewImageUrl = SitkaRoute <ProjectImageUpdateController> .BuildUrlFromExpression(x => x.New(projectUpdateBatch)); var selectKeyImageUrl = IsEditable ? SitkaRoute <ProjectImageUpdateController> .BuildUrlFromExpression(x => x.SetKeyPhoto(UrlTemplate.Parameter1Int)) : string.Empty; ImageGalleryViewData = new ImageGalleryViewData(currentFirmaSession, $"ProjectImages{projectUpdateBatch.Project.ProjectID}", projectUpdateBatch.ProjectImageUpdates.Select(x => new FileResourcePhoto(x)), IsEditable, addNewImageUrl, selectKeyImageUrl, true, x => x.CaptionOnFullView, "Photo"); RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshPhotos(projectUpdateBatch.Project)); DiffUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.DiffPhotos(projectUpdateBatch.Project)); ContinueUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.AttachmentsAndNotes(projectUpdateBatch.Project)); }
public ExpectedFundingViewData(FirmaSession currentFirmaSession, ProjectUpdateBatch projectUpdateBatch, ViewDataForAngularClass viewDataForAngularClass, ProjectBudgetSummaryViewData projectBudgetSummaryViewData, ProjectBudgetsAnnualViewData projectBudgetsAnnualViewData, ProjectUpdateStatus projectUpdateStatus, ExpectedFundingValidationResult expectedFundingValidationResult) : base(currentFirmaSession, projectUpdateBatch, projectUpdateStatus, expectedFundingValidationResult.GetWarningMessages(), ProjectUpdateSection.Budget.ProjectUpdateSectionDisplayName) { ViewDataForAngular = viewDataForAngularClass; RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshExpectedFunding(projectUpdateBatch.Project)); DiffUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.DiffExpectedFunding(projectUpdateBatch.Project)); RequestFundingSourceUrl = SitkaRoute <HelpController> .BuildUrlFromExpression(x => x.MissingFundingSource()); ProjectBudgetSummaryViewData = projectBudgetSummaryViewData; ProjectBudgetsAnnualViewData = projectBudgetsAnnualViewData; SectionCommentsViewData = new SectionCommentsViewData(projectUpdateBatch.ExpectedFundingComment, projectUpdateBatch.IsReturned()); ValidationWarnings = expectedFundingValidationResult.GetWarningMessages(); FundingTypeDescriptionString = projectUpdateBatch.ProjectUpdate.FundingTypeID == FundingType.BudgetVariesByYear.FundingTypeID ? " varies by year or it's a one-year project." : " is the same each year."; }
public override bool SectionIsUpdated(ProjectUpdateStatus projectUpdateStatus) { return(projectUpdateStatus.IsTechnicalAssistanceRequestsUpdated); }
public TechnicalAssistanceRequestsViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.FirmaPage firmaPage, ProjectUpdateBatch projectUpdateBatch, ProjectUpdateStatus projectUpdateStatus, List <TechnicalAssistanceType> technicalAssistanceTypes, List <CalendarYearString> fiscalYearStrings, List <PersonSimple> personSimples) : base(currentFirmaSession, projectUpdateBatch, projectUpdateStatus, new List <string>(), ProjectUpdateSection.TechnicalAssistanceRequests.ProjectUpdateSectionDisplayName) { Check.EnsureNotNull(firmaPage, "The Firma Page for this section is not found; is one defined?"); bool hasPermissionToManageFirmaPage = new FirmaPageManageFeature().HasPermission(currentFirmaSession, firmaPage).HasPermission; TechnicalAssistanceInstructionsViewData = new ViewPageContentViewData(firmaPage, hasPermissionToManageFirmaPage); UserCanAllocate = new ProjectUpdateAdminFeatureWithProjectContext().HasPermission(currentFirmaSession, projectUpdateBatch.Project).HasPermission; ViewDataForAngular = new TechnicalAssistanceRequestsViewDataForAngular(projectUpdateBatch.ProjectID, technicalAssistanceTypes, fiscalYearStrings, personSimples); SectionCommentsViewData = new SectionCommentsViewData(projectUpdateBatch.TechnicalAssistanceRequestsComment, projectUpdateBatch.IsReturned()); RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshTechnicalAssistanceRequests(projectUpdateBatch.Project)); }
public override bool SectionIsUpdated(ProjectUpdateStatus projectUpdateStatus) { return(projectUpdateStatus.IsBulkSetSpatialInformationUpdated); }