public ViewResult Detail(OnlandVisualTrashAssessmentPrimaryKey onlandVisualTrashAssessmentPrimaryKey)
        {
            var onlandVisualTrashAssessment = onlandVisualTrashAssessmentPrimaryKey.EntityObject;

            Check.Assert(onlandVisualTrashAssessment.OnlandVisualTrashAssessmentStatus == OnlandVisualTrashAssessmentStatus.Complete, "No details are available for this assessment because it has not been completed.");

            var observationsLayerGeoJson   = onlandVisualTrashAssessment.OnlandVisualTrashAssessmentObservations.MakeObservationsLayerGeoJson();
            var assessmentAreaLayerGeoJson = onlandVisualTrashAssessment.GetAssessmentAreaLayerGeoJson(false);

            var transsectLineLayerGeoJson = onlandVisualTrashAssessment.GetTransectLineLayerGeoJson();

            var ovtaSummaryMapInitJson = new OVTASummaryMapInitJson("summaryMap", observationsLayerGeoJson, assessmentAreaLayerGeoJson, transsectLineLayerGeoJson);
            var returnToEditUrl        =
                SitkaRoute <OnlandVisualTrashAssessmentController> .BuildUrlFromExpression(x =>
                                                                                           x.EditStatusToAllowEdit(onlandVisualTrashAssessment));

            var userHasPermissionToReturnToEdit = new OnlandVisualTrashAssessmentEditStatusFeature().HasPermission(CurrentPerson, onlandVisualTrashAssessment).HasPermission;

            return(RazorView <Detail, DetailViewData>(new DetailViewData(CurrentPerson, onlandVisualTrashAssessment, new TrashAssessmentSummaryMapViewData(ovtaSummaryMapInitJson, onlandVisualTrashAssessment.OnlandVisualTrashAssessmentObservations, NeptuneWebConfiguration.ParcelMapServiceUrl), returnToEditUrl, userHasPermissionToReturnToEdit)));
        }
        public static HtmlString GetEditUrlForGrid(this OnlandVisualTrashAssessment onlandVisualTrashAssessment, Person currentPerson)
        {
            var userCanEdit = new OnlandVisualTrashAssessmentEditStatusFeature()
                              .HasPermission(currentPerson, onlandVisualTrashAssessment)
                              .HasPermission;

            if (!userCanEdit)
            {
                return(new HtmlString(Empty));
            }

            return(onlandVisualTrashAssessment.OnlandVisualTrashAssessmentStatus ==
                   OnlandVisualTrashAssessmentStatus.Complete
                ? ModalDialogFormHelper.ModalDialogFormLink("Return to Edit", GetEditStatusToAllowEditUrl(onlandVisualTrashAssessment),
                                                            $"Return to Edit On-land Visual Trash Assessment for {onlandVisualTrashAssessment.OnlandVisualTrashAssessmentArea.OnlandVisualTrashAssessmentAreaName}",
                                                            500, "Continue", "Cancel", new List <string> {
                "gridButton"
            },
                                                            null, null) : DhtmlxGridHtmlHelpers.MakeEditIconAsHyperlinkBootstrap(GetEditUrl(onlandVisualTrashAssessment)));
        }