public ViewResult Detail(DNRUplandRegionPrimaryKey dnrUplandRegionPrimaryKey) { var region = dnrUplandRegionPrimaryKey.EntityObject; var mapDivID = $"region_{region.DNRUplandRegionID}_Map"; var associatedProjects = region.GetAssociatedProjects(CurrentPerson); var layers = DNRUplandRegion.GetRegionAndAssociatedProjectLayers(region, associatedProjects); var mapInitJson = new MapInitJson(mapDivID, 10, layers, new BoundingBox(region.DNRUplandRegionLocation)); var grantAllocationExpenditures = new List <GrantAllocationExpenditure>(); region.GrantAllocations.ForEach(x => grantAllocationExpenditures.AddRange(x.GrantAllocationExpenditures)); var costTypes = CostType.GetLineItemCostTypes(); const string chartTitle = "Grant Allocation Expenditures By Cost Type"; var chartContainerID = chartTitle.Replace(" ", ""); var googleChart = grantAllocationExpenditures.ToGoogleChart(x => x.CostType?.CostTypeDisplayName, costTypes.Select(ct => ct.CostTypeDisplayName).ToList(), x => x.CostType?.CostTypeDisplayName, 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, region, 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)); }
public static DNRUplandRegion Create() { var testRegion = DNRUplandRegion.CreateNewBlank(); testRegion.DNRUplandRegionName = MakeTestName("Test Region", 100); return(testRegion); }
private PartialViewResult ViewDeleteRegion(DNRUplandRegion dnrUplandRegion, ConfirmDialogFormViewModel viewModel) { var canDelete = !dnrUplandRegion.HasDependentObjects(); var confirmMessage = canDelete ? $"Are you sure you want to delete this {FieldDefinition.DNRUplandRegion.FieldDefinitionDisplayName} '{dnrUplandRegion.DNRUplandRegionName}'?" : ConfirmDialogFormViewData.GetStandardCannotDeleteMessage($"<p>Washington State Department of Natural Resources has six upland region offices that help to provide localized services throughout Washington.</p>", SitkaRoute <DNRUplandRegionController> .BuildLinkFromExpression(x => x.Detail(dnrUplandRegion), "here")); var viewData = new ConfirmDialogFormViewData(confirmMessage, canDelete); return(RazorPartialView <ConfirmDialogForm, ConfirmDialogFormViewData, ConfirmDialogFormViewModel>(viewData, viewModel)); }
public ViewResult Index() { var layerGeoJsons = new List <LayerGeoJson> { DNRUplandRegion.GetRegionWmsLayerGeoJson("#59ACFF", 0.2m, LayerInitialVisibility.Show) }; var mapInitJson = new MapInitJson("regionIndex", 10, layerGeoJsons, BoundingBox.MakeNewDefaultBoundingBox()); var firmaPage = FirmaPage.GetFirmaPageByPageType(FirmaPageType.RegionsList); var viewData = new IndexViewData(CurrentPerson, mapInitJson, firmaPage); return(RazorView <Index, IndexViewData>(viewData)); }