public DetailViewData(Person currentPerson, StormwaterJurisdiction stormwaterJurisdiction) : base(currentPerson, NeptuneArea.OCStormwaterTools) { StormwaterJurisdiction = stormwaterJurisdiction; PageTitle = stormwaterJurisdiction.GetOrganizationDisplayName(); EntityName = $"{FieldDefinitionType.Jurisdiction.GetFieldDefinitionLabelPluralized()}"; EntityUrl = SitkaRoute <JurisdictionController> .BuildUrlFromExpression(x => x.Index()); TreatmentBMPGridSpec = new TreatmentBMPGridSpec(currentPerson, false, false) { ObjectNameSingular = "Treatment BMP", ObjectNamePlural = $"Treatment BMPs for {stormwaterJurisdiction.GetOrganizationDisplayName()}", SaveFiltersInCookie = true }; TreatmentBMPGridName = "jurisdictionTreatmentBMPGrid"; TreatmentBMPGridDataUrl = SitkaRoute <JurisdictionController> .BuildUrlFromExpression(x => x.JurisdictionTreatmentBMPGridJsonData(stormwaterJurisdiction)); UsersAssignedToJurisdiction = StormwaterJurisdiction.PeopleWhoCanManageStormwaterJurisdictionExceptSitka().ToList(); UserHasJurisdictionEditPermissions = new NeptuneAdminFeature().HasPermissionByPerson(CurrentPerson); EditStormwaterJurisdictionLink = UserHasJurisdictionEditPermissions ? ModalDialogFormHelper.MakeEditIconLink(SitkaRoute <JurisdictionController> .BuildUrlFromExpression(c => c.Edit(stormwaterJurisdiction)), $"Edit Jurisdiction - {StormwaterJurisdiction.GetOrganizationDisplayName()}", true) : new HtmlString(string.Empty); }
private List <vTreatmentBMPDetailed> GetJurisdictionTreatmentBMPsAndGridSpec(out TreatmentBMPGridSpec gridSpec, Person currentPerson, StormwaterJurisdiction stormwaterJurisdiction) { gridSpec = new TreatmentBMPGridSpec(currentPerson, false, false); return(HttpRequestStorage.DatabaseEntities.vTreatmentBMPDetaileds.ToList() .Where(x => currentPerson.IsAssignedToStormwaterJurisdiction(x.StormwaterJurisdictionID) && x.StormwaterJurisdictionID == stormwaterJurisdiction.StormwaterJurisdictionID).ToList()); }