Пример #1
0
        public EditProjectViewData(EditProjectType editProjectType,
                                   string taxonomyLeafDisplayName,
                                   IEnumerable <ProjectStage> projectStages,
                                   IEnumerable <ProjectFirmaModels.Models.Organization> organizations,
                                   IEnumerable <Person> primaryContactPeople,
                                   Person defaultPrimaryContactPerson,
                                   decimal?totalExpenditures,
                                   List <ProjectFirmaModels.Models.TaxonomyLeaf> taxonomyLeafs,
                                   IEnumerable <ProjectFirmaModels.Models.ProjectCustomAttributeType> projectCustomAttributeTypes,
                                   TenantAttribute tenantAttribute)
        {
            EditProjectType         = editProjectType;
            TaxonomyLeafDisplayName = taxonomyLeafDisplayName;
            TotalExpenditures       = totalExpenditures;
            ProjectStages           = projectStages.OrderBy(x => x.SortOrder).ToSelectListWithEmptyFirstRow(x => x.ProjectStageID.ToString(CultureInfo.InvariantCulture), y => y.ProjectStageDisplayName);
            ProjectStages           = projectStages.OrderBy(x => x.SortOrder).ToSelectListWithEmptyFirstRow(x => x.ProjectStageID.ToString(CultureInfo.InvariantCulture), y => y.ProjectStageDisplayName);
            Organizations           = organizations.ToSelectListWithEmptyFirstRow(x => x.OrganizationID.ToString(CultureInfo.InvariantCulture), y => y.GetDisplayName());
            PrimaryContactPeople    = primaryContactPeople.ToSelectListWithEmptyFirstRow(
                x => x.PersonID.ToString(CultureInfo.InvariantCulture), y => y.GetFullNameFirstLastAndOrgShortName(),
                $"<Set Based on {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()}'s Associated {FieldDefinitionEnum.Organization.ToType().GetFieldDefinitionLabelPluralized()}>");
            DefaultPrimaryContactPerson = defaultPrimaryContactPerson;
            TaxonomyLeafs = taxonomyLeafs.ToGroupedSelectList();
            PlanningDesignStartYearRange    = FirmaDateUtilities.YearsForUserInput().ToSelectListWithEmptyFirstRow(x => x.CalendarYear.ToString(CultureInfo.InvariantCulture), x => x.CalendarYearDisplay).ToList();
            ImplementationStartYearRange    = FirmaDateUtilities.YearsForUserInput().ToSelectListWithEmptyFirstRow(x => x.CalendarYear.ToString(CultureInfo.InvariantCulture), x => x.CalendarYearDisplay).ToList();
            CompletionYearRange             = FirmaDateUtilities.YearsForUserInput().ToSelectListWithEmptyFirstRow(x => x.CalendarYear.ToString(CultureInfo.InvariantCulture), x => x.CalendarYearDisplay).ToList();
            HasThreeTierTaxonomy            = MultiTenantHelpers.IsTaxonomyLevelTrunk();
            DefaultPrimaryContactPersonName = DefaultPrimaryContactPerson != null?DefaultPrimaryContactPerson.GetFullNameFirstLastAndOrgShortName() : "nobody";

            ProjectCustomAttributeTypes = projectCustomAttributeTypes;
            TenantAttribute             = tenantAttribute;
            TenantUsesFiscalYears       = MultiTenantHelpers.UseFiscalYears();
        }
Пример #2
0
        private void AssignParameters(IEnumerable <ProjectFirmaModels.Models.TaxonomyLeaf> taxonomyLeafs,
                                      IEnumerable <FundingType> fundingTypes,
                                      TenantAttribute tenantAttribute)
        {
            TaxonomyLeafs = taxonomyLeafs.ToList().OrderTaxonomyLeaves().ToList().ToGroupedSelectList();

            FundingTypes = fundingTypes.ToSelectList(x => x.FundingTypeID.ToString(CultureInfo.InvariantCulture), y => y.FundingTypeDisplayName);
            PlanningDesignStartYearRange = FirmaDateUtilities.YearsForUserInput().ToSelectListWithEmptyFirstRow(x => x.CalendarYear.ToString(CultureInfo.InvariantCulture), x => x.CalendarYearDisplay).ToList();
            ImplementationStartYearRange = FirmaDateUtilities.YearsForUserInput().ToSelectListWithEmptyFirstRow(x => x.CalendarYear.ToString(CultureInfo.InvariantCulture), x => x.CalendarYearDisplay).ToList();
            CompletionYearRange          = FirmaDateUtilities.YearsForUserInput().ToSelectListWithEmptyFirstRow(x => x.CalendarYear.ToString(CultureInfo.InvariantCulture), x => x.CalendarYearDisplay).ToList();
            HasCanStewardProjectsOrganizationRelationship = MultiTenantHelpers.HasCanStewardProjectsOrganizationRelationship();

            HasThreeTierTaxonomy = MultiTenantHelpers.IsTaxonomyLevelTrunk();

            var pagetitle = ShowProjectStageDropDown ? $"Add {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()}" : $"Propose {FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()}";

            PageTitle = $"{pagetitle}";
            if (ProjectDisplayName != null)
            {
                PageTitle += $": {ProjectDisplayName}";
            }

            TenantAttribute       = tenantAttribute;
            TenantUsesFiscalYears = MultiTenantHelpers.UseFiscalYears();
        }
        public EditProjectViewData(EditProjectType editProjectType,
                                   string projectTypeDisplayName,
                                   IEnumerable <ProjectStage> projectStages,
                                   IEnumerable <Models.Organization> organizations,
                                   IEnumerable <Person> primaryContactPeople,
                                   Person defaultPrimaryContactPerson,
                                   decimal?totalExpenditures,
                                   List <Models.ProjectType> projectTypes,
                                   IEnumerable <Models.FocusArea> focusAreas,
                                   bool projectTypeHasBeenSet,
                                   List <ProgramSimple> allPrograms,
                                   int projectID)
        {
            EditProjectTypeIntroductoryText = editProjectType.IntroductoryText;
            ProjectTypeDisplayName          = projectTypeDisplayName;
            TotalExpenditures = totalExpenditures;
            ProjectStages     = projectStages.OrderBy(x => x.SortOrder).ToSelectListWithEmptyFirstRow(x => x.ProjectStageID.ToString(CultureInfo.InvariantCulture), y => y.ProjectStageDisplayName);

            Organizations        = organizations.ToSelectListWithEmptyFirstRow(x => x.OrganizationID.ToString(CultureInfo.InvariantCulture), y => y.DisplayName);
            PrimaryContactPeople = primaryContactPeople.ToSelectListWithEmptyFirstRow(
                x => x.PersonID.ToString(CultureInfo.InvariantCulture), y => y.FullNameFirstLastAndOrgShortName,
                $"<Set Based on {Models.FieldDefinition.Project.GetFieldDefinitionLabel()}'s Associated {Models.FieldDefinition.Organization.GetFieldDefinitionLabelPluralized()}>");
            ProjectTypes                    = projectTypes.ToGroupedSelectList();
            StartYearRange                  = FirmaDateUtilities.YearsForUserInput().ToSelectListWithEmptyFirstRow(x => x.CalendarYear.ToString(CultureInfo.InvariantCulture), x => x.CalendarYearDisplay);
            CompletionDateRange             = FirmaDateUtilities.YearsForUserInput().ToSelectListWithEmptyFirstRow(x => x.CalendarYear.ToString(CultureInfo.InvariantCulture), x => x.CalendarYearDisplay);
            HasThreeTierTaxonomy            = MultiTenantHelpers.IsTaxonomyLevelTrunk();
            DefaultPrimaryContactPersonName = defaultPrimaryContactPerson?.FullNameFirstLastAndOrgShortName ?? "nobody";
            FocusAreas            = focusAreas.OrderBy(x => x.FocusAreaName).ToSelectListWithEmptyFirstRow(x => x.FocusAreaID.ToString(CultureInfo.InvariantCulture), y => y.FocusAreaName);
            ProjectTypeHasBeenSet = projectTypeHasBeenSet;
            AllPrograms           = allPrograms;
            ProjectID             = projectID;
        }
Пример #4
0
        private void AssignParameters(IEnumerable <Models.ProjectType> projectTypes)
        {
            ProjectTypes = projectTypes.ToList().OrderTaxonomyLeaves().ToList().ToGroupedSelectList();


            StartYearRange =
                FirmaDateUtilities.YearsForUserInput()
                .ToSelectListWithEmptyFirstRow(x => x.CalendarYear.ToString(CultureInfo.InvariantCulture), x => x.CalendarYearDisplay);
            CompletionDateRange = FirmaDateUtilities.YearsForUserInput().ToSelectListWithEmptyFirstRow(x => x.CalendarYear.ToString(CultureInfo.InvariantCulture), x => x.CalendarYearDisplay);
            HasCanStewardProjectsOrganizationRelationship = MultiTenantHelpers.HasCanStewardProjectsOrganizationRelationship();

            HasThreeTierTaxonomy = MultiTenantHelpers.IsTaxonomyLevelTrunk();

            var pagetitle = ShowProjectStageDropDown ? $"Add {Models.FieldDefinition.Project.GetFieldDefinitionLabel()}" : $"{Models.FieldDefinition.Application.GetFieldDefinitionLabel()}";

            PageTitle = $"{pagetitle}";
            if (ProjectDisplayName != null)
            {
                PageTitle += $": {ProjectDisplayName}";
            }
        }
Пример #5
0
        public BasicsViewData(FirmaSession currentFirmaSession
                              , ProjectFirmaModels.Models.ProjectUpdate projectUpdate,
                              IEnumerable <ProjectStage> projectStages
                              , ProjectUpdateStatus projectUpdateStatus,
                              BasicsValidationResult basicsValidationResult)
            : base(currentFirmaSession, projectUpdate.ProjectUpdateBatch, projectUpdateStatus, basicsValidationResult.GetWarningMessages(), ProjectUpdateSection.Basics.ProjectUpdateSectionDisplayName)
        {
            ProjectUpdate                = projectUpdate;
            TaxonomyLeafDisplayName      = projectUpdate.ProjectUpdateBatch.Project.TaxonomyLeaf.GetDisplayName();
            ProjectStages                = projectStages.OrderBy(x => x.SortOrder).ToSelectListWithEmptyFirstRow(x => x.ProjectStageID.ToString(CultureInfo.InvariantCulture), y => y.ProjectStageDisplayName);
            ProjectStagesModels          = projectStages;
            PlanningDesignStartYearRange = FirmaDateUtilities.YearsForUserInput().ToSelectListWithEmptyFirstRow(x => x.CalendarYear.ToString(CultureInfo.InvariantCulture), x => x.CalendarYearDisplay).ToList();
            ImplementationStartYearRange = FirmaDateUtilities.YearsForUserInput().ToSelectListWithEmptyFirstRow(x => x.CalendarYear.ToString(CultureInfo.InvariantCulture), x => x.CalendarYearDisplay).ToList();
            CompletionYearRange          = FirmaDateUtilities.YearsForUserInput().ToSelectListWithEmptyFirstRow(x => x.CalendarYear.ToString(CultureInfo.InvariantCulture), x => x.CalendarYearDisplay).ToList();
            RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshBasics(Project));

            DiffUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.DiffBasics(Project));

            SectionCommentsViewData          = new SectionCommentsViewData(projectUpdate.ProjectUpdateBatch.BasicsComment, projectUpdate.ProjectUpdateBatch.IsReturned());
            StartYearForTotalCostCalculation = projectUpdate.StartYearForTotalCostCalculations();
            TenantUsesFiscalYears            = MultiTenantHelpers.UseFiscalYears();
        }
Пример #6
0
        public BasicsViewData(Person currentPerson, Models.ProjectUpdate projectUpdate,
                              IEnumerable <ProjectStage> projectStages, UpdateStatus updateStatus,
                              BasicsValidationResult basicsValidationResult,
                              IEnumerable <Models.ProjectCustomAttributeType> projectCustomAttributeTypes, List <Models.FocusArea> focusAreas)
            : base(currentPerson, projectUpdate.ProjectUpdateBatch, updateStatus, basicsValidationResult.GetWarningMessages(), ProjectUpdateSection.Basics.ProjectUpdateSectionDisplayName)
        {
            ProjectUpdate          = projectUpdate;
            ProjectTypeDisplayName = projectUpdate.ProjectUpdateBatch.Project.ProjectType.DisplayName;
            ProjectStages          = projectStages.OrderBy(x => x.SortOrder).ToSelectListWithEmptyFirstRow(x => x.ProjectStageID.ToString(CultureInfo.InvariantCulture), y => y.ProjectStageDisplayName);
            FocusAreas             = focusAreas.OrderBy(x => x.FocusAreaName)
                                     .ToSelectListWithEmptyFirstRow(x => x.FocusAreaID.ToString(CultureInfo.InvariantCulture), y => y.FocusAreaName);
            PlannedDateRange             = FirmaDateUtilities.YearsForUserInput().ToSelectListWithEmptyFirstRow(x => x.CalendarYear.ToString(CultureInfo.InvariantCulture), x => x.CalendarYearDisplay);
            ImplementationStartYearRange = FirmaDateUtilities.YearsForUserInput().ToSelectListWithEmptyFirstRow(x => x.CalendarYear.ToString(CultureInfo.InvariantCulture), x => x.CalendarYearDisplay);
            CompletionDateRange          = FirmaDateUtilities.YearsForUserInput().ToSelectListWithEmptyFirstRow(x => x.CalendarYear.ToString(CultureInfo.InvariantCulture), x => x.CalendarYearDisplay);
            RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshBasics(Project));

            DiffUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.DiffBasics(Project));

            SectionCommentsViewData = new SectionCommentsViewData(projectUpdate.ProjectUpdateBatch.BasicsComment, projectUpdate.ProjectUpdateBatch.IsReturned);

            ProjectCustomAttributeTypes = projectCustomAttributeTypes;
        }