public JsonResult AcreBasedCalculations(StormwaterJurisdictionPrimaryKey jurisdictionPrimaryKey) { var jurisdiction = jurisdictionPrimaryKey.EntityObject; var trashGeneratingUnits = HttpRequestStorage.DatabaseEntities.TrashGeneratingUnits.Include(x => x.LandUseBlock).Where(x => x.StormwaterJurisdictionID == jurisdiction.StormwaterJurisdictionID && x.LandUseBlock != null).ToList(); var fullTrashCapture = trashGeneratingUnits.FullTrashCaptureAcreage(); var equivalentArea = trashGeneratingUnits.EquivalentAreaAcreage(); var totalAcresCaptured = fullTrashCapture + equivalentArea; var totalPLUAcres = jurisdiction.LandUseBlocks .Where(x => x.PriorityLandUseTypeID != PriorityLandUseType.ALU.PriorityLandUseTypeID && x.PermitTypeID == PermitType.PhaseIMS4.PermitTypeID).Sum(x => x.LandUseBlockGeometry.Area * DbSpatialHelper.SquareMetersToAcres) ?? 0; var percentTreated = totalPLUAcres != 0 ? totalAcresCaptured / totalPLUAcres : 0; return(Json(new AreaBasedAcreCalculationsSimple { FullTrashCaptureAcreage = fullTrashCapture, EquivalentAreaAcreage = equivalentArea, TotalAcresCaptured = totalAcresCaptured, TotalPLUAcres = totalPLUAcres, PercentTreated = percentTreated }, JsonRequestBehavior.AllowGet)); }
public JsonResult OVTABasedResultsCalculations(StormwaterJurisdictionPrimaryKey jurisdictionPrimaryKey) { var jurisdiction = jurisdictionPrimaryKey.EntityObject; var trashGeneratingUnits = HttpRequestStorage.DatabaseEntities.TrashGeneratingUnits.Include(x => x.LandUseBlock).Where(x => x.StormwaterJurisdictionID == jurisdiction.StormwaterJurisdictionID && x.LandUseBlock != null).ToList(); var sumPLUAcresWhereOVTAIsA = trashGeneratingUnits.PriorityOVTAScoreAAcreage(); var sumPLUAcrexsWhereOVTAIsB = trashGeneratingUnits.PriorityOVTAScoreBAcreage(); var sumPLUAcrexsWhereOVTAIsC = trashGeneratingUnits.PriorityOVTAScoreCAcreage(); var sumPLUAcrexsWhereOVTAIsD = trashGeneratingUnits.PriorityOVTAScoreDAcreage(); var sumALUAcresWhereOVTAIsA = trashGeneratingUnits.AlternateOVTAScoreAAcreage(); var sumALUAcresWhereOVTAIsB = trashGeneratingUnits.AlternateOVTAScoreBAcreage(); var sumALUAcresWhereOVTAIsC = trashGeneratingUnits.AlternateOVTAScoreCAcreage(); var sumALUAcresWhereOVTAIsD = trashGeneratingUnits.AlternateOVTAScoreDAcreage(); return(Json(new OVTAResultsSimple { PLUSumAcresWhereOVTAIsA = sumPLUAcresWhereOVTAIsA, PLUSumAcresWhereOVTAIsB = sumPLUAcrexsWhereOVTAIsB, PLUSumAcresWhereOVTAIsC = sumPLUAcrexsWhereOVTAIsC, PLUSumAcresWhereOVTAIsD = sumPLUAcrexsWhereOVTAIsD, ALUSumAcresWhereOVTAIsA = sumALUAcresWhereOVTAIsA, ALUSumAcresWhereOVTAIsB = sumALUAcresWhereOVTAIsB, ALUSumAcresWhereOVTAIsC = sumALUAcresWhereOVTAIsC, ALUSumAcresWhereOVTAIsD = sumALUAcresWhereOVTAIsD }, JsonRequestBehavior.AllowGet)); }
public PartialViewResult Edit(StormwaterJurisdictionPrimaryKey jurisdictionPrimaryKey) { var jurisdiction = jurisdictionPrimaryKey.EntityObject; var viewModel = new EditViewModel(jurisdiction); return(ViewEdit(viewModel)); }
public ViewResult Detail(StormwaterJurisdictionPrimaryKey stormwaterJurisdictionPrimaryKey) { var stormwaterJurisdiction = stormwaterJurisdictionPrimaryKey.EntityObject; var viewData = new DetailViewData(CurrentPerson, stormwaterJurisdiction); return(RazorView <Detail, DetailViewData>(viewData)); }
public ActionResult Edit(StormwaterJurisdictionPrimaryKey jurisdictionPrimaryKey, EditViewModel viewModel) { var jurisdiction = jurisdictionPrimaryKey.EntityObject; if (!ModelState.IsValid) { return(ViewEdit(viewModel)); } viewModel.UpdateModel(jurisdiction, CurrentPerson); return(new ModalDialogFormJsonResult()); }
public JsonResult LoadBasedResultsCalculations(StormwaterJurisdictionPrimaryKey jurisdictionPrimaryKey) { var jurisdiction = jurisdictionPrimaryKey.EntityObject; var viaFullCapture = TrashGeneratingUnitHelper.LoadBasedFullCapture(jurisdiction); var viaPartialCapture = TrashGeneratingUnitHelper.LoadBasedPartialCapture(jurisdiction); var viaOVTAs = TrashGeneratingUnitHelper.LoadBasedOVTAProgressScores(jurisdiction); var totalAchieved = viaFullCapture + viaPartialCapture + viaOVTAs; var targetLoadReduction = TrashGeneratingUnitHelper.TargetLoadReduction(jurisdiction); return(Json(new LoadResultsSimple { LoadFullCapture = viaFullCapture, LoadPartialCapture = viaPartialCapture, LoadOVTA = viaOVTAs, TotalAchieved = totalAchieved, TargetLoadReduction = targetLoadReduction }, JsonRequestBehavior.AllowGet)); }
public GridJsonNetJObjectResult <vTreatmentBMPDetailed> JurisdictionTreatmentBMPGridJsonData(StormwaterJurisdictionPrimaryKey stormwaterJurisdictionPrimaryKey) { var stormwaterJurisdiction = stormwaterJurisdictionPrimaryKey.EntityObject; var treatmentBMPs = GetJurisdictionTreatmentBMPsAndGridSpec(out var gridSpec, CurrentPerson, stormwaterJurisdiction); var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <vTreatmentBMPDetailed>(treatmentBMPs, gridSpec); return(gridJsonNetJObjectResult); }