public ViewResult Detail(PriorityLandscapePrimaryKey priorityLandscapePrimaryKey) { var priorityLandscape = priorityLandscapePrimaryKey.EntityObject; var mapDivID = $"priorityLandscape_{priorityLandscape.PriorityLandscapeID}_Map"; var associatedProjects = priorityLandscape.GetAssociatedProjectsVisibleToUser(CurrentPerson); var layers = PriorityLandscape.GetPriorityLandscapeAndAssociatedProjectLayers(priorityLandscape, associatedProjects); var mapInitJson = new MapInitJson(mapDivID, 10, layers, new BoundingBox(priorityLandscape.PriorityLandscapeLocation)); var projectGrantAllocationExpenditures = associatedProjects.SelectMany(x => x.ProjectGrantAllocationExpenditures); var organizationTypes = HttpRequestStorage.DatabaseEntities.OrganizationTypes.ToList(); const string chartTitle = "Reported Expenditures By Organization Type"; var chartContainerID = chartTitle.Replace(" ", ""); var googleChart = projectGrantAllocationExpenditures.ToGoogleChart(x => x.GrantAllocation.BottommostOrganization.OrganizationType.OrganizationTypeName, organizationTypes.Select(x => x.OrganizationTypeName).ToList(), x => x.GrantAllocation.BottommostOrganization.OrganizationType.OrganizationTypeName, chartContainerID, chartTitle); var viewGoogleChartViewData = new ViewGoogleChartViewData(googleChart, chartTitle, 405, true); var performanceMeasures = associatedProjects .SelectMany(x => x.PerformanceMeasureActuals) .Select(x => x.PerformanceMeasure).Distinct() .OrderBy(x => x.PerformanceMeasureDisplayName) .ToList(); var viewData = new DetailViewData(CurrentPerson, priorityLandscape, mapInitJson, viewGoogleChartViewData, performanceMeasures); return(RazorView <Detail, DetailViewData>(viewData)); }
private PartialViewResult ViewEditProjectBoundingBox(Project project, EditProjectBoundingBoxViewModel viewModel) { var layerGeoJsons = new List <LayerGeoJson> { project.HasProjectLocationPoint ? new LayerGeoJson("Simple Location", project.SimpleLocationToGeoJsonFeatureCollection(true), FirmaHelpers.DefaultColorRange[1], 0.8m, LayerInitialVisibility.Show) : null, project.HasProjectLocationDetail ? new LayerGeoJson("Detailed Location", project.AllDetailedLocationsToGeoJsonFeatureCollection(), FirmaHelpers.DefaultColorRange[1], 0.8m, LayerInitialVisibility.Show) : null } .Where(x => x != null) .ToList(); layerGeoJsons.Add(PriorityLandscape.GetPriorityLandscapeWmsLayerGeoJson("#90C3D4", 0.1m, LayerInitialVisibility.Hide)); layerGeoJsons.Add(DNRUplandRegion.GetRegionWmsLayerGeoJson("#90C3D4", 0.1m, LayerInitialVisibility.Hide)); var boundingBox = BoundingBox.MakeBoundingBoxFromProject(project); var mapInitJson = new MapInitJson("EditProjectBoundingBoxMap", 10, layerGeoJsons, boundingBox) { AllowFullScreen = false, DisablePopups = true }; var editProjectBoundingBoxUrl = SitkaRoute <ProjectLocationController> .BuildUrlFromExpression(c => c.EditProjectBoundingBox(project)); var viewData = new EditProjectBoundingBoxViewData(mapInitJson, editProjectBoundingBoxUrl, EditProjectBoundingBoxFormID); return(RazorPartialView <EditProjectBoundingBox, EditProjectBoundingBoxViewData, EditProjectBoundingBoxViewModel>(viewData, viewModel)); }
private PartialViewResult ViewDeletePriorityLandscape(PriorityLandscape priorityLandscape, ConfirmDialogFormViewModel viewModel) { var canDelete = !priorityLandscape.HasDependentObjects(); var confirmMessage = canDelete ? $"Are you sure you want to delete this PriorityLandscape '{priorityLandscape.PriorityLandscapeName}'?" : ConfirmDialogFormViewData.GetStandardCannotDeleteMessage($"<p>Washington State Department of Natural Resources has six upland priorityLandscape offices that help to provide localized services throughout Washington.</p>", SitkaRoute <PriorityLandscapeController> .BuildLinkFromExpression(x => x.Detail(priorityLandscape), "here")); var viewData = new ConfirmDialogFormViewData(confirmMessage, canDelete); return(RazorPartialView <ConfirmDialogForm, ConfirmDialogFormViewData, ConfirmDialogFormViewModel>(viewData, viewModel)); }
public ViewResult Index() { var layerGeoJsons = new List <LayerGeoJson>(); layerGeoJsons = new List <LayerGeoJson> { PriorityLandscape.GetPriorityLandscapeWmsLayerGeoJson("#59ACFF", 0.2m, LayerInitialVisibility.Show) }; var mapInitJson = new MapInitJson("priorityLandscapeIndex", 10, layerGeoJsons, BoundingBox.MakeNewDefaultBoundingBox()); var firmaPage = FirmaPage.GetFirmaPageByPageType(FirmaPageType.PriorityLandscapesList); var viewData = new IndexViewData(CurrentPerson, mapInitJson, firmaPage); return(RazorView <Index, IndexViewData>(viewData)); }