Пример #1
0
        public IndexViewData(FirmaSession firmaSession, ProjectFirmaModels.Models.FirmaPage firmaPageHomePage, ProjectFirmaModels.Models.FirmaPage firmaPageAdditionalInfo, ProjectFirmaModels.Models.FirmaPage firmaPageMapInfo,
                             FeaturedProjectsViewData featuredProjectsViewData, ProjectLocationsMapViewData projectLocationsMapViewData, ProjectLocationsMapInitJson projectLocationsMapInitJson,
                             List <ProjectFirmaModels.Models.FirmaHomePageImage> firmaHomePageImages) : base(firmaSession, firmaPageHomePage)
        {
            PageTitle = MultiTenantHelpers.GetToolDisplayName();

            Check.EnsureNotNull(firmaPageHomePage, "firmaPageHomePage not found; is one defined?");
            bool hasPermissionToManageHomePage = new FirmaPageManageFeature().HasPermission(firmaSession, firmaPageHomePage).HasPermission;

            Check.EnsureNotNull(firmaPageAdditionalInfo, "firmaPageAdditionalInfo not found; is one defined?");
            bool hasPermissionToManageAdditionalInfo = new FirmaPageManageFeature().HasPermission(firmaSession, firmaPageAdditionalInfo).HasPermission;

            Check.EnsureNotNull(firmaPageMapInfo, "firmaPageMapInfo not found; is one defined?");
            bool hasPermissionToManagePageMapInfo = new FirmaPageManageFeature().HasPermission(firmaSession, firmaPageMapInfo).HasPermission;

            CustomHomePageTextViewData = new ViewPageContentViewData(firmaPageHomePage, hasPermissionToManageHomePage);
            CustomHomePageAdditionalInfoTextViewData = new ViewPageContentViewData(firmaPageAdditionalInfo, hasPermissionToManageAdditionalInfo);
            CustomHomePageMapTextViewData            = new ViewPageContentViewData(firmaPageMapInfo, hasPermissionToManagePageMapInfo);
            FeaturedProjectsViewData = featuredProjectsViewData;
            FullMapUrl = SitkaRoute <ResultsController> .BuildUrlFromExpression(x => x.ProjectMap());

            ProjectLocationsMapViewData = projectLocationsMapViewData;
            ProjectLocationsMapInitJson = projectLocationsMapInitJson;
            FirmaHomePageCarouselImages = firmaHomePageImages;
            ProposeNewProjectUrl        = SitkaRoute <ProjectCreateController> .BuildUrlFromExpression(x => x.InstructionsProposal(null));

            ProjectUpdatesUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.MyProjectsRequiringAnUpdate());

            DisplayActionButtons = !firmaSession.IsAnonymousOrUnassigned();
        }
Пример #2
0
        public EditViewData(Person currentPerson, List <MeasurementUnitType> measurementUnitTypes,
                            List <ObservationTypeSpecification> observationTypeSpecifications,
                            List <ObservationThresholdType> observationThresholdTypes,
                            List <ObservationTargetType> observationTargetTypes,
                            List <ObservationTypeCollectionMethod> observationTypeCollectionMethods, string submitUrl,
                            Models.NeptunePage instructionsNeptunePage, Models.NeptunePage observationInstructionsNeptunePage,
                            Models.NeptunePage labelAndUnitsInstructionsNeptunePage, Models.TreatmentBMPAssessmentObservationType treatmentBMPAssessmentObservationType) : base(currentPerson, NeptuneArea.OCStormwaterTools)
        {
            EntityName = "Observation Type";
            EntityUrl  = SitkaRoute <TreatmentBMPAssessmentObservationTypeController> .BuildUrlFromExpression(x => x.Index());

            PageTitle = $"{(treatmentBMPAssessmentObservationType != null ? "Edit" : "New")} Observation Type";

            if (treatmentBMPAssessmentObservationType != null)
            {
                SubEntityName = treatmentBMPAssessmentObservationType.TreatmentBMPAssessmentObservationTypeName;
                SubEntityUrl  = treatmentBMPAssessmentObservationType.GetDetailUrl();
            }

            ViewDataForAngular       = new ViewDataForAngular(observationTypeSpecifications, observationTypeCollectionMethods, observationThresholdTypes, observationTargetTypes, measurementUnitTypes);
            ObservationTypeCancelUrl = treatmentBMPAssessmentObservationType == null
                ? SitkaRoute <TreatmentBMPAssessmentObservationTypeController> .BuildUrlFromExpression(x => x.Index())
                : SitkaRoute <TreatmentBMPAssessmentObservationTypeController> .BuildUrlFromExpression(x =>
                                                                                                       x.Detail(treatmentBMPAssessmentObservationType.TreatmentBMPAssessmentObservationTypeID));

            SubmitUrl = submitUrl;

            PassFailObservationThresholdTypeID = ObservationThresholdType.None.ObservationThresholdTypeID;
            PassFailObservationTargetTypeID    = ObservationTargetType.PassFail.ObservationTargetTypeID;

            ViewInstructionsNeptunePage               = new ViewPageContentViewData(instructionsNeptunePage, currentPerson);
            ViewObservationInstructionsNeptunePage    = new ViewPageContentViewData(observationInstructionsNeptunePage, currentPerson);
            ViewLabelsAndUnitsInstructionsNeptunePage = new ViewPageContentViewData(labelAndUnitsInstructionsNeptunePage, currentPerson);
        }
Пример #3
0
        public EditViewData(Person currentPerson,
                            IEnumerable <MeasurementUnitType> measurementUnitTypes,
                            List <ProjectCustomAttributeDataType> projectCustomAttributeDataTypes,
                            string submitUrl,
                            Models.FirmaPage instructionsFirmaPage,
                            Models.ProjectCustomAttributeType projectCustomAttributeType)
            : base(currentPerson)
        {
            EntityName = "Attribute Type";
            PageTitle  =
                $"{(projectCustomAttributeType != null ? "Edit" : "New")} Attribute Type";
            YesNos = BooleanFormats.GetYesNoSelectList();
            ProjectCustomAttributeDataTypes = projectCustomAttributeDataTypes.ToSelectListWithEmptyFirstRow(
                x => x.ProjectCustomAttributeDataTypeID.ToString(), x => x.ProjectCustomAttributeDataTypeDisplayName);
            MeasurementUnitTypes = measurementUnitTypes.OrderBy(x => x.MeasurementUnitTypeDisplayName)
                                   .ToSelectListWithEmptyFirstRow(
                x => x.MeasurementUnitTypeID.ToString(), x => x.MeasurementUnitTypeDisplayName,
                ViewUtilities.NoneString);
            ProjectCustomAttributeTypeIndexUrl =
                SitkaRoute <ProjectCustomAttributeTypeController> .BuildUrlFromExpression(x => x.Manage());

            SubmitUrl = submitUrl;

            ViewInstructionsFirmaPage = new ViewPageContentViewData(instructionsFirmaPage, currentPerson);

            ViewDataForAngular = new EditViewDataForAngular(projectCustomAttributeDataTypes);
        }
Пример #4
0
        public EditViewData(FirmaSession currentFirmaSession,
                            string submitUrl,
                            ProjectFirmaModels.Models.FirmaPage instructionsFirmaPage,
                            ProjectFirmaModels.Models.ProjectCustomAttributeGroup projectCustomAttributeGroup)
            : base(currentFirmaSession)
        {
            EntityName = "Attribute Group";
            PageTitle  =
                $"{(projectCustomAttributeGroup != null ? "Edit" : "New")} Attribute Group";
            ProjectCustomAttributeGroupIndexUrl =
                SitkaRoute <ProjectCustomAttributeGroupController> .BuildUrlFromExpression(x => x.Manage());

            SubmitUrl = submitUrl;

            ViewInstructionsFirmaPage  = new ViewPageContentViewData(instructionsFirmaPage, currentFirmaSession);
            TenantAttribute            = MultiTenantHelpers.GetTenantAttributeFromCache();
            ProjectTypeSelectListItems = ProjectCategory.All.ToSelectList(x => x.ProjectCategoryID.ToString(), x => x.ProjectCategoryDisplayName);

            if (projectCustomAttributeGroup != null && projectCustomAttributeGroup.ProjectCustomAttributeTypes.Any(x => x.ProjectCustomAttributes.Any(y => y.ProjectCustomAttributeValues.Any())))
            {
                HasExistingData = true;
            }
            else
            {
                HasExistingData = false;
            }
        }
Пример #5
0
 public EditProjectProjectStatusViewData(
     ProjectFirmaModels.Models.Project project
     , bool allowEditUpdateDate
     , string createdByPerson
     , string deleteUrl
     , ProjectFirmaModels.Models.FirmaPage projectStatusFirmaPage
     , FirmaSession currentFirmaSession
     , List <ProjectFirmaModels.Models.ProjectStatus> allProjectStatuses
     , ProjectStatusLegendDisplayViewData projectStatusLegendDisplayViewData
     , bool isFinalStatusReport) : base(currentFirmaSession)
 {
     ProjectStatuses = allProjectStatuses.OrderBy(x => x.ProjectStatusSortOrder)
                       .ToSelectListWithEmptyFirstRow(x => x.ProjectStatusID.ToString(),
                                                      x => !string.IsNullOrEmpty(x.ProjectStatusDescription)
                                                                                  ? $"{x.ProjectStatusDisplayName} - {x.ProjectStatusDescription}"
                                                                                  : $"{x.ProjectStatusDisplayName}");
     ProjectStatusJsonList = new ProjectStatusJsonList(allProjectStatuses.Select(x => new ProjectStatusJson(x)).ToList());
     AllowEditUpdateDate   = allowEditUpdateDate;
     CreatedByPerson       = !string.IsNullOrEmpty(createdByPerson)
         ? createdByPerson
         : currentFirmaSession.UserDisplayName;
     DeleteButton                       = string.IsNullOrEmpty(deleteUrl) ? new HtmlString(string.Empty) : ModalDialogFormHelper.MakeDeleteIconButton(deleteUrl, $"Delete {FieldDefinitionEnum.Status.ToType().GetFieldDefinitionLabel()} Update", true);
     ProjectStatusFirmaPage             = new ViewPageContentViewData(projectStatusFirmaPage, currentFirmaSession);
     ProjectStatusLegendDisplayViewData = projectStatusLegendDisplayViewData;
     AllowEditFinal                     = isFinalStatusReport || ProjectProjectStatusController.AllowUserToSetNewStatusReportToFinal(project, currentFirmaSession);
 }
Пример #6
0
        public IndexViewData(Person currentPerson, Models.NeptunePage neptunePage,
                             WaterQualityManagementPlanIndexGridSpec indexGridSpec, Models.NeptunePage secondaryNeptunePage, WaterQualityManagementPlanVerificationGridSpec verificationGridSpec) : base(currentPerson, neptunePage, NeptuneArea.OCStormwaterTools)
        {
            var waterQualityManagementPlanPluralized = FieldDefinitionType.WaterQualityManagementPlan.GetFieldDefinitionLabelPluralized();

            PageTitle  = $"All {waterQualityManagementPlanPluralized}";
            EntityName = $"{waterQualityManagementPlanPluralized}";

            IndexGridSpec    = indexGridSpec;
            IndexGridName    = "waterQualityManagementPlanIndexGrid";
            IndexGridDataUrl =
                SitkaRoute <WaterQualityManagementPlanController> .BuildUrlFromExpression(c =>
                                                                                          c.WaterQualityManagementPlanIndexGridData());

            VerificationNeptunePage = new ViewPageContentViewData(secondaryNeptunePage, currentPerson);
            VerificationGridSpec    = verificationGridSpec;
            VerificationGridName    = "waterQualityManagementPlanVerificationIndexGrid";
            VerificationGridDataUrl =
                SitkaRoute <WaterQualityManagementPlanController> .BuildUrlFromExpression(c =>
                                                                                          c.WaterQualityManagementPlanVerificationGridData());

            NewWaterQualityManagementPlanUrl =
                SitkaRoute <WaterQualityManagementPlanController> .BuildUrlFromExpression(c => c.New());

            CurrentPersonCanCreate = new WaterQualityManagementPlanCreateFeature().HasPermissionByPerson(currentPerson);
        }
Пример #7
0
        public DetailViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.GeospatialArea geospatialArea,
                              MapInitJson mapInitJson, LayerGeoJson projectLocationsLayerGeoJson, ViewGoogleChartViewData viewGoogleChartViewData,
                              List <ProjectFirmaModels.Models.PerformanceMeasure> performanceMeasures,
                              List <ProjectCustomGridConfiguration> projectCustomDefaultGridConfigurations) : base(currentFirmaSession)
        {
            GeospatialArea = geospatialArea;
            MapInitJson    = mapInitJson;
            ProjectLocationsLayerGeoJson = projectLocationsLayerGeoJson;
            ViewGoogleChartViewData      = viewGoogleChartViewData;
            PageTitle = geospatialArea.GeospatialAreaName;
            GeospatialAreaTypeName           = geospatialArea.GeospatialAreaType.GeospatialAreaTypeName;
            GeospatialAreaTypeNamePluralized = geospatialArea.GeospatialAreaType.GeospatialAreaTypeNamePluralized;
            EntityName = $"{GeospatialAreaTypeName}";
            UserHasGeospatialAreaManagePermissions = new GeospatialAreaManageFeature().HasPermissionByFirmaSession(currentFirmaSession);
            IndexUrl = SitkaRoute <GeospatialAreaController> .BuildUrlFromExpression(x => x.Index(geospatialArea.GeospatialAreaType));

            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    = "geospatialAreaProjectListGrid";
            ProjectCustomDefaultGridDataUrl = SitkaRoute <ProjectCustomGridController> .BuildUrlFromExpression(tc => tc.GeospatialAreaProjectsGridJsonData(geospatialArea));

            PerformanceMeasureChartViewDatas = performanceMeasures.Select(x => geospatialArea.GetPerformanceMeasureChartViewData(x, currentFirmaSession)).ToList();

            GeospatialAreaDescriptionViewPageContentViewData = new ViewPageContentViewData(geospatialArea, currentFirmaSession);
        }
Пример #8
0
        public InstructionsViewData(FirmaSession currentFirmaSession, ProjectUpdateBatch projectUpdateBatch,
                                    ProjectUpdateStatus projectUpdateStatus, ProjectFirmaModels.Models.FirmaPage firmaPage) : base(currentFirmaSession, projectUpdateBatch, projectUpdateStatus, new List <string>(), "Instructions")
        {
            PerformanceMeasuresUrl = SitkaRoute <PerformanceMeasureController> .BuildUrlFromExpression(x => x.Index());

            InstructionsViewPageContentViewData = new ViewPageContentViewData(firmaPage, new FirmaPageManageFeature().HasPermission(currentFirmaSession, firmaPage).HasPermission);
        }
Пример #9
0
        /// <summary>
        /// Call for page with associated FirmaPage
        /// </summary>
        protected FirmaViewData(Person currentPerson, Models.FirmaPage firmaPage)
        {
            FirmaPage = firmaPage;

            CurrentPerson = currentPerson;
            FirmaHomeUrl  = SitkaRoute <HomeController> .BuildUrlFromExpression(c => c.Index());

            LogInUrl  = FirmaHelpers.GenerateLogInUrlWithReturnUrl();
            LogOutUrl = FirmaHelpers.GenerateLogOutUrlWithReturnUrl();

            RequestSupportUrl = SitkaRoute <HelpController> .BuildUrlFromExpression(c => c.Support());

            MakeFirmaMenu(currentPerson);

            FullProjectListUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(c => c.Index());

            ProjectSearchUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(c => c.Search(UrlTemplate.Parameter1String));

            ProjectFindUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(c => c.Find(string.Empty));

            var currentPersonCanManage = new FirmaPageManageFeature().HasPermission(currentPerson, firmaPage).HasPermission;

            ViewPageContentViewData = firmaPage != null ? new ViewPageContentViewData(firmaPage, currentPersonCanManage) : null;
            CustomFooterViewData    =
                new ViewPageContentViewData(Models.FirmaPage.GetFirmaPageByPageType(FirmaPageType.CustomFooter),
                                            currentPersonCanManage);
            TenantName          = MultiTenantHelpers.GetTenantName();
            TenantDisplayName   = MultiTenantHelpers.GetTenantDisplayName();
            TenantBannerLogoUrl = MultiTenantHelpers.GetTenantBannerLogoUrl();
        }
Пример #10
0
        public IndexViewData(FirmaSession currentFirmaSession,
                             ProjectFirmaModels.Models.FirmaPage externalMapLayersFirmaPage, string externalMapLayerGridDataUrl,
                             ProjectFirmaModels.Models.FirmaPage internalMapLayersFirmaPage, string geospatialAreaMapLayerGridDataUrl,
                             ProjectFirmaModels.Models.FirmaPage externallySourcedGeospatialAreasInstructionsFirmaPage, bool userCanManage)
            : base(currentFirmaSession, externalMapLayersFirmaPage)
        {
            PageTitle = $"{FieldDefinitionEnum.GeospatialArea.ToType().GetFieldDefinitionLabelPluralized()}";
            ExternalMapLayerGridSpec = new ExternalMapLayerGridSpec(userCanManage)
            {
                ObjectNameSingular  = $"{FieldDefinitionEnum.ExternalReferenceLayer.ToType().GetFieldDefinitionLabel()}",
                ObjectNamePlural    = $"{FieldDefinitionEnum.ExternalReferenceLayer.ToType().GetFieldDefinitionLabelPluralized()}",
                SaveFiltersInCookie = true
            };
            ExternalMapLayerGridName    = "externalMapLayersGrid";
            ExternalMapLayerGridDataUrl = externalMapLayerGridDataUrl;
            NewUrl = SitkaRoute <MapLayerController> .BuildUrlFromExpression(x => x.New());

            var currentPersonCanManage = new FirmaPageManageFeature().HasPermission(currentFirmaSession, internalMapLayersFirmaPage).HasPermission;

            InternalMapLayersViewPageContentViewData = new ViewPageContentViewData(internalMapLayersFirmaPage, currentPersonCanManage);

            AreGeospatialAreasExternallySourced = MultiTenantHelpers.AreGeospatialAreasExternallySourced();
            ExternallySourcedGeospatialAreasInstructionsViewPageContentViewData = new ViewPageContentViewData(externallySourcedGeospatialAreasInstructionsFirmaPage, currentPersonCanManage);

            GeospatialAreaMapLayerGridSpec = new GeospatialAreaMapLayerGridSpec(userCanManage)
            {
                ObjectNameSingular  = $"{FieldDefinitionEnum.GeospatialArea.ToType().GetFieldDefinitionLabel()}",
                ObjectNamePlural    = $"{FieldDefinitionEnum.GeospatialArea.ToType().GetFieldDefinitionLabelPluralized()}",
                SaveFiltersInCookie = true
            };
            GeospatialAreaMapLayerGridName    = "geospatialAreaMapLayersGrid";
            GeospatialAreaMapLayerGridDataUrl = geospatialAreaMapLayerGridDataUrl;

            UserCanManage = userCanManage;
        }
Пример #11
0
        public AgreementIndexViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.FirmaPage firmaPage) : base(currentFirmaSession, firmaPage)
        {
            PageTitle = MultiTenantHelpers.GetAgreementNamePluralized();

            HasAgreementManagePermissions = new AgreementManageFeature().HasPermissionByFirmaSession(currentFirmaSession);
            DisplayActionButtons          = HasAgreementManagePermissions;

            AgreementGridSpec = new AgreementGridSpec(currentFirmaSession)
            {
                ObjectNameSingular  = MultiTenantHelpers.GetAgreementName(),
                ObjectNamePlural    = MultiTenantHelpers.GetAgreementNamePluralized(),
                SaveFiltersInCookie = true
            };

            AgreementGridName    = "AgreementsGrid";
            AgreementGridDataUrl = SitkaRoute <AgreementController> .BuildUrlFromExpression(c => c.AgreementGridJsonData());

            AgreementIndexViewPageContentViewData = new ViewPageContentViewData(firmaPage, true);

            bool hasAgreementManagementRights = new AgreementManageFeature().HasPermissionByPerson(currentFirmaSession.Person);

            ShowAgreementEditingControls = FirmaWebConfiguration.FeatureAlevinAgreementCreationAndEditing && hasAgreementManagementRights;
            NewAgreementUrl = SitkaRoute <AgreementController> .BuildUrlFromExpression(t => t.NewAgreement());

            //AgreementGridSpec.CustomExcelDownloadLinkText = $"Download with {FieldDefinitionEnum.AgreementSubcategory.ToType().GetFieldDefinitionLabelPluralized()}";
            //AgreementGridSpec.CustomExcelDownloadUrl = SitkaRoute<AgreementController>.BuildUrlFromExpression(tc => tc.IndexExcelDownload());
        }
Пример #12
0
        public ForwardLookingFactSheetViewData(Person currentPerson,
                                               Models.Project project,
                                               ProjectLocationSummaryMapInitJson projectLocationSummaryMapInitJson,
                                               GoogleChartJson googleChartJson,
                                               List <GooglePieChartSlice> grantAllocationRequestAmountGooglePieChartSlices, Models.FirmaPage firmaPageFactSheetCustomText) : base(currentPerson, project)
        {
            PageTitle       = project.DisplayName;
            BreadCrumbTitle = "Fact Sheet";

            PerformanceMeasureExpectedValues = project.PerformanceMeasureExpecteds.GroupBy(x => x.PerformanceMeasure, new HavePrimaryKeyComparer <Models.PerformanceMeasure>())
                                               .OrderBy(x => x.Key.PerformanceMeasureSortOrder).ThenBy(x => x.Key.PerformanceMeasureDisplayName).ToList();

            KeyPhoto = project.KeyPhoto;
            ProjectImagesExceptKeyPhotoGroupedByTiming = project.ProjectImages.Where(x => !x.IsKeyPhoto && x.ProjectImageTiming != ProjectImageTiming.Unknown && !x.ExcludeFromFactSheet)
                                                         .GroupBy(x => x.ProjectImageTiming).OrderBy(x => x.Key.SortOrder).ToList();
            ProjectImagesPerTimingGroup = ProjectImagesExceptKeyPhotoGroupedByTiming.Count == 1 ? 6 : 2;
            Classifications             = project.ProjectClassifications.Select(x => x.Classification).ToList().SortByOrderThenName().ToList();

            ProjectLocationSummaryMapInitJson = projectLocationSummaryMapInitJson;
            GoogleChartJson = googleChartJson;
            GrantAllocationRequestAmountGooglePieChartSlices = grantAllocationRequestAmountGooglePieChartSlices;

            //Dynamically resize chart based on how much space the legend requires
            CalculatedChartHeight = 350 - (GrantAllocationRequestAmountGooglePieChartSlices.Count <= 2
                                        ? GrantAllocationRequestAmountGooglePieChartSlices.Count * 24
                                        : GrantAllocationRequestAmountGooglePieChartSlices.Count * 20);
            FactSheetPdfUrl = SitkaRoute <ProjectController> .BuildUrlFromExpression(c => c.FactSheetPdf(project));

            if (project.ProjectType == null)
            {
                TaxonomyColor = "blue";
            }
            else
            {
                switch (MultiTenantHelpers.GetTaxonomyLevel().ToEnum)
                {
                case TaxonomyLevelEnum.Leaf:
                    TaxonomyColor = project.ProjectType.ThemeColor;
                    break;

                case TaxonomyLevelEnum.Branch:
                    TaxonomyColor = project.ProjectType.TaxonomyBranch.ThemeColor;
                    break;

                case TaxonomyLevelEnum.Trunk:
                    TaxonomyColor = project.ProjectType.TaxonomyBranch.TaxonomyTrunk.ThemeColor;
                    break;
                }
            }

            ProjectTypeName             = project.ProjectType == null ? $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()} Taxonomy Not Set" : project.ProjectType.DisplayName;
            TaxonomyBranchName          = project.ProjectType == null ? $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()} Taxonomy Not Set" : project.ProjectType.TaxonomyBranch.DisplayName;
            ProjectTypeDisplayName      = Models.FieldDefinition.ProjectType.GetFieldDefinitionLabel();
            EstimatedTotalCost          = Project.EstimatedTotalCost.HasValue ? Project.EstimatedTotalCost.ToStringCurrency() : "";
            NoGrantAllocationIdentified = project.GetNoGrantAllocationIdentifiedAmount() != null?Project.GetNoGrantAllocationIdentifiedAmount().ToStringCurrency() : "";

            GrandAllocation             = project.ProjectGrantAllocationRequests.Any() ? project.ProjectGrantAllocationRequests.Sum(x => x.TotalAmount).ToStringCurrency() : ViewUtilities.Unknown;
            CustomFactSheetTextViewData = new ViewPageContentViewData(firmaPageFactSheetCustomText, false);
        }
        public TechnicalAssistanceRequestsViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.FirmaPage firmaPage, ProjectUpdateBatch projectUpdateBatch, ProjectUpdateStatus projectUpdateStatus, List <TechnicalAssistanceType> technicalAssistanceTypes, List <CalendarYearString> fiscalYearStrings, List <PersonSimple> personSimples) : base(currentFirmaSession, projectUpdateBatch, projectUpdateStatus, new List <string>(), ProjectUpdateSection.TechnicalAssistanceRequests.ProjectUpdateSectionDisplayName)
        {
            Check.EnsureNotNull(firmaPage, "The Firma Page for this section is not found; is one defined?");
            bool hasPermissionToManageFirmaPage = new FirmaPageManageFeature().HasPermission(currentFirmaSession, firmaPage).HasPermission;

            TechnicalAssistanceInstructionsViewData = new ViewPageContentViewData(firmaPage, hasPermissionToManageFirmaPage);
            UserCanAllocate         = new ProjectUpdateAdminFeatureWithProjectContext().HasPermission(currentFirmaSession, projectUpdateBatch.Project).HasPermission;
            ViewDataForAngular      = new TechnicalAssistanceRequestsViewDataForAngular(projectUpdateBatch.ProjectID, technicalAssistanceTypes, fiscalYearStrings, personSimples);
            SectionCommentsViewData = new SectionCommentsViewData(projectUpdateBatch.TechnicalAssistanceRequestsComment, projectUpdateBatch.IsReturned());
            RefreshUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.RefreshTechnicalAssistanceRequests(projectUpdateBatch.Project));
        }
        public ObligationItemIndexViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.FirmaPage firmaPage) : base(currentFirmaSession, firmaPage)
        {
            PageTitle = "Obligation Items";

            ObligationItemGridSpec = new ObligationItemGridSpec(currentFirmaSession);

            ObligationItemGridName    = "ObligationItemsGrid";
            ObligationItemGridDataUrl = SitkaRoute <ObligationItemController> .BuildUrlFromExpression(c => c.ObligationItemGridJsonData());

            ObligationItemIndexViewPageContentViewData = new ViewPageContentViewData(firmaPage, true);
        }
Пример #15
0
        public PnBudgetIndexViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.FirmaPage firmaPage) : base(currentFirmaSession, firmaPage)
        {
            PageTitle = "PnBudgets";

            PnBudgetGridSpec = new PnBudgetGridSpec(currentFirmaSession);

            PnBudgetGridName    = "PnBudgetsGrid";
            PnBudgetGridDataUrl = SitkaRoute <PnBudgetController> .BuildUrlFromExpression(c => c.PnBudgetNumberGridJsonData());

            PnBudgetIndexViewPageContentViewData = new ViewPageContentViewData(firmaPage, true);
        }
Пример #16
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;
 }
        public EditTechnicalAssistanceRequestsViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.FirmaPage firmaPage, ProjectFirmaModels.Models.Project project, List <TechnicalAssistanceType> technicalAssistanceTypes, List <CalendarYearString> fiscalYearStrings, List <PersonSimple> personSimples) : base()
        {
            Check.EnsureNotNull(firmaPage, "The Firma Page for this section is not found; is one defined?");
            bool hasPermissionToManageFirmaPage = new FirmaPageManageFeature().HasPermission(currentFirmaSession, firmaPage).HasPermission;

            TechnicalAssistanceInstructionsViewData = new ViewPageContentViewData(firmaPage, hasPermissionToManageFirmaPage);
            ProjectID = project.ProjectID;
            TechnicalAssistanceTypes = technicalAssistanceTypes;
            FiscalYearStrings        = fiscalYearStrings;
            PersonSimples            = personSimples;
            UserCanAllocate          = new ProjectUpdateAdminFeatureWithProjectContext().HasPermission(currentFirmaSession, project).HasPermission;
        }
Пример #18
0
        public IndexViewData(Person currentPerson, NeptunePage neptunePage, MapInitJson ovtaBasedMapInitJson,
                             MapInitJson areaBasedMapInitJson, MapInitJson loadBasedMapInitJson,
                             IEnumerable <Models.TreatmentBMP> treatmentBMPs, List <TrashCaptureStatusType> trashCaptureStatusTypes,
                             List <Models.Parcel> parcels, List <StormwaterJurisdiction> stormwaterJurisdictions,
                             FeatureCollection geoJsonForJurisdictions) : base(currentPerson, neptunePage)
        {
            OVTABasedMapInitJson = ovtaBasedMapInitJson;
            AreaBasedMapInitJson = areaBasedMapInitJson;
            LoadBasedMapInitJson = loadBasedMapInitJson;

            var stormwaterJurisdictionIDs = stormwaterJurisdictions.Select(x => x.StormwaterJurisdictionID).ToList();

            StormwaterJurisdictionCQLFilter =
                currentPerson.GetStormwaterJurisdictionCqlFilter(stormwaterJurisdictionIDs);
            NegativeStormwaterJurisdictionCQLFilter =
                currentPerson.GetNegativeStormwaterJurisdictionCqlFilter(stormwaterJurisdictionIDs);
            JurisdictionSelectList = stormwaterJurisdictions.OrderBy(x => x.GetOrganizationDisplayName())
                                     .ToSelectList(x => x.StormwaterJurisdictionID.ToString(CultureInfo.InvariantCulture),
                                                   x => x.GetOrganizationDisplayName());
            var showDropdown = stormwaterJurisdictions.Count > 1;
            var currentUserIsAnonymousOrUnassigned = CurrentPerson.IsAnonymousOrUnassigned();

            ViewDataForAngular = new ViewDataForAngularClass(ovtaBasedMapInitJson, areaBasedMapInitJson,
                                                             loadBasedMapInitJson,
                                                             treatmentBMPs, trashCaptureStatusTypes, parcels, StormwaterJurisdictionCQLFilter, showDropdown,
                                                             NegativeStormwaterJurisdictionCQLFilter, geoJsonForJurisdictions, currentUserIsAnonymousOrUnassigned);
            EntityName  = "Trash Module";
            PageTitle   = "Welcome";
            AllOVTAsUrl =
                SitkaRoute <OnlandVisualTrashAssessmentController> .BuildAbsoluteUrlHttpsFromExpression(x => x.Index(),
                                                                                                        NeptuneWebConfiguration.CanonicalHostName);

            FindBMPUrl = SitkaRoute <TreatmentBMPController> .BuildAbsoluteUrlHttpsFromExpression(x => x.FindABMP(),
                                                                                                  NeptuneWebConfiguration.CanonicalHostName);

            BeginOVTAUrl =
                SitkaRoute <OnlandVisualTrashAssessmentController> .BuildAbsoluteUrlHttpsFromExpression(x =>
                                                                                                        x.Instructions(null),
                                                                                                        NeptuneWebConfiguration.CanonicalHostName);

            AddBMPUrl = SitkaRoute <TreatmentBMPController> .BuildAbsoluteUrlHttpsFromExpression(x => x.New(),
                                                                                                 NeptuneWebConfiguration.CanonicalHostName);

            RefreshTguUrl = SitkaRoute <HomeController> .BuildUrlFromExpression(x => x.RefreshTrashGeneratingUnits());

            ScoreDescriptionsUrl =
                SitkaRoute <OnlandVisualTrashAssessmentController> .BuildUrlFromExpression(x => x.ScoreDescriptions());

            ProgramOverviewPageContentViewData = new ViewPageContentViewData(
                NeptunePage.GetNeptunePageByPageType(NeptunePageType.TrashModuleProgramOverview), currentPerson);
        }
Пример #19
0
 public EditObligationRequestViewData(
     ProjectFirmaModels.Models.FirmaPage projectStatusFirmaPage
     , FirmaSession currentFirmaSession
     , List <ProjectFirmaModels.Models.Agreement> allAgreements
     , List <ContractType> allContractTypes
     , List <ObligationRequestStatus> allObligationRequestStatuses
     , List <ObligationRequestFundingPriority> allFundingPriorities) : base(currentFirmaSession)
 {
     Agreements                = allAgreements.OrderBy(x => x.AgreementNumber).ToSelectListWithEmptyFirstRow(x => x.AgreementID.ToString(), x => $"{x.AgreementNumber} - {x.Organization?.GetDisplayName()}");
     ContractTypes             = allContractTypes.OrderBy(x => x.ContractTypeDisplayName).ToSelectListWithEmptyFirstRow(x => x.ContractTypeID.ToString(), x => x.ContractTypeDisplayName);
     ObligationRequestStatuses = allObligationRequestStatuses.OrderBy(x => x.ObligationRequestStatusID).ToSelectListWithEmptyFirstRow(x => x.ObligationRequestStatusID.ToString(), x => x.ObligationRequestStatusDisplayName);
     FundingPriorities         = allFundingPriorities.OrderBy(x => x.ObligationRequestFundingPriorityID).ToSelectListWithEmptyFirstRow(x => x.ObligationRequestFundingPriorityID.ToString(), x => x.ObligationRequestFundingPriorityDisplayName);
     AgreementJsonList         = new AgreementJsonList(allAgreements.Select(x => new AgreementJson(x)).ToList());
     ProjectStatusFirmaPage    = new ViewPageContentViewData(projectStatusFirmaPage, currentFirmaSession);
 }
Пример #20
0
 public EditCostAuthorityObligationRequestViewData(
     ProjectFirmaModels.Models.FirmaPage projectStatusFirmaPage
     , FirmaSession currentFirmaSession
     , ProjectFirmaModels.Models.ObligationRequest obligationRequest
     , List <ProjectFirmaModels.Models.Organization> allOrganizations
     , List <Person> allPeople
     , List <ProjectFirmaModels.Models.BudgetObjectCode> allBudgetObjectCodes
     ) : base(currentFirmaSession)
 {
     ProjectStatusFirmaPage = new ViewPageContentViewData(projectStatusFirmaPage, currentFirmaSession);
     ObligationRequest      = obligationRequest;
     Organizations          = allOrganizations.OrderBy(x => x.GetDisplayName()).ToSelectListWithEmptyFirstRow(x => x.OrganizationID.ToString(), x => x.GetDisplayName());
     People            = allPeople.OrderBy(x => x.GetFullNameFirstLast()).ToSelectListWithEmptyFirstRow(x => x.PersonID.ToString(), x => x.GetFullNameFirstLast());
     BudgetObjectCodes = allBudgetObjectCodes.OrderBy(x => x.GetDisplayName()).ToSelectListWithEmptyFirstRow(x => x.BudgetObjectCodeID.ToString(), x => x.GetDisplayName());
 }
Пример #21
0
        public ViewResult Manage()
        {
            var firmaPage = FirmaPageTypeEnum.ManageProjectFactSheet.GetFirmaPage();
            var factSheetCustomTextFirmaPage = FirmaPageTypeEnum.FactSheetCustomText.GetFirmaPage();
            var factSheetCustomTextViewData  = new ViewPageContentViewData(factSheetCustomTextFirmaPage, false);
            var editCustomFactSheetTextUrl   = SitkaRoute <FirmaPageController> .BuildUrlFromExpression(t => t.EditInDialog(factSheetCustomTextFirmaPage));

            var deleteFactSheetLogoFileResourceUrl = new SitkaRoute <ProjectFactSheetController>(c => c.DeleteTenantFactSheetLogoFileResource()).BuildUrlFromExpression();
            var editFactSheetLogoUrl = new SitkaRoute <ProjectFactSheetController>(c => c.EditFactSheetLogo()).BuildUrlFromExpression();
            var editBasicsUrl        = new SitkaRoute <ProjectFactSheetController>(c => c.EditBasics()).BuildUrlFromExpression();
            var tenantAttribute      = MultiTenantHelpers.GetTenantAttributeFromCache();
            var viewData             = new ManageViewData(CurrentFirmaSession, firmaPage, factSheetCustomTextViewData, editCustomFactSheetTextUrl, deleteFactSheetLogoFileResourceUrl, editFactSheetLogoUrl, editBasicsUrl, tenantAttribute);

            return(RazorView <Manage, ManageViewData>(viewData));
        }
Пример #22
0
        public IndexViewData(Person currentPerson, Models.NeptunePage neptunePageHomePage,
                             Models.NeptunePage neptunePageAdditionalInfo, Models.NeptunePage neptunePageMapInfo,
                             List <Models.NeptuneHomePageImage> neptuneHomePageImages, JurisdictionsMapViewData jurisdictionsMapViewData,
                             JurisdictionsMapInitJson jurisdictionsMapInitJson, LaunchPadViewData launchPadViewData) : base(currentPerson, neptunePageHomePage, true, NeptuneArea.OCStormwaterTools)
        {
            PageTitle = "Orange County Stormwater Tools";

            CustomHomePageTextViewData = new ViewPageContentViewData(neptunePageHomePage, currentPerson);
            CustomHomePageAdditionalInfoTextViewData = new ViewPageContentViewData(neptunePageAdditionalInfo, currentPerson);
            CustomHomePageMapTextViewData            = new ViewPageContentViewData(neptunePageMapInfo, currentPerson);
            JurisdictionsMapViewData      = jurisdictionsMapViewData;
            JurisdictionsMapInitJson      = jurisdictionsMapInitJson;
            NeptuneHomePageCarouselImages = neptuneHomePageImages;
            LaunchPadViewData             = launchPadViewData;
        }
        public ObligationRequestIndexViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.FirmaPage firmaPage) : base(currentFirmaSession, firmaPage)
        {
            PageTitle = MultiTenantHelpers.GetObligationRequestNamePluralized();
            NewUrl    = "NO_URL_FOR_THIS_PROBABLY_WILL_NEVER_BE_ONE";
            HasAgreementManagePermissions = new ObligationRequestManageFeature().HasPermissionByFirmaSession(currentFirmaSession);

            ObligationRequestGridSpec = new ObligationRequestGridSpec(currentFirmaSession)
            {
                ObjectNameSingular  = MultiTenantHelpers.GetObligationRequestName(),
                ObjectNamePlural    = MultiTenantHelpers.GetObligationRequestNamePluralized(),
                SaveFiltersInCookie = true
            };

            ObligationRequestGridName    = $"ObligationRequestsGrid";
            ObligationRequestGridDataUrl = SitkaRoute <ObligationRequestController> .BuildUrlFromExpression(c => c.ObligationRequestGridJsonData());

            AgrementRequestIndexViewPageContentViewData = new ViewPageContentViewData(firmaPage, true);

            DisplayActionButtons = true;
        }
Пример #24
0
        public IndexViewData(Person currentPerson, Models.FirmaPage firmaPageHomePage, Models.FirmaPage firmaPageAdditionalInfo, Models.FirmaPage firmaPageMapInfo,
                             FeaturedProjectsViewData featuredProjectsViewData, ProjectLocationsMapViewData projectLocationsMapViewData, ProjectLocationsMapInitJson projectLocationsMapInitJson,
                             List <Models.FirmaHomePageImage> firmaHomePageImages) : base(currentPerson, firmaPageHomePage)
        {
            PageTitle = MultiTenantHelpers.GetToolDisplayName();

            CustomHomePageTextViewData = new ViewPageContentViewData(firmaPageHomePage, new FirmaPageManageFeature().HasPermission(currentPerson, firmaPageHomePage).HasPermission);
            CustomHomePageAdditionalInfoTextViewData = new ViewPageContentViewData(firmaPageAdditionalInfo, new FirmaPageManageFeature().HasPermission(currentPerson, firmaPageAdditionalInfo).HasPermission);
            CustomHomePageMapTextViewData            = new ViewPageContentViewData(firmaPageMapInfo, new FirmaPageManageFeature().HasPermission(currentPerson, firmaPageMapInfo).HasPermission);
            FeaturedProjectsViewData = featuredProjectsViewData;
            FullMapUrl = SitkaRoute <ResultsController> .BuildUrlFromExpression(x => x.ProjectMap());

            ProjectLocationsMapViewData = projectLocationsMapViewData;
            ProjectLocationsMapInitJson = projectLocationsMapInitJson;
            FirmaHomePageCarouselImages = firmaHomePageImages;
            ProposeNewProjectUrl        = SitkaRoute <ProjectCreateController> .BuildUrlFromExpression(x => x.InstructionsProposal(null));

            ProjectUpdatesUrl = SitkaRoute <ProjectUpdateController> .BuildUrlFromExpression(x => x.MyProjectsRequiringAnUpdate());

            DisplayActionButtons = !currentPerson.IsAnonymousOrUnassigned;
        }
Пример #25
0
        public CostAuthorityIndexViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.FirmaPage firmaPage) : base(currentFirmaSession, firmaPage)
        {
            PageTitle = MultiTenantHelpers.GetCostAuthorityNamePluralized();

            HasCostAuthorityManagePermissions = new CostAuthorityManageFeature().HasPermissionByFirmaSession(currentFirmaSession);
            CostAuthorityGridSpec             = new CostAuthorityGridSpec(currentFirmaSession)
            {
                ObjectNameSingular  = MultiTenantHelpers.GetCostAuthorityName(),
                ObjectNamePlural    = MultiTenantHelpers.GetCostAuthorityNamePluralized(),
                SaveFiltersInCookie = true
            };

            //CostAuthorityGridSpec.CustomExcelDownloadLinkText = $"Download with {FieldDefinitionEnum.CostAuthoritySubcategory.ToType().GetFieldDefinitionLabelPluralized()}";
            //CostAuthorityGridSpec.CustomExcelDownloadUrl = SitkaRoute<CostAuthorityController>.BuildUrlFromExpression(tc => tc.IndexExcelDownload());

            CostAuthorityGridName    = "CostAuthoritiesGrid";
            CostAuthorityGridDataUrl = SitkaRoute <CostAuthorityController> .BuildUrlFromExpression(c => c.CostAuthorityGridJsonData());

            // Is this needed??
            //EditSortOrderUrl = SitkaRoute<CostAuthorityController>.BuildUrlFromExpression(x => x.EditSortOrder());
            AgrementIndexViewPageContentViewData = new ViewPageContentViewData(firmaPage, true);
        }
Пример #26
0
        public EditViewData(Person currentPerson, List <MeasurementUnitType> measurementUnitTypes,
                            List <CustomAttributeDataType> customAttributeDataTypes, string submitUrl,
                            Models.NeptunePage instructionsNeptunePage, Models.NeptunePage customAttributeInstructionsNeptunePage,
                            Models.CustomAttributeType customAttributeType) : base(currentPerson, NeptuneArea.OCStormwaterTools)
        {
            EntityName = "Attribute Type";
            EntityUrl  = SitkaRoute <CustomAttributeTypeController> .BuildUrlFromExpression(x => x.Manage());

            PageTitle =
                $"{(customAttributeType != null ? "Edit" : "New")} Attribute Type";

            if (customAttributeType != null)
            {
                SubEntityName = customAttributeType.CustomAttributeTypeName;
                SubEntityUrl  = customAttributeType.GetDetailUrl();
            }

            YesNos = BooleanFormats.GetYesNoSelectList();
            CustomAttributeDataTypes = customAttributeDataTypes.ToSelectListWithDisabledEmptyFirstRow(
                x => x.CustomAttributeDataTypeID.ToString(), x => x.CustomAttributeDataTypeDisplayName);
            MeasurementUnitTypes = measurementUnitTypes.OrderBy(x => x.MeasurementUnitTypeDisplayName).ToSelectListWithEmptyFirstRow(
                x => x.MeasurementUnitTypeID.ToString(), x => x.MeasurementUnitTypeDisplayName, ViewUtilities.NoneString);
            CustomAttributeTypePurposes =
                CustomAttributeTypePurpose.All.ToSelectListWithDisabledEmptyFirstRow(
                    x => x.CustomAttributeTypePurposeID.ToString(CultureInfo.InvariantCulture),
                    x => x.CustomAttributeTypePurposeDisplayName);

            CustomAttributeTypeIndexUrl =
                SitkaRoute <CustomAttributeTypeController> .BuildUrlFromExpression(x => x.Manage());

            SubmitUrl = submitUrl;

            ViewInstructionsNeptunePage = new ViewPageContentViewData(instructionsNeptunePage, currentPerson);
            ViewCustomAttributeInstructionsNeptunePage =
                new ViewPageContentViewData(customAttributeInstructionsNeptunePage, currentPerson);

            ViewDataForAngular = new ViewDataForAngular(customAttributeDataTypes);
        }
Пример #27
0
        public LaunchPadViewData(Person currentPerson, Models.NeptunePage launchPadNeptunePage, int numberOfBmpTypes, string managerDashboardDescription)
        {
            CurrentPerson                    = currentPerson;
            IsLoggedIn                       = !CurrentPerson.IsAnonymousUser();
            IsAdmin                          = new NeptuneAdminFeature().HasPermissionByPerson(CurrentPerson);
            IsUnassigned                     = !CurrentPerson.IsAnonymousUser() && CurrentPerson.Role == Models.Role.Unassigned;
            IsJurisdictionManager            = new JurisdictionManageFeature().HasPermissionByPerson(CurrentPerson);
            Jurisdictions                    = CurrentPerson.StormwaterJurisdictionPeople.Select(x => x.StormwaterJurisdiction).ToList();
            NumberOfBmpTypes                 = numberOfBmpTypes;
            ManagerDashboardDescription      = managerDashboardDescription;
            LaunchPadViewPageContentViewData =
                new ViewPageContentViewData(launchPadNeptunePage, CurrentPerson);
            JurisdictionIndexUrl = SitkaRoute <JurisdictionController> .BuildUrlFromExpression(c => c.Index());

            RequestSupportUrl = SitkaRoute <HelpController> .BuildUrlFromExpression(c => c.RequestToChangePrivileges());

            FindABmpUrl = SitkaRoute <TreatmentBMPController> .BuildUrlFromExpression(c => c.FindABMP());

            ExploreBmpTypesUrl = SitkaRoute <TreatmentBMPTypeController> .BuildUrlFromExpression(c => c.Index());

            AddABmpUrl = SitkaRoute <TreatmentBMPController> .BuildUrlFromExpression(c => c.New());

            ViewAssessmentAndMaintenanceRecordsUrl = SitkaRoute <FieldVisitController> .BuildUrlFromExpression(c => c.Index());

            ViewWaterQualityManagementPlansUrl = SitkaRoute <WaterQualityManagementPlanController> .BuildUrlFromExpression(c => c.Index());

            FieldFieldVisitsUrl = SitkaRoute <FieldVisitController> .BuildUrlFromExpression(c => c.Index());

            InviteANewUserUrl = SitkaRoute <UserController> .BuildUrlFromExpression(c => c.Invite());

            EditUserRolesUrl = SitkaRoute <UserController> .BuildUrlFromExpression(c => c.Index());

            AddAFundingSourceUrl = SitkaRoute <FundingSourceController> .BuildUrlFromExpression(c => c.Index());

            ManagerDashboardUrl = SitkaRoute <ManagerDashboardController> .BuildUrlFromExpression(c => c.Index());

            ViewDelineationReconciliationReportUrl = SitkaRoute <DelineationController> .BuildUrlFromExpression(c => c.DelineationReconciliationReport());
        }
Пример #28
0
        public EditViewData(Person currentPerson,
                            IEnumerable <TreatmentBMPTypeAssessmentObservationType> observationTypes, string submitUrl,
                            Models.NeptunePage instructionsNeptunePage, Models.TreatmentBMPType treatmentBMPType,
                            IEnumerable <TreatmentBMPTypeCustomAttributeType> customAttributeTypes,
                            IEnumerable <Models.TreatmentBMPAssessmentObservationType> allObservationTypes,
                            IEnumerable <Models.CustomAttributeType> allCustomAttributeTypes) : base(currentPerson, NeptuneArea.OCStormwaterTools)
        {
            EntityName = FieldDefinitionType.TreatmentBMPType.GetFieldDefinitionLabelPluralized();
            EntityUrl  = SitkaRoute <TreatmentBMPTypeController> .BuildUrlFromExpression(c => c.Manage());

            if (treatmentBMPType != null)
            {
                SubEntityName = treatmentBMPType.TreatmentBMPTypeName;
                SubEntityUrl  = treatmentBMPType.GetDetailUrl();
            }
            PageTitle = $"{(treatmentBMPType != null ? "Edit" : "New")} {FieldDefinitionType.TreatmentBMPType.GetFieldDefinitionLabel()}";

            ViewDataForAngular       = new ViewDataForAngular(observationTypes, customAttributeTypes, allObservationTypes, allCustomAttributeTypes);
            TreatmentBMPTypeIndexUrl = SitkaRoute <TreatmentBMPTypeController> .BuildUrlFromExpression(x => x.Manage());

            SubmitUrl = submitUrl;
            ViewInstructionsNeptunePage = new ViewPageContentViewData(instructionsNeptunePage, currentPerson);
        }
        public EditCostAuthorityObligationRequestsViewData(
            ProjectFirmaModels.Models.FirmaPage editCostAuthorityObligationRequestsFirmaPage
            , FirmaSession currentFirmaSession
            , List <ProjectFirmaModels.Models.CostAuthority> allCostAuthorities
            , ProjectFirmaModels.Models.ObligationRequest obligationRequest
            , List <ProjectFirmaModels.Models.Organization> allOrganizations
            , List <Person> allPeople
            , List <ProjectFirmaModels.Models.BudgetObjectCode> allBudgetObjectCodes
            ) : base(currentFirmaSession, editCostAuthorityObligationRequestsFirmaPage)
        {
            var costAuthoritiesToOmit =
                obligationRequest.CostAuthorityObligationRequests.Select(x => x.CostAuthorityID);
            var reclamationCostAuthoritiesToUse = allCostAuthorities
                                                  .Where(x => !costAuthoritiesToOmit.Contains(x.CostAuthorityID)).ToList();

            CostAuthorities = reclamationCostAuthoritiesToUse
                              .OrderBy(x => x.CostAuthorityWorkBreakdownStructure)
                              .ToSelectListWithEmptyFirstRow(x => x.CostAuthorityID.ToString(), x => x.CostAuthorityWorkBreakdownStructure, "Select CAWBS");
            CostAuthorityJsonList = new CostAuthorityJsonList(reclamationCostAuthoritiesToUse.Select(x => new CostAuthorityJson(x)).ToList());
            EditCostAuthorityObligationRequestsFirmaPage = new ViewPageContentViewData(editCostAuthorityObligationRequestsFirmaPage, currentFirmaSession);
            Organizations     = allOrganizations.OrderBy(x => x.GetDisplayName()).ToSelectListWithEmptyFirstRow(x => x.OrganizationID.ToString(), x => x.GetDisplayName());
            People            = allPeople.OrderBy(x => x.GetFullNameFirstLast()).ToSelectListWithEmptyFirstRow(x => x.PersonID.ToString(), x => x.GetFullNameFirstLast());
            BudgetObjectCodes = allBudgetObjectCodes.OrderBy(x => x.GetDisplayName()).ToSelectListWithEmptyFirstRow(x => x.BudgetObjectCodeID.ToString(), x => x.GetDisplayName());
        }
Пример #30
0
 public FundingStatusViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.FirmaPage firmaPage, ProjectFirmaModels.Models.FirmaPage fundingStatusFooter, GoogleChartJson summaryGoogleChart, GoogleChartJson orgTypeGoogleChart) : base(currentFirmaSession, firmaPage)
 {
     FundingStatusFooterViewPageContentViewData  = new ViewPageContentViewData(fundingStatusFooter, currentFirmaSession);
     SummaryViewGoogleChartViewData              = new ViewGoogleChartViewData(summaryGoogleChart, summaryGoogleChart.GoogleChartConfiguration.Title, 350, true, true);
     StatusByOwnerOrgTypeViewGoogleChartViewData = new ViewGoogleChartViewData(orgTypeGoogleChart, orgTypeGoogleChart.GoogleChartConfiguration.Title, 400, true);
 }