コード例 #1
0
        public DetailViewData(Person currentPerson,
                              Models.PerformanceMeasure performanceMeasure,
                              PerformanceMeasureChartViewData performanceMeasureChartViewData,
                              EntityNotesViewData entityNotesViewData,
                              bool userHasPerformanceMeasureManagePermissions) : base(currentPerson)
        {
            PageTitle  = performanceMeasure.PerformanceMeasureDisplayName;
            EntityName = "PerformanceMeasure Detail";

            PerformanceMeasure = performanceMeasure;
            PerformanceMeasureChartViewData = performanceMeasureChartViewData;
            EntityNotesViewData             = entityNotesViewData;
            UserHasPerformanceMeasureOverviewManagePermissions = userHasPerformanceMeasureManagePermissions;

            EditPerformanceMeasureUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(c => c.Edit(performanceMeasure));

            EditSubcategoriesAndOptionsUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(c => c.EditSubcategoriesAndOptions(performanceMeasure));

            EditCriticalDefinitionsUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(c => c.EditPerformanceMeasureRichText(performanceMeasure, EditRtfContent.PerformanceMeasureRichTextType.CriticalDefinitions));

            EditProjectReportingUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(c => c.EditPerformanceMeasureRichText(performanceMeasure, EditRtfContent.PerformanceMeasureRichTextType.ProjectReporting));

            IndexUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(c => c.Index());

            var associatePerformanceMeasureTaxonomyLevel = MultiTenantHelpers.GetAssociatePerformanceMeasureTaxonomyLevel();

            TaxonomyTierDisplayNamePluralized = associatePerformanceMeasureTaxonomyLevel.GetFieldDefinition().GetFieldDefinitionLabelPluralized();
            UserHasTaxonomyTierPerformanceMeasureManagePermissions = new TaxonomyTierPerformanceMeasureManageFeature().HasPermission(currentPerson, performanceMeasure).HasPermission;
            EditTaxonomyTiersUrl = SitkaRoute <TaxonomyTierPerformanceMeasureController> .BuildUrlFromExpression(c => c.Edit(performanceMeasure));

            RelatedTaxonomyTiersViewData = new RelatedTaxonomyTiersViewData(performanceMeasure, associatePerformanceMeasureTaxonomyLevel, true);

            PerformanceMeasureReportedValuesGridSpec = new PerformanceMeasureReportedValuesGridSpec(performanceMeasure)
            {
                ObjectNameSingular  = $"{Models.FieldDefinition.ReportedValue.GetFieldDefinitionLabel()} for {Models.FieldDefinition.Project.GetFieldDefinitionLabel()}",
                ObjectNamePlural    = $"{Models.FieldDefinition.ReportedValue.GetFieldDefinitionLabelPluralized()} for {Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()}",
                SaveFiltersInCookie = true
            };

            PerformanceMeasureReportedValuesGridName    = "performanceMeasuresReportedValuesFromPerformanceMeasureGrid";
            PerformanceMeasureReportedValuesGridDataUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(tc => tc.PerformanceMeasureReportedValuesGridJsonData(performanceMeasure));

            PerformanceMeasureExpectedGridSpec = new PerformanceMeasureExpectedGridSpec(performanceMeasure)
            {
                ObjectNameSingular  = $"{Models.FieldDefinition.ExpectedValue.GetFieldDefinitionLabel()} for {Models.FieldDefinition.Project.GetFieldDefinitionLabel()}",
                ObjectNamePlural    = $"{Models.FieldDefinition.ExpectedValue.GetFieldDefinitionLabelPluralized()} for {Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()}",
                SaveFiltersInCookie = true
            };

            PerformanceMeasureExpectedsGridName    = "performanceMeasuresExpectedValuesFromPerformanceMeasureGrid";
            PerformanceMeasureExpectedsGridDataUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(tc => tc.PerformanceMeasureExpectedsGridJsonData(performanceMeasure));
        }
コード例 #2
0
        public DetailViewData(FirmaSession currentFirmaSession,
                              ProjectFirmaModels.Models.PerformanceMeasure performanceMeasure,
                              PerformanceMeasureChartViewData performanceMeasureChartViewData,
                              EntityNotesViewData entityNotesViewData,
                              bool userHasPerformanceMeasureManagePermissions, bool isAdmin) : base(currentFirmaSession)
        {
            PageTitle  = performanceMeasure.PerformanceMeasureDisplayName;
            EntityName = "PerformanceMeasure Detail";

            PerformanceMeasure = performanceMeasure;
            PerformanceMeasureChartViewData = performanceMeasureChartViewData;
            EntityNotesViewData             = entityNotesViewData;
            UserHasPerformanceMeasureOverviewManagePermissions = userHasPerformanceMeasureManagePermissions;
            IsAdmin = isAdmin;

            EditPerformanceMeasureUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(c => c.Edit(performanceMeasure));

            EditSubcategoriesAndOptionsUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(c => c.EditSubcategoriesAndOptions(performanceMeasure));

            var performanceMeasuresExternallySourced = HttpRequestStorage.Tenant.ArePerformanceMeasuresExternallySourced;

            CanEditImportanceAndAdditionalInformation = !performanceMeasuresExternallySourced;
            EditImportanceUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(c => c.EditPerformanceMeasureRichText(performanceMeasure, EditRtfContent.PerformanceMeasureRichTextType.Importance));

            EditAdditionalInformationUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(c => c.EditPerformanceMeasureRichText(performanceMeasure, EditRtfContent.PerformanceMeasureRichTextType.AdditionalInformation));

            EditCriticalDefinitionsUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(c => c.EditPerformanceMeasureRichText(performanceMeasure, EditRtfContent.PerformanceMeasureRichTextType.CriticalDefinitions));

            EditProjectReportingUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(c => c.EditPerformanceMeasureRichText(performanceMeasure, EditRtfContent.PerformanceMeasureRichTextType.ProjectReporting));

            IndexUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(c => c.Index());

            var associatePerformanceMeasureTaxonomyLevel = MultiTenantHelpers.GetAssociatePerformanceMeasureTaxonomyLevel();

            TaxonomyTierDisplayNamePluralized = associatePerformanceMeasureTaxonomyLevel.GetFieldDefinition().GetFieldDefinitionLabelPluralized();
            UserHasTaxonomyTierPerformanceMeasureManagePermissions = new TaxonomyTierPerformanceMeasureManageFeature().HasPermission(currentFirmaSession, performanceMeasure).HasPermission;
            EditTaxonomyTiersUrl = SitkaRoute <TaxonomyTierPerformanceMeasureController> .BuildUrlFromExpression(c => c.Edit(performanceMeasure));

            RelatedTaxonomyTiersViewData = new RelatedTaxonomyTiersViewData(performanceMeasure, associatePerformanceMeasureTaxonomyLevel, true);

            // Hide GeoSpatialArea panel on tenants where performance measures are externally sourced
            ShowGeoSpatialAreaPanel = !performanceMeasuresExternallySourced;
            CanAddGeospatialArea    = new GeospatialAreaPerformanceMeasureTargetManageFeature().HasPermissionByFirmaSession(currentFirmaSession);

            PerformanceMeasureReportedValuesGridSpec = new PerformanceMeasureReportedValuesGridSpec(performanceMeasure)
            {
                ObjectNameSingular  = $"{FieldDefinitionEnum.ReportedValue.ToType().GetFieldDefinitionLabel()} for {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()}",
                ObjectNamePlural    = $"{FieldDefinitionEnum.ReportedValue.ToType().GetFieldDefinitionLabelPluralized()} for {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()}",
                SaveFiltersInCookie = true
            };

            PerformanceMeasureReportedValuesGridName    = "performanceMeasuresReportedValuesFromPerformanceMeasureGrid";
            PerformanceMeasureReportedValuesGridDataUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(tc => tc.PerformanceMeasureReportedValuesGridJsonData(performanceMeasure));

            PerformanceMeasureExpectedGridSpec = new PerformanceMeasureExpectedGridSpec(performanceMeasure)
            {
                ObjectNameSingular  = $"{FieldDefinitionEnum.ExpectedValue.ToType().GetFieldDefinitionLabel()} for {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()}",
                ObjectNamePlural    = $"{FieldDefinitionEnum.ExpectedValue.ToType().GetFieldDefinitionLabelPluralized()} for {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()}",
                SaveFiltersInCookie = true
            };

            PerformanceMeasureExpectedsGridName    = "performanceMeasuresExpectedValuesFromPerformanceMeasureGrid";
            PerformanceMeasureExpectedsGridDataUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(tc => tc.PerformanceMeasureExpectedsGridJsonData(performanceMeasure));

            GeospatialAreaPerformanceMeasureTargetGridSpec = new GeospatialAreaPerformanceMeasureTargetGridSpec(currentFirmaSession, performanceMeasure)
            {
                ObjectNameSingular  = $"{FieldDefinitionEnum.GeospatialArea.ToType().GetFieldDefinitionLabel()} Target for {performanceMeasure.GetDisplayName()}",
                ObjectNamePlural    = $"{FieldDefinitionEnum.GeospatialArea.ToType().GetFieldDefinitionLabel()} Targets for {performanceMeasure.GetDisplayName()}",
                SaveFiltersInCookie = true
            };

            GeospatialAreaPerformanceMeasureTargetGridName    = "geospatialAreaPerformanceMeasuresTargetsGrid";
            GeospatialAreaPerformanceMeasureTargetGridDataUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(tc => tc.GeospatialAreaPerformanceMeasureTargetsGridJsonData(performanceMeasure));

            AddGeospatialAreaPerformanceMeasureTargetDialogTitle = $"Add {FieldDefinitionEnum.GeospatialArea.ToType().GetFieldDefinitionLabelPluralized()} to {performanceMeasure.GetDisplayName()}";
            AddGeospatialAreaPerformanceMeasureTargetText        = $"{BootstrapHtmlHelpers.MakeGlyphIcon("glyphicon-plus")} Add {FieldDefinitionEnum.GeospatialArea.ToType().GetFieldDefinitionLabel()}";
            AddGeospatialAreaPerformanceMeasureTargetUrl         = SitkaRoute <GeospatialAreaPerformanceMeasureTargetController> .BuildUrlFromExpression(x => x.AddGeospatialAreaToPerformanceMeasure(performanceMeasure));

            EditPerformanceMeasureTargetUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(pmc => pmc.EditPerformanceMeasureReportedValues(performanceMeasure));

            FieldDefinitionForPerformanceMeasure                  = FieldDefinitionEnum.PerformanceMeasure.ToType();
            FieldDefinitionForPerformanceMeasureType              = FieldDefinitionEnum.PerformanceMeasureType.ToType();
            FieldDefinitionForPerformanceMeasureSubcategory       = FieldDefinitionEnum.PerformanceMeasureSubcategory.ToType();
            FieldDefinitionForPerformanceMeasureSubcategoryOption = FieldDefinitionEnum.PerformanceMeasureSubcategoryOption.ToType();
            FieldDefinitionForProject = FieldDefinitionEnum.Project.ToType();
        }