示例#1
0
        public IndexViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.FirmaPage firmaPage) : base(currentFirmaSession, firmaPage)
        {
            var taxonomyLeafDisplayNamePluralized = FieldDefinitionEnum.TaxonomyLeaf.ToType().GetFieldDefinitionLabelPluralized();

            PageTitle = taxonomyLeafDisplayNamePluralized;

            // if leaf is the highest level, let them sort without groups
            OfferEditSortOrder = MultiTenantHelpers.IsTaxonomyLevelLeaf();
            // if it is a two or three tier taxonomy, let them sort grouped by taxonomy branches
            OfferEditSortOrderInGroup = !MultiTenantHelpers.IsTaxonomyLevelLeaf();

            var hasTaxonomyLeafManagePermissions = new TaxonomyLeafManageFeature().HasPermissionByFirmaSession(currentFirmaSession);
            var taxonomyLeafDisplayName          = FieldDefinitionEnum.TaxonomyLeaf.ToType().GetFieldDefinitionLabel();

            GridSpec = new IndexGridSpec(currentFirmaSession)
            {
                ObjectNameSingular  = taxonomyLeafDisplayName,
                ObjectNamePlural    = taxonomyLeafDisplayNamePluralized,
                SaveFiltersInCookie = true
            };

            GridName    = "taxonomyLeafsGrid";
            GridDataUrl = SitkaRoute <TaxonomyLeafController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData());

            EditSortOrderUrl = SitkaRoute <TaxonomyLeafController> .BuildUrlFromExpression(tc => tc.EditSortOrder());

            EditSortOrderInGroupUrl = SitkaRoute <TaxonomyLeafController> .BuildUrlFromExpression(tc => tc.EditSortOrderInGroup());

            HasTaxonomyLeafManagePermissions = hasTaxonomyLeafManagePermissions;
            NewUrl = SitkaRoute <TaxonomyLeafController> .BuildUrlFromExpression(t => t.New());

            TaxonomyLeafDisplayName = taxonomyLeafDisplayName;
        }
示例#2
0
        public DetailViewData(FirmaSession currentFirmaSession,
                              ProjectFirmaModels.Models.TaxonomyLeaf taxonomyLeaf,
                              ProjectLocationsMapInitJson primaryProjectLocationsMapInitJson,
                              ProjectLocationsMapInitJson secondaryProjectLocationsMapInitJson,
                              ProjectLocationsMapViewData primaryProjectLocationsMapViewData,
                              ProjectLocationsMapViewData secondaryProjectLocationsMapViewData,
                              bool canHaveAssociatedPerformanceMeasures,
                              RelatedPerformanceMeasuresViewData relatedPerformanceMeasuresViewData,
                              TaxonomyLevel taxonomyLevel,
                              TenantAttribute tenantAttribute,
                              IEnumerable <ProjectFirmaModels.Models.PerformanceMeasure> performanceMeasures,
                              Dictionary <int, PerformanceMeasureChartViewData> primaryPerformanceMeasureChartViewDataByPerformanceMeasure,
                              Dictionary <int, PerformanceMeasureChartViewData> secondaryPerformanceMeasureChartViewDataByPerformanceMeasure,
                              List <ProjectCustomGridConfiguration> projectCustomDefaultGridConfigurations) : base(currentFirmaSession)
        {
            TaxonomyLeaf = taxonomyLeaf;
            PageTitle    = taxonomyLeaf.GetDisplayName();
            var fieldDefinitionTaxonomyLeaf = FieldDefinitionEnum.TaxonomyLeaf;
            var taxonomyLeafDisplayName     = fieldDefinitionTaxonomyLeaf.ToType().GetFieldDefinitionLabel();

            EntityName = taxonomyLeafDisplayName;

            PrimaryProjectLocationsMapInitJson   = primaryProjectLocationsMapInitJson;
            PrimaryProjectLocationsMapViewData   = primaryProjectLocationsMapViewData;
            SecondaryProjectLocationsMapInitJson = secondaryProjectLocationsMapInitJson;
            SecondaryProjectLocationsMapViewData = secondaryProjectLocationsMapViewData;
            ProjectMapFilteredUrl = PrimaryProjectLocationsMapInitJson.ProjectMapCustomization.GetCustomizedUrl();

            UserHasTaxonomyLeafManagePermissions = new TaxonomyLeafManageFeature().HasPermissionByFirmaSession(currentFirmaSession);
            EditTaxonomyLeafUrl = SitkaRoute <TaxonomyLeafController> .BuildUrlFromExpression(c => c.Edit(taxonomyLeaf));

            IndexUrl = SitkaRoute <ProgramInfoController> .BuildUrlFromExpression(x => x.Taxonomy());

            SecondaryBasicProjectInfoGridName = "secondaryLeafProjectListGrid";
            BasicProjectInfoGridSpec          = new ProjectForTaxonomyLeafGridSpec(currentFirmaSession, true, taxonomyLeaf)
            {
                ObjectNameSingular  = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} with this {taxonomyLeafDisplayName}",
                ObjectNamePlural    = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()} with this {taxonomyLeafDisplayName}",
                SaveFiltersInCookie = true
            };

            SecondaryBasicProjectInfoGridDataUrl = SitkaRoute <TaxonomyLeafController> .BuildUrlFromExpression(tc => tc.SecondaryProjectsGridJsonData(taxonomyLeaf));

            ProjectTaxonomyViewData = new ProjectTaxonomyViewData(taxonomyLeaf, taxonomyLevel);

            var projectDetails = HttpRequestStorage.DatabaseEntities.vProjectDetails.ToDictionary(x => x.ProjectID);

            ProjectCustomDefaultGridSpec = new ProjectCustomGridSpec(currentFirmaSession, projectCustomDefaultGridConfigurations, ProjectCustomGridType.Default.ToEnum, projectDetails, currentFirmaSession.Tenant)
            {
                ObjectNameSingular = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()}", ObjectNamePlural = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()}", SaveFiltersInCookie = true
            };

            ProjectCustomDefaultGridName    = "taxonomyLeafProjectListGrid";
            ProjectCustomDefaultGridDataUrl = SitkaRoute <ProjectCustomGridController> .BuildUrlFromExpression(tc => tc.TaxonomyLeafProjectsGridJsonData(taxonomyLeaf));

            TaxonomyLeafDisplayName           = taxonomyLeafDisplayName;
            TaxonomyLeafDisplayNamePluralized = fieldDefinitionTaxonomyLeaf.ToType().GetFieldDefinitionLabelPluralized();

            CanHaveAssociatedPerformanceMeasures = canHaveAssociatedPerformanceMeasures;
            PerformanceMeasures = performanceMeasures;
            PrimaryPerformanceMeasureChartViewDataByPerformanceMeasure   = primaryPerformanceMeasureChartViewDataByPerformanceMeasure;
            SecondaryPerformanceMeasureChartViewDataByPerformanceMeasure = secondaryPerformanceMeasureChartViewDataByPerformanceMeasure;
            RelatedPerformanceMeasuresViewData = relatedPerformanceMeasuresViewData;

            TenantAttribute = tenantAttribute;
        }