public PriorityLandscapesViewData(Person currentPerson,
                                   Models.Project project,
                                   ProposalSectionsStatus proposalSectionsStatus,
                                   EditProjectPriorityLandscapesViewData editProjectPriorityLandscapesViewData) : base(currentPerson, project, ProjectCreateSection.PriorityLandscapes.ProjectCreateSectionDisplayName, proposalSectionsStatus)
 {
     EditProjectPriorityLandscapesViewData = editProjectPriorityLandscapesViewData;
 }
        public PriorityLandscapesViewData(Person currentPerson,
                                          Models.ProjectUpdate projectUpdate,
                                          EditProjectPriorityLandscapesViewData editProjectPriorityLandscapesViewData,
                                          ProjectLocationSummaryViewData projectLocationSummaryViewData,
                                          PriorityLandscapesValidationResult priorityLandscapeValidationResult,
                                          UpdateStatus updateStatus) : base(currentPerson, projectUpdate.ProjectUpdateBatch, updateStatus, priorityLandscapeValidationResult.GetWarningMessages(), "Priority Landscapes")
        {
            EditProjectPriorityLandscapesViewData = editProjectPriorityLandscapesViewData;
            ProjectLocationSummaryViewData        = projectLocationSummaryViewData;
            RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshProjectPriorityLandscape(projectUpdate.ProjectUpdateBatch.Project));

            SectionCommentsViewData = new SectionCommentsViewData(projectUpdate.ProjectUpdateBatch.LocationSimpleComment, projectUpdate.ProjectUpdateBatch.IsReturned);
        }
Пример #3
0
        private PartialViewResult ViewEditProjectPriorityLandscapes(EditProjectPriorityLandscapesViewModel viewModel, Project project)
        {
            var boundingBox = ProjectLocationSummaryMapInitJson.GetProjectBoundingBox(project);
            var layers      = MapInitJson.GetPriorityLandscapeMapLayers(LayerInitialVisibility.Show);

            layers.AddRange(MapInitJson.GetProjectLocationSimpleAndDetailedMapLayers(project));
            var mapInitJson = new MapInitJson("projectPriorityLandscapeMap", 0, layers, boundingBox)
            {
                AllowFullScreen = false, DisablePopups = true
            };
            var priorityLandscapeIDs                 = viewModel.PriorityLandscapeIDs ?? new List <int>();
            var priorityLandscapesInViewModel        = HttpRequestStorage.DatabaseEntities.PriorityLandscapes.Where(x => priorityLandscapeIDs.Contains(x.PriorityLandscapeID)).ToList();
            var editProjectPriorityLandscapesPostUrl = SitkaRoute <ProjectPriorityLandscapeController> .BuildUrlFromExpression(c => c.EditProjectPriorityLandscapes(project, null));

            var editProjectPriorityLandscapesFormID = GetEditProjectPriorityLandscapesFormID();

            var viewData = new EditProjectPriorityLandscapesViewData(CurrentPerson, mapInitJson, priorityLandscapesInViewModel, editProjectPriorityLandscapesPostUrl, editProjectPriorityLandscapesFormID, project.HasProjectLocationPoint, project.HasProjectLocationDetail);

            return(RazorPartialView <EditProjectPriorityLandscapes, EditProjectPriorityLandscapesViewData, EditProjectPriorityLandscapesViewModel>(viewData, viewModel));
        }