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)); }
public PartialViewResult DeleteRegion(DNRUplandRegionPrimaryKey dnrUplandRegionPrimaryKey) { var region = dnrUplandRegionPrimaryKey.EntityObject; var viewModel = new ConfirmDialogFormViewModel(region.DNRUplandRegionID); return(ViewDeleteRegion(region, viewModel)); }
public GridJsonNetJObjectResult <Project> ProjectsGridJsonData(DNRUplandRegionPrimaryKey dnrUplandRegionPrimaryKey) { var gridSpec = new BasicProjectInfoGridSpec(CurrentPerson, false); var projectRegions = dnrUplandRegionPrimaryKey.EntityObject.GetAssociatedProjects(CurrentPerson); var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <Project>(projectRegions, gridSpec); return(gridJsonNetJObjectResult); }
public ActionResult DeleteRegion(DNRUplandRegionPrimaryKey dnrUplandRegionPrimaryKey, ConfirmDialogFormViewModel viewModel) { var region = dnrUplandRegionPrimaryKey.EntityObject; if (!ModelState.IsValid) { return(ViewDeleteRegion(region, viewModel)); } region.DeleteFull(HttpRequestStorage.DatabaseEntities); return(new ModalDialogFormJsonResult()); }
public PartialViewResult MapTooltip(DNRUplandRegionPrimaryKey dnrUplandRegionPrimaryKey) { var viewData = new MapTooltipViewData(CurrentPerson, dnrUplandRegionPrimaryKey.EntityObject); return(RazorPartialView <MapTooltip, MapTooltipViewData>(viewData)); }