public DocumentsAndNotesViewData(Person currentPerson, ProjectUpdateBatch projectUpdateBatch, UpdateStatus updateStatus, string diffUrl) : base(currentPerson, projectUpdateBatch, updateStatus, new List <string>(), ProjectUpdateSection.NotesAndDocuments.ProjectUpdateSectionDisplayName)
        {
            EntityNotesViewData = new EntityNotesViewData(EntityNote.CreateFromEntityNote(new List <IEntityNote>(projectUpdateBatch.ProjectNoteUpdates)),
                                                          SitkaRoute <ProjectNoteUpdateController> .BuildUrlFromExpression(x => x.New(projectUpdateBatch)),
                                                          projectUpdateBatch.Project.DisplayName,
                                                          IsEditable);
            ProjectDocumentsViewData = new ProjectDocumentsDetailViewData(EntityDocument.CreateFromEntityDocument(new List <IEntityDocument>(projectUpdateBatch.ProjectDocumentUpdates)),
                                                                          SitkaRoute <ProjectDocumentUpdateController> .BuildUrlFromExpression(x => x.New(projectUpdateBatch)),
                                                                          projectUpdateBatch.Project.DisplayName,
                                                                          IsEditable);
            RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshNotesAndDocuments(projectUpdateBatch.Project));

            DiffUrl = diffUrl;
        }
Ejemplo n.º 2
0
        public PhotosViewData(Person currentPerson, ProjectUpdateBatch projectUpdateBatch, UpdateStatus updateStatus) : base(currentPerson, projectUpdateBatch, updateStatus, new List <string>(), ProjectUpdateSection.Photos.ProjectUpdateSectionDisplayName)
        {
            var newPhotoForProjectUrl = SitkaRoute <ProjectImageUpdateController> .BuildUrlFromExpression(x => x.New(projectUpdateBatch));

            var selectKeyImageUrl = IsEditable ? SitkaRoute <ProjectImageUpdateController> .BuildUrlFromExpression(x => x.SetKeyPhoto(UrlTemplate.Parameter1Int)) : string.Empty;

            ImageGalleryViewData = new ImageGalleryViewData(currentPerson,
                                                            string.Format("ProjectImages{0}", projectUpdateBatch.Project.ProjectID),
                                                            projectUpdateBatch.ProjectImageUpdates,
                                                            IsEditable,
                                                            newPhotoForProjectUrl,
                                                            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.ExternalLinks(projectUpdateBatch.Project));
        }
        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 ProjectUpdateViewData(Person currentPerson, ProjectUpdateBatch projectUpdateBatch, UpdateStatus updateStatus, List <string> validationWarnings, string currentSectionDisplayName) : base(currentPerson, null)
        {
            IsInstructionsPage  = currentSectionDisplayName.Equals("Instructions", StringComparison.InvariantCultureIgnoreCase);
            InstructionsPageUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.Instructions(projectUpdateBatch.Project));

            ProjectWorkflowSectionGroupings = ProjectWorkflowSectionGrouping.All.OrderBy(x => x.SortOrder).ToList();
            ProjectUpdateBatch         = projectUpdateBatch;
            Project                    = projectUpdateBatch.Project;
            PrimaryContactPerson       = projectUpdateBatch.Project.GetPrimaryContact();
            HtmlPageTitle             += $" - {Models.FieldDefinition.Project.GetFieldDefinitionLabel()} Updates";
            EntityName                 = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()} Update";
            PageTitle                  = $"Update: {Project.DisplayName}";
            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());

            var isApprover = new ProjectUpdateAdminFeatureWithProjectContext().HasPermission(CurrentPerson, Project).HasPermission;

            ShowApproveAndReturnButton = projectUpdateBatch.IsSubmitted && isApprover;
            IsEditable            = projectUpdateBatch.InEditableState || ShowApproveAndReturnButton;
            IsReadyToApprove      = projectUpdateBatch.IsReadyToApprove;
            AreProjectBasicsValid = projectUpdateBatch.AreProjectBasicsValid;

            //Neuter UpdateStatus for non-approver users until we go live with "Show Changes" for all users.
            UpdateStatus     = CurrentPerson.IsApprover() ? updateStatus : new UpdateStatus(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false);
            HasUpdateStarted = ModelObjectHelpers.IsRealPrimaryKeyValue(projectUpdateBatch.ProjectUpdateBatchID);

            ValidationWarnings        = validationWarnings;
            CurrentSectionDisplayName = currentSectionDisplayName;
        }
Ejemplo n.º 5
0
 public ExternalLinksViewData(Person currentPerson, ProjectUpdateBatch projectUpdateBatch, UpdateStatus updateStatus, ViewDataForAngularClass viewDataForAngular, EntityExternalLinksViewData entityExternalLinksViewData, string refreshUrl, string diffUrl)
     : base(currentPerson, projectUpdateBatch, updateStatus, new List <string>(), ProjectUpdateSection.ExternalLinks.ProjectUpdateSectionDisplayName)
 {
     ViewDataForAngular          = viewDataForAngular;
     EntityExternalLinksViewData = entityExternalLinksViewData;
     RefreshUrl = refreshUrl;
     DiffUrl    = diffUrl;
 }
Ejemplo n.º 6
0
        public LocationDetailedViewData(Person currentPerson, ProjectUpdateBatch projectUpdateBatch, ProjectLocationDetailViewData projectLocationDetailViewData, string uploadGisFileUrl, UpdateStatus updateStatus)
            : base(currentPerson, projectUpdateBatch, updateStatus, 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);
        }
Ejemplo n.º 7
0
        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));
        }
Ejemplo n.º 8
0
        public LocationSimpleViewData(Person currentPerson,
                                      Models.ProjectUpdate projectUpdate,
                                      ProjectLocationSimpleViewData projectLocationSimpleViewData,
                                      ProjectLocationSummaryViewData projectLocationSummaryViewData,
                                      LocationSimpleValidationResult locationSimpleValidationResult, UpdateStatus updateStatus) : base(
                currentPerson, projectUpdate.ProjectUpdateBatch, updateStatus,
                locationSimpleValidationResult.GetWarningMessages(),
                ProjectUpdateSection.LocationSimple.ProjectUpdateSectionDisplayName)
        {
            ProjectLocationSimpleViewData  = projectLocationSimpleViewData;
            ProjectLocationSummaryViewData = projectLocationSummaryViewData;
            RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x =>
                                                                                      x.RefreshProjectLocationSimple(projectUpdate.ProjectUpdateBatch.Project));

            SectionCommentsViewData = new SectionCommentsViewData(
                projectUpdate.ProjectUpdateBatch.LocationSimpleComment, projectUpdate.ProjectUpdateBatch.IsReturned);
            ValidationWarnings = locationSimpleValidationResult.GetWarningMessages();
        }
Ejemplo n.º 9
0
        public ExpectedFundingViewData(Person currentPerson, ProjectUpdateBatch projectUpdateBatch, ViewDataForAngularClass viewDataForAngularClass, ProjectFundingDetailViewData projectFundingDetailViewData, UpdateStatus updateStatus, ExpectedFundingValidationResult expectedFundingValidationResult)
            : base(currentPerson, projectUpdateBatch, updateStatus, expectedFundingValidationResult.GetWarningMessages(), ProjectUpdateSection.ExpectedFunding.ProjectUpdateSectionDisplayName)
        {
            ViewDataForAngular = viewDataForAngularClass;
            RefreshUrl         = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshExpectedFunding(projectUpdateBatch.Project));

            DiffUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.DiffExpectedFunding(projectUpdateBatch.Project));

            RequestGrantAllocationUrl = SitkaRoute <HelpController> .BuildUrlFromExpression(x => x.MissingGrantAllocation());

            ProjectFundingDetailViewData = projectFundingDetailViewData;
            SectionCommentsViewData      = new SectionCommentsViewData(projectUpdateBatch.ExpectedFundingComment, projectUpdateBatch.IsReturned);
            ValidationWarnings           = expectedFundingValidationResult.GetWarningMessages();
            FundingSources = FundingSource.All.ToSelectList(x => x.FundingSourceID.ToString(), y => y.FundingSourceDisplayName).ToList();
        }
Ejemplo n.º 10
0
 public InstructionsViewData(Person currentPerson, ProjectUpdateBatch projectUpdateBatch, UpdateStatus updateStatus) : base(currentPerson, projectUpdateBatch, updateStatus, new List <string>(), "Instructions")
 {
     PerformanceMeasuresUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(x => x.Index());
 }