public IndexViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.FirmaPage firmaPage) : base(currentFirmaSession, firmaPage) { var taxonomyBranchDisplayNamePluralized = FieldDefinitionEnum.TaxonomyBranch.ToType().GetFieldDefinitionLabelPluralized(); PageTitle = taxonomyBranchDisplayNamePluralized; // if branch is the highest level, let them sort without groups OfferEditSortOrder = MultiTenantHelpers.IsTaxonomyLevelBranch(); // if it is a three tier taxonomy, let them sort grouped by taxonomy trunks OfferEditSortOrderInGroup = MultiTenantHelpers.IsTaxonomyLevelTrunk(); HasTaxonomyBranchManagePermissions = new TaxonomyBranchManageFeature().HasPermissionByFirmaSession(currentFirmaSession); IsNotTaxonomyLevelLeaf = !MultiTenantHelpers.IsTaxonomyLevelLeaf(); var taxonomyBranchDisplayName = FieldDefinitionEnum.TaxonomyBranch.ToType().GetFieldDefinitionLabel(); GridSpec = new IndexGridSpec(currentFirmaSession) { ObjectNameSingular = taxonomyBranchDisplayName, ObjectNamePlural = taxonomyBranchDisplayNamePluralized, SaveFiltersInCookie = true }; GridName = "taxonomyBranchesGrid"; GridDataUrl = SitkaRoute <TaxonomyBranchController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData()); NewUrl = SitkaRoute <TaxonomyBranchController> .BuildUrlFromExpression(t => t.New()); EditSortOrderUrl = SitkaRoute <TaxonomyBranchController> .BuildUrlFromExpression(tc => tc.EditSortOrder()); EditSortOrderInGroupUrl = SitkaRoute <TaxonomyBranchController> .BuildUrlFromExpression(tc => tc.EditSortOrderInGroup()); TaxonomyBranchDisplayName = taxonomyBranchDisplayName; }
public DetailViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.TaxonomyBranch taxonomyBranch, ProjectLocationsMapInitJson projectLocationsMapInitJson, ProjectLocationsMapViewData projectLocationsMapViewData, bool canHaveAssociatedPerformanceMeasures, RelatedPerformanceMeasuresViewData relatedPerformanceMeasuresViewData, List <PerformanceMeasureChartViewData> performanceMeasureChartViewDatas, TaxonomyLevel taxonomyLevel, List <ProjectCustomGridConfiguration> projectCustomDefaultGridConfigurations) : base(currentFirmaSession) { TaxonomyBranch = taxonomyBranch; ProjectLocationsMapViewData = projectLocationsMapViewData; ProjectLocationsMapInitJson = projectLocationsMapInitJson; PageTitle = taxonomyBranch.GetDisplayName(); var taxonomyBranchDisplayName = FieldDefinitionEnum.TaxonomyBranch.ToType().GetFieldDefinitionLabel(); TaxonomyBranchDisplayName = taxonomyBranchDisplayName; TaxonomyBranchDisplayNamePluralized = FieldDefinitionEnum.TaxonomyBranch.ToType().GetFieldDefinitionLabelPluralized(); TaxonomyLeafDisplayNamePluralized = FieldDefinitionEnum.TaxonomyLeaf.ToType().GetFieldDefinitionLabelPluralized(); EntityName = taxonomyBranchDisplayName; ProjectMapFilteredUrl = ProjectLocationsMapInitJson.ProjectMapCustomization.GetCustomizedUrl(); UserHasTaxonomyBranchManagePermissions = new TaxonomyBranchManageFeature().HasPermissionByFirmaSession(currentFirmaSession); EditTaxonomyBranchUrl = SitkaRoute <TaxonomyBranchController> .BuildUrlFromExpression(c => c.Edit(taxonomyBranch.TaxonomyBranchID)); IndexUrl = SitkaRoute <ProgramInfoController> .BuildUrlFromExpression(c => c.Taxonomy()); 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 = "taxonomyBranchProjectListGrid"; ProjectCustomDefaultGridDataUrl = SitkaRoute <ProjectCustomGridController> .BuildUrlFromExpression(tc => tc.TaxonomyBranchProjectsGridJsonData(taxonomyBranch)); ProjectTaxonomyViewData = new ProjectTaxonomyViewData(taxonomyBranch, taxonomyLevel); CanHaveAssociatedPerformanceMeasures = canHaveAssociatedPerformanceMeasures; RelatedPerformanceMeasuresViewData = relatedPerformanceMeasuresViewData; PerformanceMeasureChartViewDatas = performanceMeasureChartViewDatas; EditChildrenSortOrderUrl = SitkaRoute <TaxonomyBranchController> .BuildUrlFromExpression(x => x.EditChildrenSortOrder(taxonomyBranch)); }
public DetailViewData(Person currentPerson, Models.TaxonomyBranch taxonomyBranch, ProjectLocationsMapInitJson projectLocationsMapInitJson, ProjectLocationsMapViewData projectLocationsMapViewData, bool canHaveAssociatedPerformanceMeasures, RelatedPerformanceMeasuresViewData relatedPerformanceMeasuresViewData, List <PerformanceMeasureChartViewData> performanceMeasureChartViewDatas, TaxonomyLevel taxonomyLevel) : base(currentPerson) { TaxonomyBranch = taxonomyBranch; ProjectLocationsMapViewData = projectLocationsMapViewData; ProjectLocationsMapInitJson = projectLocationsMapInitJson; PageTitle = taxonomyBranch.DisplayName; var taxonomyBranchDisplayName = Models.FieldDefinition.TaxonomyBranch.GetFieldDefinitionLabel(); TaxonomyBranchDisplayName = taxonomyBranchDisplayName; TaxonomyBranchDisplayNamePluralized = Models.FieldDefinition.TaxonomyBranch.GetFieldDefinitionLabelPluralized(); ProjectTypeDisplayNamePluralized = Models.FieldDefinition.ProjectType.GetFieldDefinitionLabelPluralized(); EntityName = taxonomyBranchDisplayName; ProjectMapFilteredUrl = ProjectLocationsMapInitJson.ProjectMapCustomization.GetCustomizedUrl(); UserHasTaxonomyBranchManagePermissions = new TaxonomyBranchManageFeature().HasPermissionByPerson(CurrentPerson); EditTaxonomyBranchUrl = SitkaRoute <TaxonomyBranchController> .BuildUrlFromExpression(c => c.Edit(taxonomyBranch.TaxonomyBranchID)); IndexUrl = SitkaRoute <ProgramInfoController> .BuildUrlFromExpression(c => c.Taxonomy()); BasicProjectInfoProjectGridName = "taxonomyBranchProjectListGrid"; BasicProjectInfoGridSpec = new BasicProjectInfoGridSpec(CurrentPerson, true) { ObjectNameSingular = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()} with this {taxonomyBranchDisplayName}", ObjectNamePlural = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()} with this {taxonomyBranchDisplayName}", SaveFiltersInCookie = true }; BasicProjectInfoProjectGridDataUrl = SitkaRoute <TaxonomyBranchController> .BuildUrlFromExpression(tc => tc.ProjectsGridJsonData(taxonomyBranch)); ProjectTaxonomyViewData = new ProjectTaxonomyViewData(taxonomyBranch, taxonomyLevel); CanHaveAssociatedPerformanceMeasures = canHaveAssociatedPerformanceMeasures; RelatedPerformanceMeasuresViewData = relatedPerformanceMeasuresViewData; PerformanceMeasureChartViewDatas = performanceMeasureChartViewDatas; EditChildrenSortOrderUrl = SitkaRoute <TaxonomyBranchController> .BuildUrlFromExpression(x => x.EditChildrenSortOrder(taxonomyBranch)); }