Exemplo n.º 1
0
        public DetailViewData(FirmaSession currentFirmaSession,
                              ProjectFirmaModels.Models.TaxonomyTrunk taxonomyTrunk,
                              ProjectLocationsMapInitJson projectLocationsMapInitJson,
                              ProjectLocationsMapViewData projectLocationsMapViewData, bool canHaveAssociatedPerformanceMeasures,
                              RelatedPerformanceMeasuresViewData relatedPerformanceMeasuresViewData,
                              List <PerformanceMeasureChartViewData> performanceMeasureChartViewDatas, TaxonomyLevel taxonomyLevel,
                              List <ProjectCustomGridConfiguration> projectCustomDefaultGridConfigurations) : base(currentFirmaSession)
        {
            TaxonomyTrunk                       = taxonomyTrunk;
            TaxonomyTrunkDisplayName            = FieldDefinitionEnum.TaxonomyTrunk.ToType().GetFieldDefinitionLabel();
            TaxonomyTrunkDisplayNamePluralized  = FieldDefinitionEnum.TaxonomyTrunk.ToType().GetFieldDefinitionLabelPluralized();
            TaxonomyBranchDisplayNamePluralized = FieldDefinitionEnum.TaxonomyBranch.ToType().GetFieldDefinitionLabelPluralized();
            TaxonomyLeafDisplayNamePluralized   = FieldDefinitionEnum.TaxonomyLeaf.ToType().GetFieldDefinitionLabelPluralized();

            ProjectLocationsMapInitJson = projectLocationsMapInitJson;
            ProjectLocationsMapViewData = projectLocationsMapViewData;

            ProjectMapFilteredUrl = ProjectLocationsMapInitJson.ProjectMapCustomization.GetCustomizedUrl();

            PageTitle  = taxonomyTrunk.GetDisplayName();
            EntityName = TaxonomyTrunkDisplayName;
            IndexUrl   = SitkaRoute <ProgramInfoController> .BuildUrlFromExpression(c => c.Taxonomy());

            UserHasTaxonomyTrunkManagePermissions = new TaxonomyTrunkManageFeature().HasPermissionByFirmaSession(CurrentFirmaSession);
            UserHasProjectTaxonomyTrunkExpenditureManagePermissions = new TaxonomyTrunkManageFeature().HasPermissionByFirmaSession(CurrentFirmaSession);
            EditTaxonomyTrunkUrl = SitkaRoute <TaxonomyTrunkController> .BuildUrlFromExpression(c => c.Edit(taxonomyTrunk.TaxonomyTrunkID));

            TaxonomyBranchIndexUrl = SitkaRoute <TaxonomyBranchController> .BuildUrlFromExpression(c => c.Index());

            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    = "taxonomyTrunkProjectListGrid";
            ProjectCustomDefaultGridDataUrl = SitkaRoute <ProjectCustomGridController> .BuildUrlFromExpression(tc => tc.TaxonomyTrunkProjectsGridJsonData(taxonomyTrunk));

            ProjectTaxonomyViewData = new ProjectTaxonomyViewData(taxonomyTrunk, taxonomyLevel);

            CanHaveAssociatedPerformanceMeasures = canHaveAssociatedPerformanceMeasures;
            PerformanceMeasureChartViewDatas     = performanceMeasureChartViewDatas;
            RelatedPerformanceMeasuresViewData   = relatedPerformanceMeasuresViewData;

            EditChildrenSortOrderUrl = SitkaRoute <TaxonomyTrunkController> .BuildUrlFromExpression(x => x.EditChildrenSortOrder(taxonomyTrunk));
        }
        public DetailViewData(Person currentPerson,
                              Models.TaxonomyTrunk taxonomyTrunk,
                              ProjectLocationsMapInitJson projectLocationsMapInitJson,
                              ProjectLocationsMapViewData projectLocationsMapViewData, bool canHaveAssociatedPerformanceMeasures,
                              RelatedPerformanceMeasuresViewData relatedPerformanceMeasuresViewData,
                              List <PerformanceMeasureChartViewData> performanceMeasureChartViewDatas, TaxonomyLevel taxonomyLevel) : base(currentPerson)
        {
            TaxonomyTrunk                       = taxonomyTrunk;
            TaxonomyTrunkDisplayName            = Models.FieldDefinition.TaxonomyTrunk.GetFieldDefinitionLabel();
            TaxonomyTrunkDisplayNamePluralized  = Models.FieldDefinition.TaxonomyTrunk.GetFieldDefinitionLabelPluralized();
            TaxonomyBranchDisplayNamePluralized = Models.FieldDefinition.TaxonomyBranch.GetFieldDefinitionLabelPluralized();
            ProjectTypeDisplayNamePluralized    = Models.FieldDefinition.ProjectType.GetFieldDefinitionLabelPluralized();

            ProjectLocationsMapInitJson = projectLocationsMapInitJson;
            ProjectLocationsMapViewData = projectLocationsMapViewData;

            ProjectMapFilteredUrl = ProjectLocationsMapInitJson.ProjectMapCustomization.GetCustomizedUrl();

            PageTitle  = taxonomyTrunk.DisplayName;
            EntityName = TaxonomyTrunkDisplayName;
            IndexUrl   = SitkaRoute <ProgramInfoController> .BuildUrlFromExpression(c => c.Taxonomy());

            UserHasTaxonomyTrunkManagePermissions = new TaxonomyTrunkManageFeature().HasPermissionByPerson(CurrentPerson);
            UserHasProjectTaxonomyTrunkExpenditureManagePermissions = new TaxonomyTrunkManageFeature().HasPermissionByPerson(currentPerson);
            EditTaxonomyTrunkUrl = SitkaRoute <TaxonomyTrunkController> .BuildUrlFromExpression(c => c.Edit(taxonomyTrunk.TaxonomyTrunkID));

            TaxonomyBranchIndexUrl = SitkaRoute <TaxonomyBranchController> .BuildUrlFromExpression(c => c.Index());

            BasicProjectInfoGridName = "taxonomyTrunkProjectListGrid";
            BasicProjectInfoGridSpec = new BasicProjectInfoGridSpec(CurrentPerson, true)
            {
                ObjectNameSingular  = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()} with this {TaxonomyTrunkDisplayName}",
                ObjectNamePlural    = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()} with this {TaxonomyTrunkDisplayName}",
                SaveFiltersInCookie = true
            };

            BasicProjectInfoGridDataUrl = SitkaRoute <TaxonomyTrunkController> .BuildUrlFromExpression(tc => tc.ProjectsGridJsonData(taxonomyTrunk));

            ProjectTaxonomyViewData = new ProjectTaxonomyViewData(taxonomyTrunk, taxonomyLevel);

            CanHaveAssociatedPerformanceMeasures = canHaveAssociatedPerformanceMeasures;
            PerformanceMeasureChartViewDatas     = performanceMeasureChartViewDatas;
            RelatedPerformanceMeasuresViewData   = relatedPerformanceMeasuresViewData;

            EditChildrenSortOrderUrl = SitkaRoute <TaxonomyTrunkController> .BuildUrlFromExpression(x => x.EditChildrenSortOrder(taxonomyTrunk));
        }
        public DetailViewData(Person currentPerson,
                              Models.ProjectType projectType,
                              ProjectLocationsMapInitJson projectLocationsMapInitJson,
                              ProjectLocationsMapViewData projectLocationsMapViewData, bool canHaveAssociatedPerformanceMeasures,
                              RelatedPerformanceMeasuresViewData relatedPerformanceMeasuresViewData,
                              List <PerformanceMeasureChartViewData> performanceMeasureChartViewDatas, TaxonomyLevel taxonomyLevel) : base(currentPerson)
        {
            ProjectType = projectType;
            PageTitle   = projectType.DisplayName;
            var fieldDefinitionProjectType = Models.FieldDefinition.ProjectType;
            var projectTypeDisplayName     = fieldDefinitionProjectType.GetFieldDefinitionLabel();

            EntityName = projectTypeDisplayName;

            ProjectLocationsMapInitJson = projectLocationsMapInitJson;
            ProjectLocationsMapViewData = projectLocationsMapViewData;
            ProjectMapFilteredUrl       = ProjectLocationsMapInitJson.ProjectMapCustomization.GetCustomizedUrl();

            UserHasProjectTypeManagePermissions = new ProjectTypeManageFeature().HasPermissionByPerson(CurrentPerson);
            EditProjectTypeUrl = SitkaRoute <ProjectTypeController> .BuildUrlFromExpression(c => c.Edit(projectType));

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

            BasicProjectInfoGridName = "projectTypeProjectListGrid";
            BasicProjectInfoGridSpec = new BasicProjectInfoGridSpec(CurrentPerson, true)
            {
                ObjectNameSingular  = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()} with this {projectTypeDisplayName}",
                ObjectNamePlural    = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()} with this {projectTypeDisplayName}",
                SaveFiltersInCookie = true
            };

            BasicProjectInfoGridDataUrl = SitkaRoute <ProjectTypeController> .BuildUrlFromExpression(tc => tc.ProjectsGridJsonData(projectType));

            ProjectTaxonomyViewData = new ProjectTaxonomyViewData(projectType, taxonomyLevel);

            ProjectTypeDisplayName           = projectTypeDisplayName;
            ProjectTypeDisplayNamePluralized = fieldDefinitionProjectType.GetFieldDefinitionLabelPluralized();

            CanHaveAssociatedPerformanceMeasures = canHaveAssociatedPerformanceMeasures;
            PerformanceMeasureChartViewDatas     = performanceMeasureChartViewDatas;
            RelatedPerformanceMeasuresViewData   = relatedPerformanceMeasuresViewData;
        }
Exemplo n.º 4
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;
        }