public SpendingByOrganizationTypeByOrganizationViewData(TenantAttribute tenantAttribute, List <OrganizationType> organizationTypes, List <ProjectFirmaModels.Models.ProjectFundingSourceExpenditure> projectFundingSourceExpenditures, List <TaxonomyTier> taxonomyTiers)
        {
            OrganizationTypes = organizationTypes;
            ProjectFundingSourceExpenditures = projectFundingSourceExpenditures;
            TaxonomyTiers           = taxonomyTiers;
            TaxonomyTierDisplayName = TaxonomyTierHelpers.GetFieldDefinitionForTaxonomyLevel(tenantAttribute.TaxonomyLevel).GetFieldDefinitionLabel();

            ProjectFundingSourceExpendituresByTaxonomyTierID = ProjectFundingSourceExpenditures.GroupBy(x => {
                switch (tenantAttribute.TaxonomyLevel.ToEnum)
                {
                case TaxonomyLevelEnum.Trunk:
                    return(x.Project.GetTaxonomyLeaf().TaxonomyBranch.TaxonomyTrunkID);

                case TaxonomyLevelEnum.Branch:
                    return(x.Project.GetTaxonomyLeaf().TaxonomyBranchID);

                case TaxonomyLevelEnum.Leaf:
                    return(x.Project.GetTaxonomyLeaf().TaxonomyLeafID);

                default:
                    throw new ArgumentOutOfRangeException();
                }
            })
                                                               .ToDictionary(x => x.Key, x => x.ToList() as IEnumerable <ProjectFirmaModels.Models.ProjectFundingSourceExpenditure>);
        }
Пример #2
0
 public DetailViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.Tenant tenant, TenantAttribute tenantAttribute,
                       string editBasicsUrl, string editBoundingBoxUrl, string deleteTenantStyleSheetFileResourceUrl,
                       string deleteTenantSquareLogoFileResourceUrl, string deleteTenantBannerLogoFileResourceUrl,
                       string editBoundingBoxFormID, MapInitJson mapInitJson, DetailGridSpec gridSpec, string gridName,
                       string gridDataUrl, string editClassificationSystemsUrl, string editStylesheetUrl, string editTenantLogoUrl, string costTypes)
     : base(currentFirmaSession)
 {
     PageTitle                             = "Tenant Configuration";
     Tenant                                = tenant;
     TenantAttribute                       = tenantAttribute;
     EditBasicsUrl                         = editBasicsUrl;
     EditBoundingBoxUrl                    = editBoundingBoxUrl;
     EditClassificationSystemsUrl          = editClassificationSystemsUrl;
     EditStylesheetUrl                     = editStylesheetUrl;
     EditTenantLogoUrl                     = editTenantLogoUrl;
     PrimaryContactRoute                   = tenantAttribute.PrimaryContactPerson != null ? new SitkaRoute <UserController>(c => c.Detail(tenantAttribute.PrimaryContactPersonID)) : null;
     UserHasTenantManagePermissions        = new SitkaAdminFeature().HasPermissionByFirmaSession(currentFirmaSession);
     DeleteTenantStyleSheetFileResourceUrl = deleteTenantStyleSheetFileResourceUrl;
     DeleteTenantSquareLogoFileResourceUrl = deleteTenantSquareLogoFileResourceUrl;
     DeleteTenantBannerLogoFileResourceUrl = deleteTenantBannerLogoFileResourceUrl;
     IsCurrentTenant                       = HttpRequestStorage.Tenant == tenant;
     EditBoundingBoxFormID                 = editBoundingBoxFormID;
     MapInitJson                           = mapInitJson;
     GridSpec                              = gridSpec;
     GridName                              = gridName;
     GridDataUrl                           = gridDataUrl;
     UsesCostTypes                         = tenantAttribute.BudgetTypeID == BudgetType.AnnualBudgetByCostType.BudgetTypeID;
     CostTypes                             = costTypes;
 }
Пример #3
0
 public EditBasicsViewModel(ProjectFirmaModels.Models.Tenant tenant, TenantAttribute tenantAttribute)
 {
     TenantID = tenant.TenantID;
     ShowLeadImplementerLogoOnFactSheet         = tenantAttribute.ShowLeadImplementerLogoOnFactSheet;
     ShowPhotoCreditOnFactSheet                 = tenantAttribute.ShowPhotoCreditOnFactSheet;
     ShowExpectedPerformanceMeasuresOnFactSheet = tenantAttribute.ShowExpectedPerformanceMeasuresOnFactSheet;
 }
Пример #4
0
        public EditBoundingBoxViewModel(TenantAttribute tenantAttribute)
        {
            TenantID = tenantAttribute.TenantID;

            if (tenantAttribute.DefaultBoundingBox != null)
            {
                var defaultBoundingBoxBoundary = tenantAttribute.DefaultBoundingBox.Boundary;
                var southWest = defaultBoundingBoxBoundary.PointAt(1);
                var northEast = defaultBoundingBoxBoundary.PointAt(3);

                if (northEast.YCoordinate != null)
                {
                    North = (decimal)northEast.YCoordinate;
                }
                if (southWest.YCoordinate != null)
                {
                    South = (decimal)southWest.YCoordinate;
                }
                if (northEast.XCoordinate != null)
                {
                    East = (decimal)northEast.XCoordinate;
                }
                if (southWest.XCoordinate != null)
                {
                    West = (decimal)southWest.XCoordinate;
                }
            }
        }
Пример #5
0
        /// <summary>
        /// Sends a notification to all the primary contacts for the given tenant's projects.
        /// </summary>
        /// <param name="projectsForTenant"></param>
        /// <param name="reminderSubject"></param>
        /// <param name="introContent"></param>
        /// <param name="notifyOnAll"></param>
        /// <param name="attribute"></param>
        private List <Notification> RunNotifications(IEnumerable <Project> projectsForTenant, string reminderSubject,
                                                     string introContent, TenantAttribute attribute)
        {
            // Constrain to tenant boundaries.
            var toolDisplayName     = attribute.ToolDisplayName;
            var contactSupportEmail = attribute.PrimaryContactPerson.Email;
            var toolLogo            = attribute.TenantSquareLogoFileResourceInfo;
            var tenantID            = attribute.TenantID;

            var projectUpdateNotificationHelper = new ProjectUpdateNotificationHelper(contactSupportEmail, introContent, reminderSubject, toolLogo, toolDisplayName, tenantID);

            var projectsToNotifyOn = projectsForTenant.AsQueryable().GetUpdatableProjectsThatHaveNotBeenSubmittedForBackgroundJob(tenantID);

            var projectsGroupedByPrimaryContact =
                projectsToNotifyOn.Where(x => x.GetPrimaryContact() != null).GroupBy(x => x.GetPrimaryContact())
                .ToList();

            var notifications = projectsGroupedByPrimaryContact
                                .SelectMany(x => projectUpdateNotificationHelper.SendProjectUpdateReminderMessage(x)).ToList();

            var message =
                $"Reminder emails sent to {projectsGroupedByPrimaryContact.Count} {FieldDefinitionEnum.ProjectPrimaryContact.ToType().GetFieldDefinitionLabelPluralized()} for {projectsGroupedByPrimaryContact.Count} projects requiring an update.";

            Logger.Info(message);

            return(notifications);
        }
Пример #6
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();
        }
Пример #7
0
        public AccomplishmentsDashboardViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.FirmaPage firmaPage, TenantAttribute tenantAttribute,
                                                List <ProjectFirmaModels.Models.Organization> organizations, List <int> calendarYears, int defaultBeginYear, int defaultEndYear,
                                                List <TaxonomyTier> taxonomyTiers, TaxonomyLevel associatePerformanceMeasureTaxonomyLevel) : base(currentFirmaSession, firmaPage)
        {
            var accomplishmentsDashboardOrganizationTypeName = FieldDefinitionEnum.ProjectStewardOrganizationDisplayName
                                                               .ToType().GetFieldDefinitionLabelPluralized();

            PageTitle        = "Accomplishments Dashboard";
            TenantAttribute  = tenantAttribute;
            Organizations    = organizations;
            CalendarYears    = calendarYears;
            DefaultBeginYear = defaultBeginYear;
            DefaultEndYear   = defaultEndYear;
            TaxonomyTiers    = taxonomyTiers;
            ParticipatingOrganizationsUrl = SitkaRoute <ResultsController> .BuildUrlFromExpression(x => x.ParticipatingOrganizations(UrlTemplate.Parameter1Int));

            OrganizationDashboardSummaryUrl = SitkaRoute <ResultsController> .BuildUrlFromExpression(x => x.OrganizationDashboardSummary(UrlTemplate.Parameter1Int));

            OrganizationAccomplishmentsUrl = SitkaRoute <ResultsController> .BuildUrlFromExpression(x => x.OrganizationAccomplishments(UrlTemplate.Parameter1Int, UrlTemplate.Parameter2Int));

            OrganizationDetailUrl = SitkaRoute <OrganizationController> .BuildUrlFromExpression(x => x.Detail(UrlTemplate.Parameter1Int, null));

            SpendingByOrganizationTypeAndOrganizationUrl = SitkaRoute <ResultsController> .BuildUrlFromExpression(x => x.SpendingByOrganizationTypeByOrganization(UrlTemplate.Parameter1Int, UrlTemplate.Parameter2Int, UrlTemplate.Parameter3Int));

            AccomplishmentsDashboardOrganizationTypeName = accomplishmentsDashboardOrganizationTypeName;
            TaxonomyTierDisplayName              = associatePerformanceMeasureTaxonomyLevel.GetFieldDefinition().GetFieldDefinitionLabel();
            HasSitkaAdminPermissions             = new SitkaAdminFeature().HasPermissionByFirmaSession(currentFirmaSession);
            ConfigureAccomplishmentsDashboardUrl = SitkaRoute <ResultsController> .BuildUrlFromExpression(c => c.ConfigureAccomplishmentsDashboard());
        }
Пример #8
0
        public void UpdateModel(TenantAttribute tenantAttribute, FirmaSession currentFirmaSession)
        {
            tenantAttribute.TenantShortDisplayName              = TenantShortDisplayName;
            tenantAttribute.ToolDisplayName                     = ToolDisplayName;
            tenantAttribute.ShowProposalsToThePublic            = ShowProposalsToThePublic.GetValueOrDefault();
            tenantAttribute.EnableAccomplishmentsDashboard      = EnableAccomplishmentsDashboard;
            tenantAttribute.EnableSecondaryProjectTaxonomyLeaf  = EnableSecondaryProjectTaxonomyLeaf;
            tenantAttribute.CanManageCustomAttributes           = CanManageCustomAttributes;
            tenantAttribute.ExcludeTargetedFundingOrganizations = ExcludeTargetedFundingOrganizations;
            tenantAttribute.GoogleAnalyticsTrackingCode         = GoogleAnalyticsTrackingCode;
            tenantAttribute.UseProjectTimeline                  = UseProjectTimeline;
            tenantAttribute.GeoServerNamespace                  = GeoServerNamespace;
            tenantAttribute.EnableProjectCategories             = EnableProjectCategories;

            Person primaryContactPerson = null;

            if (PrimaryContactPersonID != null)
            {
                primaryContactPerson = HttpRequestStorage.DatabaseEntities.People.GetPerson(PrimaryContactPersonID.Value);
            }
            tenantAttribute.PrimaryContactPerson = primaryContactPerson;
            tenantAttribute.TaxonomyLevelID      = TaxonomyLevelID ?? ModelObjectHelpers.NotYetAssignedID;
            tenantAttribute.AssociatePerfomanceMeasureTaxonomyLevelID = AssociatePerfomanceMeasureTaxonomyLevelID ?? ModelObjectHelpers.NotYetAssignedID;
            tenantAttribute.MinimumYear  = MinimumYear ?? 0;
            tenantAttribute.BudgetTypeID = BudgetTypeID;

            tenantAttribute.ProjectExternalDataSourceEnabled = ProjectExternalDataSourceEnabled ?? false;
            tenantAttribute.EnableEvaluations = EnableProjectEvaluations;
            tenantAttribute.EnableReports     = EnableReports;
            tenantAttribute.EnableMatchmaker  = EnableMatchmaker;
            tenantAttribute.AreGeospatialAreasExternallySourced = AreGeospatialAreasExternallySourced;
        }
Пример #9
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();
        }
Пример #10
0
 public EditBasicsViewModel(ProjectFirmaModels.Models.Tenant tenant, TenantAttribute tenantAttribute)
 {
     TenantID = tenant.TenantID;
     TenantShortDisplayName = tenantAttribute.TenantShortDisplayName;
     ToolDisplayName        = tenantAttribute.ToolDisplayName;
     PrimaryContactPersonID = tenantAttribute.PrimaryContactPersonID;
     TaxonomyLevelID        = tenantAttribute.TaxonomyLevelID;
     AssociatePerfomanceMeasureTaxonomyLevelID = tenantAttribute.AssociatePerfomanceMeasureTaxonomyLevelID;
     MinimumYear  = tenantAttribute.MinimumYear;
     BudgetTypeID = tenantAttribute.BudgetTypeID;
     ProjectExternalDataSourceEnabled    = tenantAttribute.ProjectExternalDataSourceEnabled;
     ShowProposalsToThePublic            = tenantAttribute.ShowProposalsToThePublic;
     EnableAccomplishmentsDashboard      = tenantAttribute.EnableAccomplishmentsDashboard;
     EnableSecondaryProjectTaxonomyLeaf  = tenantAttribute.EnableSecondaryProjectTaxonomyLeaf;
     CanManageCustomAttributes           = tenantAttribute.CanManageCustomAttributes;
     ExcludeTargetedFundingOrganizations = tenantAttribute.ExcludeTargetedFundingOrganizations;
     GoogleAnalyticsTrackingCode         = tenantAttribute.GoogleAnalyticsTrackingCode;
     UseProjectTimeline                  = tenantAttribute.UseProjectTimeline;
     EnableStatusUpdates                 = tenantAttribute.EnableStatusUpdates;
     EnableProjectEvaluations            = tenantAttribute.EnableEvaluations;
     GeoServerNamespace                  = tenantAttribute.GeoServerNamespace;
     EnableProjectCategories             = tenantAttribute.EnableProjectCategories;
     EnableReports                       = tenantAttribute.EnableReports;
     EnableMatchmaker                    = tenantAttribute.EnableMatchmaker;
     AreGeospatialAreasExternallySourced = tenantAttribute.AreGeospatialAreasExternallySourced;
     TrackAccomplishments                = tenantAttribute.TrackAccomplishments;
     EnableSolicitations                 = tenantAttribute.EnableSolicitations;
 }
Пример #11
0
        public void UpdateModel(TenantAttribute tenantAttribute, FirmaSession currentFirmaSession, DatabaseEntities databaseEntities)
        {
            var attributeTenantStyleSheetFileResource = tenantAttribute.TenantStyleSheetFileResourceInfo;

            tenantAttribute.TenantStyleSheetFileResourceInfo = FileResourceModelExtensions.CreateNewFromHttpPostedFileAndSave(TenantStyleSheetFileResourceData, currentFirmaSession);
            attributeTenantStyleSheetFileResource?.FileResourceData.Delete(databaseEntities);
            attributeTenantStyleSheetFileResource?.Delete(databaseEntities);
        }
 public ConfigureAccomplishmentsDashboardViewModel(TenantAttribute tenantAttribute)
 {
     AccomplishmentsButtonTextHtmlString = tenantAttribute.AccomplishmentsDashboardAccomplishmentsButtonTextHtmlString;
     ExpendituresButtonTextHtmlString    = tenantAttribute.AccomplishmentsDashboardExpendituresButtonTextHtmlString;
     OrganizationsButtonTextHtmlString   = tenantAttribute.AccomplishmentsDashboardOrganizationsButtonTextHtmlString;
     FundingDisplayTypeID             = tenantAttribute.AccomplishmentsDashboardFundingDisplayTypeID;
     IncludeReportingOrganizationType = tenantAttribute.AccomplishmentsDashboardIncludeReportingOrganizationType;
     RelationshipTypetoIncludeID      = MultiTenantHelpers.GetOrganizationRelationshipTypeToReportInAccomplishmentsDashboard()?.OrganizationRelationshipTypeID;
 }
Пример #13
0
 public BasicsViewData(FirmaSession currentFirmaSession, IEnumerable <FundingType> fundingTypes,
                       IEnumerable <ProjectFirmaModels.Models.TaxonomyLeaf> taxonomyLeafs, bool showProjectStageDropDown, string instructionsPageUrl,
                       TenantAttribute tenantAttribute)
     : base(currentFirmaSession, ProjectCreateSection.Basics.ProjectCreateSectionDisplayName, instructionsPageUrl)
 {
     // This constructor is only used for the case where we're coming from the instructions, so we hide the dropdown if they clicked the button for proposing a new project.
     ShowProjectStageDropDown = showProjectStageDropDown;
     AssignParameters(taxonomyLeafs, fundingTypes, tenantAttribute);
 }
Пример #14
0
 public ManageViewData(FirmaSession currentFirmaSession,
                       ProjectFirmaModels.Models.FirmaPage firmaPage, ViewPageContentViewData factSheetCustomTextViewData,
                       string editFactSheetCustomTextUrl, string deleteFactSheetLogoFileResourceUrl, string editFactSheetLogoUrl, string editBasicsUrl, TenantAttribute tenantAttribute) : base(currentFirmaSession, firmaPage)
 {
     PageTitle = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} Fact Sheets";
     FactSheetCustomTextViewData        = factSheetCustomTextViewData;
     EditFactSheetCustomTextUrl         = editFactSheetCustomTextUrl;
     DeleteFactSheetLogoFileResourceUrl = deleteFactSheetLogoFileResourceUrl;
     TenantAttribute      = tenantAttribute;
     EditFactSheetLogoUrl = editFactSheetLogoUrl;
     EditBasicsUrl        = editBasicsUrl;
 }
Пример #15
0
        public ProjectBasicsViewData(ProjectFirmaModels.Models.Project project,
                                     bool userHasProjectBudgetManagePermissions, TaxonomyLevel taxonomyLevel, TenantAttribute tenantAttribute)
        {
            Project = project;
            UserHasProjectBudgetManagePermissions = userHasProjectBudgetManagePermissions;
            IsNotTaxonomyLevelLeaf         = !MultiTenantHelpers.IsTaxonomyLevelLeaf();
            IsNotTaxonomyLevelLeafOrBranch = !MultiTenantHelpers.IsTaxonomyLevelBranch() && IsNotTaxonomyLevelLeaf;
            ProjectTaxonomyViewData        = new ProjectTaxonomyViewData(project, taxonomyLevel);
            TenantAttribute = tenantAttribute;

            if (tenantAttribute.EnableSecondaryProjectTaxonomyLeaf)
            {
                SecondaryTaxonomyLeaves = Project.SecondaryProjectTaxonomyLeafs.Select(x => x.TaxonomyLeaf).OrderBy(x => x.GetDisplayName());
            }
        }
Пример #16
0
 public BasicsViewData(FirmaSession currentFirmaSession,
                       ProjectFirmaModels.Models.Project project,
                       ProposalSectionsStatus proposalSectionsStatus,
                       IEnumerable <ProjectFirmaModels.Models.TaxonomyLeaf> taxonomyLeafs,
                       IEnumerable <FundingType> fundingTypes,
                       TenantAttribute tenantAttribute)
     : base(currentFirmaSession, project, ProjectCreateSection.Basics.ProjectCreateSectionDisplayName, proposalSectionsStatus)
 {
     ShowCommentsSection = project.IsPendingApproval() || (project.BasicsComment != null &&
                                                           project.ProjectApprovalStatus == ProjectApprovalStatus.Returned);
     CanEditComments          = project.IsPendingApproval() && new ProjectEditAsAdminRegardlessOfStageFeature().HasPermission(currentFirmaSession, project).HasPermission;
     ShowProjectStageDropDown = project.ProjectStage != ProjectStage.Proposal;
     ProjectDisplayName       = project.GetDisplayName();
     AssignParameters(taxonomyLeafs, fundingTypes, tenantAttribute);
 }
Пример #17
0
        public BiOpAnnualReportViewData(FirmaSession currentFirmaSession,
                                        ProjectFirmaModels.Models.FirmaPage firmaPage,
                                        TenantAttribute tenantAttribute,
                                        List <GeospatialAreaType> geoSpatialAreasToInclude,
                                        List <ProjectFirmaModels.Models.PerformanceMeasure> performanceMeasuresToInclude)
            : base(currentFirmaSession, firmaPage)
        {
            PageTitle = "BiOp Annual Report";

            BiOpAnnualReportGridSpec = new BiOpAnnualReportGridSpec(geoSpatialAreasToInclude, performanceMeasuresToInclude, GridOutputFormat.Html)
            {
                ObjectNameSingular  = "Report Row",
                ObjectNamePlural    = "Report Rows",
                SaveFiltersInCookie = true
            };

            BiOpAnnualReportGridName    = "BiOpAnnualReportGrid";
            BiOpAnnualReportGridDataUrl = SitkaRoute <ResultsController> .BuildUrlFromExpression(c => c.BiOpAnnualReportGridJsonData());

            BiOpAnnualReportFullGridDownloadUrl = SitkaRoute <ResultsController> .BuildUrlFromExpression(c => c.BiOpAnnualReportGridExcelDownload());
        }
Пример #18
0
 public void UpdateModel(TenantAttribute tenantAttribute, FirmaSession currentFirmaSession)
 {
     tenantAttribute.ShowLeadImplementerLogoOnFactSheet = ShowLeadImplementerLogoOnFactSheet;
     tenantAttribute.ShowPhotoCreditOnFactSheet         = ShowPhotoCreditOnFactSheet;
 }
Пример #19
0
        public DetailViewData(FirmaSession currentFirmaSession,
                              ProjectFirmaModels.Models.TaxonomyLeaf taxonomyLeaf,
                              ProjectLocationsMapInitJson primaryProjectLocationsMapInitJson,
                              ProjectLocationsMapInitJson secondaryProjectLocationsMapInitJson,
                              ProjectLocationsMapViewData primaryProjectLocationsMapViewData,
                              ProjectLocationsMapViewData secondaryProjectLocationsMapViewData,
                              bool canHaveAssociatedPerformanceMeasures,
                              RelatedPerformanceMeasuresViewData relatedPerformanceMeasuresViewData,
                              TaxonomyLevel taxonomyLevel,
                              TenantAttribute tenantAttribute,
                              IEnumerable <ProjectFirmaModels.Models.PerformanceMeasure> performanceMeasures,
                              Dictionary <int, PerformanceMeasureChartViewData> primaryPerformanceMeasureChartViewDataByPerformanceMeasure,
                              Dictionary <int, PerformanceMeasureChartViewData> secondaryPerformanceMeasureChartViewDataByPerformanceMeasure,
                              List <ProjectCustomGridConfiguration> projectCustomDefaultGridConfigurations) : base(currentFirmaSession)
        {
            TaxonomyLeaf = taxonomyLeaf;
            PageTitle    = taxonomyLeaf.GetDisplayName();
            var fieldDefinitionTaxonomyLeaf = FieldDefinitionEnum.TaxonomyLeaf;
            var taxonomyLeafDisplayName     = fieldDefinitionTaxonomyLeaf.ToType().GetFieldDefinitionLabel();

            EntityName = taxonomyLeafDisplayName;

            PrimaryProjectLocationsMapInitJson   = primaryProjectLocationsMapInitJson;
            PrimaryProjectLocationsMapViewData   = primaryProjectLocationsMapViewData;
            SecondaryProjectLocationsMapInitJson = secondaryProjectLocationsMapInitJson;
            SecondaryProjectLocationsMapViewData = secondaryProjectLocationsMapViewData;
            ProjectMapFilteredUrl = PrimaryProjectLocationsMapInitJson.ProjectMapCustomization.GetCustomizedUrl();

            UserHasTaxonomyLeafManagePermissions = new TaxonomyLeafManageFeature().HasPermissionByFirmaSession(currentFirmaSession);
            EditTaxonomyLeafUrl = SitkaRoute <TaxonomyLeafController> .BuildUrlFromExpression(c => c.Edit(taxonomyLeaf));

            IndexUrl = SitkaRoute <ProgramInfoController> .BuildUrlFromExpression(x => x.Taxonomy());

            SecondaryBasicProjectInfoGridName = "secondaryLeafProjectListGrid";
            BasicProjectInfoGridSpec          = new ProjectForTaxonomyLeafGridSpec(currentFirmaSession, true, taxonomyLeaf)
            {
                ObjectNameSingular  = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} with this {taxonomyLeafDisplayName}",
                ObjectNamePlural    = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()} with this {taxonomyLeafDisplayName}",
                SaveFiltersInCookie = true
            };

            SecondaryBasicProjectInfoGridDataUrl = SitkaRoute <TaxonomyLeafController> .BuildUrlFromExpression(tc => tc.SecondaryProjectsGridJsonData(taxonomyLeaf));

            ProjectTaxonomyViewData = new ProjectTaxonomyViewData(taxonomyLeaf, taxonomyLevel);

            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    = "taxonomyLeafProjectListGrid";
            ProjectCustomDefaultGridDataUrl = SitkaRoute <ProjectCustomGridController> .BuildUrlFromExpression(tc => tc.TaxonomyLeafProjectsGridJsonData(taxonomyLeaf));

            TaxonomyLeafDisplayName           = taxonomyLeafDisplayName;
            TaxonomyLeafDisplayNamePluralized = fieldDefinitionTaxonomyLeaf.ToType().GetFieldDefinitionLabelPluralized();

            CanHaveAssociatedPerformanceMeasures = canHaveAssociatedPerformanceMeasures;
            PerformanceMeasures = performanceMeasures;
            PrimaryPerformanceMeasureChartViewDataByPerformanceMeasure   = primaryPerformanceMeasureChartViewDataByPerformanceMeasure;
            SecondaryPerformanceMeasureChartViewDataByPerformanceMeasure = secondaryPerformanceMeasureChartViewDataByPerformanceMeasure;
            RelatedPerformanceMeasuresViewData = relatedPerformanceMeasuresViewData;

            TenantAttribute = tenantAttribute;
        }
Пример #20
0
        private PartialViewResult ViewEditBoundingBox(EditBoundingBoxViewModel viewModel, TenantAttribute tenantAttribute)
        {
            var boundingBoxLayer = new LayerGeoJson("Bounding Box",
                                                    new FeatureCollection(new List <TenantAttribute> {
                tenantAttribute
            }
                                                                          .Select(x => DbGeometryToGeoJsonHelper.FromDbGeometry(x.DefaultBoundingBox)).ToList()),
                                                    FirmaHelpers.DefaultColorRange[0],
                                                    0.8m,
                                                    LayerInitialVisibility.LayerInitialVisibilityEnum.Show);
            var mapInitJson = new MapInitJson("TenantEditBoundingBoxMap", 10, MapInitJson.GetConfiguredGeospatialAreaMapLayers(), MapInitJson.GetExternalMapLayers(), BoundingBox.MakeBoundingBoxFromLayerGeoJsonList(new List <LayerGeoJson> {
                boundingBoxLayer
            }));
            var editBoundingBoxUrl = new SitkaRoute <TenantController>(c => c.EditBoundingBox()).BuildUrlFromExpression();

            var viewData = new EditBoundingBoxViewData(mapInitJson, editBoundingBoxUrl, EditBoundingBoxFormID);

            return(RazorPartialView <EditBoundingBox, EditBoundingBoxViewData, EditBoundingBoxViewModel>(viewData, viewModel));
        }
Пример #21
0
 public ProjectTypeSelectionViewData(TenantAttribute tenantAttribute)
 {
     TenantAttribute = tenantAttribute;
 }
Пример #22
0
        private PartialViewResult ViewDeleteTenantStyleSheetFileResource(ConfirmDialogFormViewModel viewModel, TenantAttribute tenantAttribute)
        {
            var confirmMessage = $"Are you sure you want to delete Tenant Style Sheet for {tenantAttribute.TenantShortDisplayName}?";
            var viewData       = new ConfirmDialogFormViewData(confirmMessage);

            return(RazorPartialView <ConfirmDialogForm, ConfirmDialogFormViewData, ConfirmDialogFormViewModel>(viewData, viewModel));
        }