예제 #1
0
 public EditViewModel(ProjectFirmaModels.Models.TaxonomyBranch taxonomyBranch)
 {
     TaxonomyBranchID          = taxonomyBranch.TaxonomyBranchID;
     TaxonomyBranchName        = taxonomyBranch.TaxonomyBranchName;
     TaxonomyBranchDescription = taxonomyBranch.TaxonomyBranchDescriptionHtmlString;
     TaxonomyTrunkID           = taxonomyBranch.TaxonomyTrunkID;
     ThemeColor = taxonomyBranch.ThemeColor;
 }
예제 #2
0
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public TaxonomyLeaf(TaxonomyBranch taxonomyBranch, string taxonomyLeafName) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.TaxonomyLeafID   = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.TaxonomyBranchID = taxonomyBranch.TaxonomyBranchID;
     this.TaxonomyBranch   = taxonomyBranch;
     taxonomyBranch.TaxonomyLeafs.Add(this);
     this.TaxonomyLeafName = taxonomyLeafName;
 }
예제 #3
0
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public PersonStewardTaxonomyBranch(Person person, TaxonomyBranch taxonomyBranch) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.PersonStewardTaxonomyBranchID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.PersonID = person.PersonID;
     this.Person   = person;
     person.PersonStewardTaxonomyBranches.Add(this);
     this.TaxonomyBranchID = taxonomyBranch.TaxonomyBranchID;
     this.TaxonomyBranch   = taxonomyBranch;
     taxonomyBranch.PersonStewardTaxonomyBranches.Add(this);
 }
예제 #4
0
 private ProjectTaxonomyViewData(ProjectFirmaModels.Models.TaxonomyTrunk taxonomyTrunk, ProjectFirmaModels.Models.TaxonomyBranch taxonomyBranch, ProjectFirmaModels.Models.TaxonomyLeaf taxonomyLeaf, ProjectFirmaModels.Models.Project project, TaxonomyLevel taxonomyLevel)
 {
     TaxonomyLeaf     = taxonomyLeaf;
     TaxonomyTrunk    = taxonomyTrunk;
     TaxonomyBranch   = taxonomyBranch;
     Project          = project;
     IsProject        = Project != null;
     IsTaxonomyLeaf   = TaxonomyLeaf != null && !IsProject;
     IsTaxonomyBranch = TaxonomyBranch != null && !IsTaxonomyLeaf && !IsProject;
     IsTaxonomyTrunk  = TaxonomyTrunk != null && !IsTaxonomyBranch && !IsTaxonomyLeaf && !IsProject;
     TaxonomyLevel    = taxonomyLevel;
 }
예제 #5
0
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public MatchmakerOrganizationTaxonomyBranch(Organization organization, TaxonomyBranch taxonomyBranch, bool isActive) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.MatchmakerOrganizationTaxonomyBranchID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.OrganizationID = organization.OrganizationID;
     this.Organization   = organization;
     organization.MatchmakerOrganizationTaxonomyBranches.Add(this);
     this.TaxonomyBranchID = taxonomyBranch.TaxonomyBranchID;
     this.TaxonomyBranch   = taxonomyBranch;
     taxonomyBranch.MatchmakerOrganizationTaxonomyBranches.Add(this);
     this.IsActive = isActive;
 }
예제 #6
0
        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));
        }
예제 #7
0
 public void UpdateModel(ProjectFirmaModels.Models.TaxonomyBranch taxonomyBranch, FirmaSession currentFirmaSession)
 {
     Check.Ensure(HttpRequestStorage.DatabaseEntities.TaxonomyTrunks.Any(), "No entries in TaxonomyTrunks; is something wrong with db?");
     taxonomyBranch.TaxonomyBranchName = TaxonomyBranchName;
     taxonomyBranch.TaxonomyBranchDescriptionHtmlString = TaxonomyBranchDescription;
     taxonomyBranch.TaxonomyTrunkID = MultiTenantHelpers.IsTaxonomyLevelTrunk()
         ? TaxonomyTrunkID
         : HttpRequestStorage.DatabaseEntities.TaxonomyTrunks.First().TaxonomyTrunkID; // really should only be one
     taxonomyBranch.ThemeColor = ThemeColor;
     if (!ModelObjectHelpers.IsRealPrimaryKeyValue(taxonomyBranch.TaxonomyBranchID))
     {
         // for new branches, set the sort order to greater than the current max for this trunk (or null if no branches have a sort order set)
         var maxSortOrder = HttpRequestStorage.DatabaseEntities.TaxonomyBranches
                            .Where(x => x.TaxonomyTrunkID == taxonomyBranch.TaxonomyTrunkID).Max(x => x.TaxonomyBranchSortOrder);
         taxonomyBranch.TaxonomyBranchSortOrder = maxSortOrder + 1;
     }
 }
예제 #8
0
 public ProjectTaxonomyViewData(ProjectFirmaModels.Models.TaxonomyBranch taxonomyBranch, TaxonomyLevel taxonomyLevel) : this(taxonomyBranch.TaxonomyTrunk, taxonomyBranch, null, null, taxonomyLevel)
 {
 }
예제 #9
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static PersonStewardTaxonomyBranch CreateNewBlank(Person person, TaxonomyBranch taxonomyBranch)
 {
     return(new PersonStewardTaxonomyBranch(person, taxonomyBranch));
 }
예제 #10
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static TaxonomyLeaf CreateNewBlank(TaxonomyBranch taxonomyBranch)
 {
     return(new TaxonomyLeaf(taxonomyBranch, default(string)));
 }
예제 #11
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static MatchmakerOrganizationTaxonomyBranch CreateNewBlank(Organization organization, TaxonomyBranch taxonomyBranch)
 {
     return(new MatchmakerOrganizationTaxonomyBranch(organization, taxonomyBranch, default(bool)));
 }