public EditViewModel(Models.TaxonomyTrunk taxonomyTrunk) { TaxonomyTrunkID = taxonomyTrunk.TaxonomyTrunkID; TaxonomyTrunkName = taxonomyTrunk.TaxonomyTrunkName; TaxonomyTrunkDescription = taxonomyTrunk.TaxonomyTrunkDescriptionHtmlString; ThemeColor = taxonomyTrunk.ThemeColor; }
private ProjectTaxonomyViewData(Models.TaxonomyTrunk taxonomyTrunk, Models.TaxonomyBranch taxonomyBranch, Models.ProjectType projectType, Models.Project project, TaxonomyLevel taxonomyLevel) { ProjectType = projectType; TaxonomyTrunk = taxonomyTrunk; TaxonomyBranch = taxonomyBranch; Project = project; IsProject = Project != null; IsProjectType = ProjectType != null && !IsProject; IsTaxonomyBranch = TaxonomyBranch != null && !IsProjectType && !IsProject; IsTaxonomyTrunk = TaxonomyTrunk != null && !IsTaxonomyBranch && !IsProjectType && !IsProject; TaxonomyLevel = taxonomyLevel; }
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 ProjectTaxonomyViewData(Models.TaxonomyTrunk taxonomyTrunk, TaxonomyLevel taxonomyLevel) : this(taxonomyTrunk, null, null, null, taxonomyLevel) { }
public void UpdateModel(Models.TaxonomyTrunk taxonomyTrunk, Person currentPerson) { taxonomyTrunk.TaxonomyTrunkName = TaxonomyTrunkName; taxonomyTrunk.TaxonomyTrunkDescriptionHtmlString = TaxonomyTrunkDescription; taxonomyTrunk.ThemeColor = ThemeColor; }