Esempio n. 1
0
        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);
        }
 public StormwaterJurisdictionSimple(StormwaterJurisdiction stormwaterJurisdiction)
 {
     StormwaterJurisdictionID          = stormwaterJurisdiction.StormwaterJurisdictionID;
     StormwaterJurisdictionDisplayName = stormwaterJurisdiction.GetOrganizationDisplayName();
 }