Пример #1
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;
 }
Пример #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 ProjectCustomGridSpec(FirmaSession currentFirmaSession,
                              List <ProjectCustomGridConfiguration> projectCustomGridConfigurations,
                              ProjectCustomGridTypeEnum projectCustomGridTypeEnum,
                              Dictionary <int, vProjectDetail> projectDetailsDictionary,
                              ProjectFirmaModels.Models.Tenant tenant) : this(currentFirmaSession, projectCustomGridConfigurations, projectCustomGridTypeEnum, projectDetailsDictionary, tenant, true)
 {
 }
        public EditClassificationSystemsViewModel(ProjectFirmaModels.Models.Tenant tenant)
        {
            TenantID = tenant.TenantID;
            ClassificationSystemSimples = MultiTenantHelpers.GetClassificationSystems().Select(x => new ClassificationSystemSimple(x)).ToList();

            if (ClassificationSystemSimples.Count < 2)
            {
                ClassificationSystemSimples.Add(new ClassificationSystemSimple(tenant.TenantID));
            }
        }
Пример #6
0
        public ProjectCustomGridSpec(FirmaSession currentFirmaSession,
                                     List <ProjectCustomGridConfiguration> projectCustomGridConfigurations,
                                     ProjectCustomGridTypeEnum projectCustomGridTypeEnum,
                                     Dictionary <int, vProjectDetail> projectDetailsDictionary,
                                     ProjectFirmaModels.Models.Tenant tenant)
        {
            bool userHasTagManagePermissions          = new FirmaAdminFeature().HasPermissionByFirmaSession(currentFirmaSession);
            bool userHasDeletePermissions             = new ProjectDeleteFeature().HasPermissionByFirmaSession(currentFirmaSession);
            bool userHasEditProjectAsAdminPermissions = new ProjectEditAsAdminFeature().HasPermissionByFirmaSession(currentFirmaSession);
            bool userHasReportDownloadPermissions     = new ReportTemplateGenerateReportsFeature().HasPermissionByFirmaSession(currentFirmaSession);
            var  geospatialAreas         = HttpRequestStorage.DatabaseEntities.vGeospatialAreas.Where(x => x.TenantID == tenant.TenantID).ToDictionary(x => x.GeospatialAreaID);
            var  projectCustomAttributes = HttpRequestStorage.DatabaseEntities.vProjectCustomAttributeValues.Where(x => x.TenantID == tenant.TenantID)
                                           .GroupBy(x => x.ProjectID)
                                           .ToDictionary(grp => grp.Key, y => y.ToList());

            var projectGeospatialAreas = HttpRequestStorage.DatabaseEntities.ProjectGeospatialAreas
                                         .GroupBy(x => x.ProjectID).ToDictionary(grp => grp.Key, y => y.ToList());
            var  taxonomyLeafs = HttpRequestStorage.DatabaseEntities.TaxonomyLeafs.ToDictionary(x => x.TaxonomyLeafID);
            var  projectLabel  = FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel();
            bool hasProjectApprovalPermissionBySession =
                new ProjectApproveFeature().HasPermissionByFirmaSession(currentFirmaSession);
            var statusUpdateLabel   = FieldDefinitionEnum.StatusUpdate.ToType().GetFieldDefinitionLabel();
            var sitkaAdminPersonIDs =
                HttpRequestStorage.DatabaseEntities.AllPeople.Where(x =>
                                                                    x.RoleID == ProjectFirmaModels.Models.Role.SitkaAdmin.RoleID).Select(x => x.PersonID).ToList();

            // Mandatory fields before
            AddMandatoryFieldsBefore(userHasTagManagePermissions, userHasReportDownloadPermissions, userHasDeletePermissions, projectCustomGridTypeEnum);

            // Implement configured fields here
            AddConfiguredFields(currentFirmaSession
                                , projectCustomGridConfigurations
                                , userHasEditProjectAsAdminPermissions
                                , projectDetailsDictionary
                                , geospatialAreas
                                , taxonomyLeafs
                                , projectGeospatialAreas
                                , projectCustomAttributes
                                , projectLabel
                                , hasProjectApprovalPermissionBySession
                                , statusUpdateLabel
                                , sitkaAdminPersonIDs);

            // Mandatory fields appearing AFTER configurable fields
            AddMandatoryFieldsAfter(userHasTagManagePermissions);
        }
Пример #7
0
 public EditTenantLogoViewModel(ProjectFirmaModels.Models.Tenant tenant)
 {
     TenantID = tenant.TenantID;
 }
Пример #8
0
 public EditStylesheetViewModel(ProjectFirmaModels.Models.Tenant tenant)
 {
     TenantID = tenant.TenantID;
 }