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(); }
public void UpdateModel(ProjectUpdateBatch projectUpdateBatch) { if (ProjectUpdateSectionEnum.HasValue) { switch (ProjectUpdateSectionEnum.Value) { case Models.ProjectUpdateSectionEnum.Basics: projectUpdateBatch.BasicsComment = SectionComments; break; // 5/15/2019 TK - WADNR currently does not have a use. But may need expenditures in phase 2 //case Models.ProjectUpdateSectionEnum.Expenditures: // projectUpdateBatch.ExpendituresComment = SectionComments; // break; case Models.ProjectUpdateSectionEnum.PerformanceMeasures: projectUpdateBatch.PerformanceMeasuresComment = SectionComments; break; case Models.ProjectUpdateSectionEnum.LocationSimple: projectUpdateBatch.LocationSimpleComment = SectionComments; break; case Models.ProjectUpdateSectionEnum.LocationDetailed: projectUpdateBatch.LocationDetailedComment = SectionComments; break; default: throw new ArgumentOutOfRangeException(); } } }
public void UpdateModelBatch(ProjectUpdateBatch projectUpdateBatch) { var projectUpdate = projectUpdateBatch.ProjectUpdate; projectUpdate.ProjectLocationSimpleTypeID = ProjectFirmaModels.Models.ProjectLocationSimpleType.ToType(ProjectLocationSimpleType).ProjectLocationSimpleTypeID; switch (ProjectLocationSimpleType) { case ProjectLocationSimpleTypeEnum.PointOnMap: case ProjectLocationSimpleTypeEnum.LatLngInput: // Using ProjectLocationPoint here because the location is being updated projectUpdate.ProjectLocationPoint = ProjectLocationPointX.HasValue && ProjectLocationPointY.HasValue ? DbSpatialHelper.MakeDbGeometryFromCoordinates(ProjectLocationPointX.Value, ProjectLocationPointY.Value, LtInfoGeometryConfiguration.DefaultCoordinateSystemId) : null; break; case ProjectLocationSimpleTypeEnum.None: // Using ProjectLocationPoint here because the location is being updated projectUpdate.ProjectLocationPoint = null; break; default: throw new ArgumentOutOfRangeException(); } projectUpdate.ProjectLocationNotes = ProjectLocationNotes; projectUpdate.LocationIsPrivate = LocationIsPrivate; }
public ActionResult DeleteProjectImageUpdate(ProjectImageUpdatePrimaryKey projectImageUpdatePrimaryKey, ConfirmDialogFormViewModel viewModel) { var projectImageUpdate = projectImageUpdatePrimaryKey.EntityObject; if (!ModelState.IsValid) { return(ViewDeleteProjectImageUpdate(projectImageUpdate, viewModel)); } var projectUpdateBatch = projectImageUpdate.ProjectUpdateBatch; ProjectUpdateBatch.DeleteProjectImageUpdates(new[] { projectImageUpdate }); // reset key photo if needed if (projectImageUpdate.IsKeyPhoto) { var firstNonKeyPhoto = projectUpdateBatch.ProjectImageUpdates.FirstOrDefault(x => !x.IsKeyPhoto && x.ProjectImageUpdateID != projectImageUpdate.ProjectImageUpdateID); if (firstNonKeyPhoto != null) { firstNonKeyPhoto.SetAsKeyPhoto(projectUpdateBatch.ProjectImageUpdates.Except(new[] { firstNonKeyPhoto, projectImageUpdate }).ToList()); } } projectUpdateBatch.IsPhotosUpdated = true; projectUpdateBatch.TickleLastUpdateDate(CurrentPerson); return(new ModalDialogFormJsonResult()); }
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 EditProjectFundingSourceBudgetByCostTypeViewModel(ProjectUpdateBatch projectUpdateBatch, List <int> calendarYearsToPopulate, List <ProjectRelevantCostTypeSimple> projectRelevantCostTypes) { FundingTypeID = projectUpdateBatch.ProjectUpdate.FundingTypeID; ProjectRelevantCostTypes = projectRelevantCostTypes; var noFundingSourceAmountSimples = new List <ProjectNoFundingSourceIdentifiedSimple>(); var projectNoFundingSourceIdentifieds = projectUpdateBatch.ProjectNoFundingSourceIdentifiedUpdates.ToList(); if (projectUpdateBatch.ProjectUpdate.FundingTypeID.HasValue) { switch (projectUpdateBatch.ProjectUpdate.FundingType.ToEnum) { case FundingTypeEnum.BudgetVariesByYear: { ProjectFundingSourceBudgets = ProjectFundingSourceBudgetsByCostTypeBulk.MakeFromListByCostType(projectUpdateBatch, calendarYearsToPopulate); noFundingSourceAmountSimples.AddRange(ProjectNoFundingSourceIdentifiedSimple.CreateFromProjectNoFundingSourceIdentifieds(projectNoFundingSourceIdentifieds)); break; } case FundingTypeEnum.BudgetSameEachYear: ProjectFundingSourceBudgets = ProjectFundingSourceBudgetsByCostTypeBulk.MakeFromListByCostType(projectUpdateBatch, new List <int>()); noFundingSourceAmountSimples.AddRange(ProjectNoFundingSourceIdentifiedSimple.CreateFromProjectNoFundingSourceIdentifieds(projectNoFundingSourceIdentifieds)); break; default: throw new ArgumentOutOfRangeException(); } } NoFundingSourceAmounts = noFundingSourceAmountSimples; }
public void UpdateModel(ProjectUpdateBatch projectUpdateBatch) { if (ProjectUpdateSectionEnum.HasValue) { switch (ProjectUpdateSectionEnum.Value) { case ProjectFirmaModels.Models.ProjectUpdateSectionEnum.Basics: projectUpdateBatch.BasicsComment = SectionComments; break; case ProjectFirmaModels.Models.ProjectUpdateSectionEnum.Expenditures: projectUpdateBatch.ExpendituresComment = SectionComments; break; case ProjectFirmaModels.Models.ProjectUpdateSectionEnum.ReportedAccomplishments: projectUpdateBatch.ReportedPerformanceMeasuresComment = SectionComments; break; case ProjectFirmaModels.Models.ProjectUpdateSectionEnum.LocationSimple: projectUpdateBatch.LocationSimpleComment = SectionComments; break; case ProjectFirmaModels.Models.ProjectUpdateSectionEnum.LocationDetailed: projectUpdateBatch.LocationDetailedComment = SectionComments; break; case ProjectFirmaModels.Models.ProjectUpdateSectionEnum.ExpectedAccomplishments: projectUpdateBatch.ExpectedPerformanceMeasuresComment = SectionComments; break; default: throw new ArgumentOutOfRangeException(); } } }
private PartialViewResult ViewNew(ProjectUpdateBatch projectUpdateBatch, NewViewModel viewModel) { var projectImageTimings = ProjectImageTiming.All.OrderBy(x => x.SortOrder).ToSelectListWithEmptyFirstRow(x => x.ProjectImageTimingID.ToString(CultureInfo.InvariantCulture), x => x.ProjectImageTimingDisplayName); var viewData = new NewViewData(projectUpdateBatch, projectImageTimings); return(RazorPartialView <New, NewViewData, NewViewModel>(viewData, viewModel)); }
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 static ProjectUpdateBatch Create(Project project) { var person = TestPerson.Create(); var projectUpdateBatch = new ProjectUpdateBatch(project, DateTime.Now, person, ProjectUpdateState.Created, false); return(projectUpdateBatch); }
public ExpendituresViewModel(ProjectUpdateBatch projectUpdateBatch, List <ProjectFundingSourceExpenditureBulk> projectFundingSourceExpenditures) { ExpendituresNote = projectUpdateBatch.ExpendituresNote; ProjectFundingSourceExpenditures = projectFundingSourceExpenditures; ShowValidationWarnings = true; Comments = projectUpdateBatch.ExpendituresComment; HasExpenditures = projectFundingSourceExpenditures.Any(); }
public ExpectedFundingViewModel(ProjectUpdateBatch projectUpdateBatch, List <ProjectFundingSourceBudgetUpdate> projectFundingSourceBudgetUpdates, string comments) { NoFundingSourceIdentifiedYet = projectUpdateBatch.ProjectNoFundingSourceIdentifiedUpdates.FirstOrDefault()?.NoFundingSourceIdentifiedYet; Comments = comments; ExpectedFundingUpdateNote = projectUpdateBatch.ExpectedFundingUpdateNote; ViewModelForAngular = new ViewModelForAngularEditor(projectUpdateBatch.ProjectUpdate.FundingTypeID ?? 0, projectFundingSourceBudgetUpdates, NoFundingSourceIdentifiedYet); }
public ViewDataForAngularClass(ProjectUpdateBatch projectUpdateBatch, List <GrantAllocationSimple> allGrantAllocationSimples, decimal estimatedTotalCost) { AllGrantAllocationSimples = allGrantAllocationSimples; ProjectID = projectUpdateBatch.ProjectUpdateBatchID; EstimatedTotalCost = estimatedTotalCost; }
public static ProjectUpdate Create(ProjectUpdateBatch projectUpdateBatch) { var projectUpdate = new ProjectUpdate(projectUpdateBatch, ProjectStage.PlanningDesign, MakeTestName("Project Description"), ProjectLocationSimpleType.None, false); projectUpdateBatch.ProjectUpdate = projectUpdate; return(projectUpdate); }
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 LocationDetailedViewData(FirmaSession currentFirmaSession, ProjectUpdateBatch projectUpdateBatch, ProjectLocationDetailViewData projectLocationDetailViewData, string uploadGisFileUrl, ProjectUpdateStatus projectUpdateStatus) : base(currentFirmaSession, projectUpdateBatch, projectUpdateStatus, new List <string>(), ProjectUpdateSection.LocationDetailed.ProjectUpdateSectionDisplayName) { ProjectLocationDetailViewData = projectLocationDetailViewData; UploadGisFileUrl = uploadGisFileUrl; RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshProjectLocationDetailed(projectUpdateBatch.Project)); SectionCommentsViewData = new SectionCommentsViewData(projectUpdateBatch.LocationDetailedComment, projectUpdateBatch.IsReturned()); }
public ExpendituresByCostTypeViewModel(ProjectUpdateBatch projectUpdateBatch, List <int> calendarYearsToPopulate, List <ProjectRelevantCostTypeSimple> projectRelevantCostTypeSimples) { ProjectRelevantCostTypes = projectRelevantCostTypeSimples; Explanation = projectUpdateBatch.ExpendituresNote; ProjectFundingSourceExpenditures = ProjectFundingSourceExpenditureBulk.MakeFromListByCostType(projectUpdateBatch, calendarYearsToPopulate); HasExpenditures = ProjectFundingSourceExpenditures.Any(); ShowValidationWarnings = true; Comments = projectUpdateBatch.ExpendituresComment; }
public ExpendituresViewModel(ProjectUpdateBatch projectUpdateBatch, List <int> calendarYearsToPopulate, List <ProjectExemptReportingYearSimple> projectExemptReportingYears) { ProjectExemptReportingYears = projectExemptReportingYears; Explanation = projectUpdateBatch.NoExpendituresToReportExplanation; ProjectGrantAllocationExpenditures = ProjectGrantAllocationExpenditureBulk.MakeFromList(projectUpdateBatch.ProjectGrantAllocationExpenditureUpdates.ToList(), calendarYearsToPopulate); ShowValidationWarnings = true; Comments = projectUpdateBatch.ExpendituresComment; }
public ContactsViewModel(ProjectUpdateBatch projectUpdateBatch) { ProjectContactSimples = projectUpdateBatch.ProjectContactUpdates.Any() ? projectUpdateBatch.ProjectContactUpdates .Select(x => new ProjectContactSimple(x)).ToList() : new List <ProjectContactSimple>(); PrimaryContactPersonID = projectUpdateBatch.ProjectUpdate.PrimaryContactPersonID; Comments = projectUpdateBatch.ContactsComment; }
public static PerformanceMeasureActualUpdate Create(ProjectUpdateBatch projectUpdateBatch, int calendarYear, double?actualValue) { var performanceMeasure = TestPerformanceMeasure.Create(); var performanceMeasureActualUpdate = new PerformanceMeasureActualUpdate(projectUpdateBatch, performanceMeasure, calendarYear) { ActualValue = actualValue }; return(performanceMeasureActualUpdate); }
public static ProjectUpdate Create(ProjectUpdateBatch projectUpdateBatch) { var focusArea = TestFocusArea.Create(); var projectUpdate = new ProjectUpdate(projectUpdateBatch, ProjectStage.Planned, ProjectLocationSimpleType.None); projectUpdate.ProjectDescription = MakeTestName("Project Description"); projectUpdate.FocusArea = focusArea; projectUpdateBatch.ProjectUpdate = projectUpdate; return(projectUpdate); }
public OrganizationsViewModel(ProjectUpdateBatch projectUpdateBatch) { ProjectOrganizationSimples = projectUpdateBatch.ProjectOrganizationUpdates.Any() ? projectUpdateBatch.ProjectOrganizationUpdates .Select(x => new ProjectOrganizationSimple(x)).ToList() : new List <ProjectOrganizationSimple>(); PrimaryContactPersonID = projectUpdateBatch.ProjectUpdate.PrimaryContactPersonID; Comments = projectUpdateBatch.OrganizationsComment; OtherPartners = projectUpdateBatch.ProjectUpdate.OtherPartners; }
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 ContactsViewData(Person currentPerson, ProjectUpdateBatch projectUpdateBatch, UpdateStatus updateStatus, EditPeopleViewData editPeopleViewData, ContactsValidationResult organizationsValidationResult, ProjectPeopleDetailViewData projectPeopleDetailViewData) : base( currentPerson, projectUpdateBatch, updateStatus, organizationsValidationResult.GetWarningMessages(), ProjectUpdateSection.Contacts.ProjectUpdateSectionDisplayName) { EditPeopleViewData = editPeopleViewData; ProjectPeopleDetailViewData = projectPeopleDetailViewData; SectionCommentsViewData = new SectionCommentsViewData(projectUpdateBatch.ContactsComment, projectUpdateBatch.IsReturned); RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshContacts(projectUpdateBatch.Project)); DiffUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.DiffContacts(projectUpdateBatch.Project)); }
public ViewDataForAngularClass(ProjectUpdateBatch projectUpdateBatch, List <FundingSourceSimple> allFundingSources, IEnumerable <SelectListItem> fundingTypes, int?planningDesignStartYear, int?completionYear) { AllFundingSources = allFundingSources; FundingTypes = fundingTypes; ProjectUpdateBatchID = projectUpdateBatch.ProjectUpdateBatchID; FundingTypeID = projectUpdateBatch.ProjectUpdate.FundingType?.FundingTypeID; PlanningDesignStartYear = planningDesignStartYear; CompletionYear = completionYear; }
public void UpdateModel(ProjectUpdateBatch projectUpdateBatch, FirmaSession currentFirmaSession) { CheckForNotNullProjectUpdateBatchId(); var fileResourceInfo = FileResourceModelExtensions.CreateNewFromHttpPostedFile(UploadedFile, currentFirmaSession.Person); HttpRequestStorage.DatabaseEntities.AllFileResourceInfos.Add(fileResourceInfo); var projectAttachment = new ProjectAttachmentUpdate(projectUpdateBatch.ProjectUpdateBatchID, fileResourceInfo.FileResourceInfoID, AttachmentTypeID, DisplayName) { Description = Description }; projectUpdateBatch.ProjectAttachmentUpdates.Add(projectAttachment); }
public ExpendituresViewData(Person currentPerson, ProjectUpdateBatch projectUpdateBatch, ViewDataForAngularClass viewDataForAngularClass, ProjectExpendituresDetailViewData projectExpendituresDetailViewData, UpdateStatus updateStatus, List <string> expendituresValidationErrors) : base(currentPerson, projectUpdateBatch, updateStatus, expendituresValidationErrors, "THIS IS BROKEN!" /* 5/15/2019 TK- ProjectUpdateSection.Expenditures.ProjectUpdateSectionDisplayName*/) { ViewDataForAngular = viewDataForAngularClass; RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshExpenditures(projectUpdateBatch.Project)); DiffUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.DiffExpenditures(projectUpdateBatch.Project)); RequestGrantAllocationUrl = SitkaRoute <HelpController> .BuildUrlFromExpression(x => x.MissingGrantAllocation()); ProjectExpendituresDetailViewData = projectExpendituresDetailViewData; SectionCommentsViewData = new SectionCommentsViewData(projectUpdateBatch.ExpendituresComment, projectUpdateBatch.IsReturned); }
public void UpdateModel(ProjectUpdateBatch projectUpdateBatch, Person currentPerson) { for (int key = 0; key < Files.Count; key++) { var fileResource = FileResource.CreateNewFromHttpPostedFile(Files[key], currentPerson); HttpRequestStorage.DatabaseEntities.FileResources.Add(fileResource); var projectDocument = new ProjectDocumentUpdate(projectUpdateBatch.ProjectID, fileResource.FileResourceID, DisplayNames[key]) { Description = !Descriptions[key].IsNullOrWhiteSpace() ? Descriptions[key] : null }; projectUpdateBatch.ProjectDocumentUpdates.Add(projectDocument); } }
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 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; }