public ViewResult AddOrRemoveParcels( OnlandVisualTrashAssessmentPrimaryKey onlandVisualTrashAssessmentPrimaryKey) { var onlandVisualTrashAssessment = onlandVisualTrashAssessmentPrimaryKey.EntityObject; var parcelIDs = onlandVisualTrashAssessment.GetParcelIDsForAddOrRemoveParcels(); var viewModel = new AddOrRemoveParcelsViewModel(parcelIDs); return(ViewAddOrRemoveParcels(onlandVisualTrashAssessment, viewModel)); }
private ViewResult ViewAddOrRemoveParcels(OnlandVisualTrashAssessment onlandVisualTrashAssessment, AddOrRemoveParcelsViewModel viewModel) { var addOrRemoveParcelsMapIntJson = new AddOrRemoveParcelsMapIntJson("addOrRemoveParcelsMap", onlandVisualTrashAssessment.OnlandVisualTrashAssessmentObservations.MakeObservationsLayerGeoJson(), onlandVisualTrashAssessment.GetTransectLineLayerGeoJson()); var viewData = new AddOrRemoveParcelsViewData(CurrentPerson, OVTASection.AddOrRemoveParcels, onlandVisualTrashAssessment, addOrRemoveParcelsMapIntJson); return(RazorView <AddOrRemoveParcels, AddOrRemoveParcelsViewData, AddOrRemoveParcelsViewModel>(viewData, viewModel)); }
public ActionResult AddOrRemoveParcels( OnlandVisualTrashAssessmentPrimaryKey onlandVisualTrashAssessmentPrimaryKey, AddOrRemoveParcelsViewModel viewModel) { var onlandVisualTrashAssessment = onlandVisualTrashAssessmentPrimaryKey.EntityObject; if (!ModelState.IsValid) { return(ViewAddOrRemoveParcels(onlandVisualTrashAssessment, viewModel)); } var unionOfSelectedParcelGeometries = HttpRequestStorage.DatabaseEntities.Parcels .Where(x => viewModel.ParcelIDs.Contains(x.ParcelID)).Select(x => x.ParcelGeometry).ToList() .UnionListGeometries().FixSrid(CoordinateSystemHelper.NAD_83_HARN_CA_ZONE_VI_SRID); onlandVisualTrashAssessment.DraftGeometry = unionOfSelectedParcelGeometries; return(RedirectToAppropriateStep(viewModel, OVTASection.AddOrRemoveParcels, onlandVisualTrashAssessment)); }