Exemple #1
0
        public GridJsonNetJObjectResult <FocusArea> IndexGridJsonData()
        {
            var gridSpec   = new IndexGridSpec(CurrentPerson);
            var focusAreas = HttpRequestStorage.DatabaseEntities.FocusAreas.OrderBy(x => x.FocusAreaName).ToList();
            var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <FocusArea>(focusAreas, gridSpec);

            return(gridJsonNetJObjectResult);
        }
Exemple #2
0
        public IndexViewData(Person currentPerson, MapInitJson mapInitJson, Models.FirmaPage firmaPage) : base(currentPerson, firmaPage)
        {
            PageTitle   = Models.FieldDefinition.FocusArea.GetFieldDefinitionLabelPluralized();
            MapInitJson = mapInitJson;
            GridSpec    = new IndexGridSpec(currentPerson)
            {
                ObjectNameSingular = Models.FieldDefinition.FocusArea.GetFieldDefinitionLabel(), ObjectNamePlural = Models.FieldDefinition.FocusArea.GetFieldDefinitionLabelPluralized(), SaveFiltersInCookie = true
            };
            var hasFocusAreaManagePermissions = new FocusAreaManageFeature().HasPermissionByPerson(currentPerson);


            if (hasFocusAreaManagePermissions)
            {
                var contentUrl = SitkaRoute <FocusAreaController> .BuildUrlFromExpression(t => t.New());

                GridSpec.CreateEntityModalDialogForm = new ModalDialogForm(contentUrl, $"Create a new {Models.FieldDefinition.FocusArea.GetFieldDefinitionLabel()}");
            }


            GridName    = "focusAreasGrid";
            GridDataUrl = SitkaRoute <FocusAreaController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData());
        }