Beispiel #1
0
        public GridJsonNetJObjectResult <FundingSource> IndexGridJsonData()
        {
            var gridSpec                 = new IndexGridSpec(CurrentPerson);
            var fundingSources           = HttpRequestStorage.DatabaseEntities.FundingSources.ToList().OrderBy(ht => ht.FundingSourceName).ToList();
            var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <FundingSource>(fundingSources, gridSpec);

            return(gridJsonNetJObjectResult);
        }
Beispiel #2
0
        public IndexViewData(Person currentPerson, Models.NeptunePage neptunePage) : base(currentPerson, neptunePage, NeptuneArea.OCStormwaterTools)
        {
            PageTitle  = $"All {FieldDefinitionType.FundingSource.GetFieldDefinitionLabelPluralized()}";
            EntityName = $"{FieldDefinitionType.FundingSource.GetFieldDefinitionLabelPluralized()}";

            GridSpec = new IndexGridSpec(currentPerson)
            {
                ObjectNameSingular  = $"{FieldDefinitionType.FundingSource.GetFieldDefinitionLabel()}",
                ObjectNamePlural    = $"{FieldDefinitionType.FundingSource.GetFieldDefinitionLabelPluralized()}",
                SaveFiltersInCookie = true
            };

            UserCanAddFundingSource = new FundingSourceCreateFeature().HasPermissionByPerson(currentPerson);

            GridName    = "fundingSourcesGrid";
            GridDataUrl = SitkaRoute <FundingSourceController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData());

            NewFundingSourceUrl = SitkaRoute <FundingSourceController> .BuildUrlFromExpression(tc => tc.New());
        }