Esempio n. 1
0
 public EditViewModel(ProjectFirmaModels.Models.TaxonomyTrunk taxonomyTrunk)
 {
     TaxonomyTrunkID          = taxonomyTrunk.TaxonomyTrunkID;
     TaxonomyTrunkName        = taxonomyTrunk.TaxonomyTrunkName;
     TaxonomyTrunkDescription = taxonomyTrunk.TaxonomyTrunkDescriptionHtmlString;
     ThemeColor = taxonomyTrunk.ThemeColor;
 }
Esempio n. 2
0
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public TaxonomyBranch(TaxonomyTrunk taxonomyTrunk, string taxonomyBranchName) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.TaxonomyBranchID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.TaxonomyTrunkID  = taxonomyTrunk.TaxonomyTrunkID;
     this.TaxonomyTrunk    = taxonomyTrunk;
     taxonomyTrunk.TaxonomyBranches.Add(this);
     this.TaxonomyBranchName = taxonomyBranchName;
 }
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public AttachmentTypeTaxonomyTrunk(AttachmentType attachmentType, TaxonomyTrunk taxonomyTrunk) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.AttachmentTypeTaxonomyTrunkID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.AttachmentTypeID = attachmentType.AttachmentTypeID;
     this.AttachmentType   = attachmentType;
     attachmentType.AttachmentTypeTaxonomyTrunks.Add(this);
     this.TaxonomyTrunkID = taxonomyTrunk.TaxonomyTrunkID;
     this.TaxonomyTrunk   = taxonomyTrunk;
     taxonomyTrunk.AttachmentTypeTaxonomyTrunks.Add(this);
 }
 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;
 }
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public MatchmakerOrganizationTaxonomyTrunk(Organization organization, TaxonomyTrunk taxonomyTrunk, bool isActive) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.MatchmakerOrganizationTaxonomyTrunkID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.OrganizationID = organization.OrganizationID;
     this.Organization   = organization;
     organization.MatchmakerOrganizationTaxonomyTrunks.Add(this);
     this.TaxonomyTrunkID = taxonomyTrunk.TaxonomyTrunkID;
     this.TaxonomyTrunk   = taxonomyTrunk;
     taxonomyTrunk.MatchmakerOrganizationTaxonomyTrunks.Add(this);
     this.IsActive = isActive;
 }
Esempio n. 6
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 ProjectTaxonomyViewData(ProjectFirmaModels.Models.TaxonomyTrunk taxonomyTrunk, TaxonomyLevel taxonomyLevel) : this(taxonomyTrunk, null, null, null, taxonomyLevel)
 {
 }
Esempio n. 8
0
 public void UpdateModel(ProjectFirmaModels.Models.TaxonomyTrunk taxonomyTrunk, FirmaSession currentFirmaSession)
 {
     taxonomyTrunk.TaxonomyTrunkName = TaxonomyTrunkName;
     taxonomyTrunk.TaxonomyTrunkDescriptionHtmlString = TaxonomyTrunkDescription;
     taxonomyTrunk.ThemeColor = ThemeColor;
 }
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static AttachmentTypeTaxonomyTrunk CreateNewBlank(AttachmentType attachmentType, TaxonomyTrunk taxonomyTrunk)
 {
     return(new AttachmentTypeTaxonomyTrunk(attachmentType, taxonomyTrunk));
 }
Esempio n. 10
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static TaxonomyBranch CreateNewBlank(TaxonomyTrunk taxonomyTrunk)
 {
     return(new TaxonomyBranch(taxonomyTrunk, default(string)));
 }
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static MatchmakerOrganizationTaxonomyTrunk CreateNewBlank(Organization organization, TaxonomyTrunk taxonomyTrunk)
 {
     return(new MatchmakerOrganizationTaxonomyTrunk(organization, taxonomyTrunk, default(bool)));
 }