public GridJsonNetJObjectResult <FundingSource> IndexGridJsonData()
        {
            var fundingSourceCustomAttributeTypes = HttpRequestStorage.DatabaseEntities.FundingSourceCustomAttributeTypes.ToList();

            var gridSpec       = new IndexGridSpec(CurrentFirmaSession, fundingSourceCustomAttributeTypes);
            var fundingSources = HttpRequestStorage.DatabaseEntities.FundingSources
                                 .Include(x => x.Organization)
                                 .ToList()
                                 .OrderBy(ht => ht.GetDisplayName()).ToList();
            var gridJsonNetJObjectResult = new GridJsonNetJObjectResult <FundingSource>(fundingSources, gridSpec);

            return(gridJsonNetJObjectResult);
        }
示例#2
0
        public IndexViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.FirmaPage firmaPage, List <ProjectFirmaModels.Models.FundingSourceCustomAttributeType> fundingSourceCustomAttributeType) :
            base(currentFirmaSession, firmaPage)
        {
            PageTitle = $"{FieldDefinitionEnum.FundingSource.ToType().GetFieldDefinitionLabelPluralized()}";

            GridSpec = new IndexGridSpec(currentFirmaSession, fundingSourceCustomAttributeType)
            {
                ObjectNameSingular  = $"{FieldDefinitionEnum.FundingSource.ToType().GetFieldDefinitionLabel()}",
                ObjectNamePlural    = $"{FieldDefinitionEnum.FundingSource.ToType().GetFieldDefinitionLabelPluralized()}",
                SaveFiltersInCookie = true
            };

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

            HasFundingSourceCreatePermissions = new FundingSourceCreateFeature().HasPermissionByFirmaSession(currentFirmaSession);
            NewUrl = SitkaRoute <FundingSourceController> .BuildUrlFromExpression(t => t.New());
        }