Exemple #1
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);
        }
Exemple #2
0
 public ViewPageContentViewData(ProjectFirmaModels.Models.GeospatialArea geospatialArea, FirmaSession currentFirmaSession)
 {
     FirmaPageContentHtmlString = geospatialArea.GetFirmaPageContentHtmlString();
     FirmaPageDisplayName       = geospatialArea.GetFirmaPageDisplayName();
     ShowEditButton             = new GeospatialAreaManageFeature().HasPermissionByFirmaSession(currentFirmaSession);
     HasPageContent             = geospatialArea.HasPageContent();
     EditPageContentUrl         = SitkaRoute <GeospatialAreaController> .BuildUrlFromExpression(t => t.EditDescriptionInDialog(geospatialArea));
 }