Example #1
0
        public GridJsonNetJObjectResult <GeospatialAreaIndexGridSimple> IndexGridJsonData(GeospatialAreaTypePrimaryKey geospatialAreaTypePrimaryKey)
        {
            var geospatialAreaType             = geospatialAreaTypePrimaryKey.EntityObject;
            var gridSpec                       = new IndexGridSpec(CurrentFirmaSession, geospatialAreaType);
            var projectIDsViewableByUser       = HttpRequestStorage.DatabaseEntities.Projects.ToList().GetActiveProjectsAndProposals(CurrentFirmaSession.CanViewProposals(), CurrentFirmaSession).Select(x => x.ProjectID).ToList();
            var geospatialAreaIndexGridSimples = GeospatialAreaModelExtensions.GetGeospatialAreaIndexGridSimples(geospatialAreaType, projectIDsViewableByUser).OrderByDescending(x => x.ProjectViewableByUserCount).ToList();
            var gridJsonNetJObjectResult       = new GridJsonNetJObjectResult <GeospatialAreaIndexGridSimple>(geospatialAreaIndexGridSimples, gridSpec);

            return(gridJsonNetJObjectResult);
        }
Example #2
0
 public IndexViewData(FirmaSession currentFirmaSession, GeospatialAreaType geospatialAreaType, MapInitJson mapInitJson) : base(currentFirmaSession)
 {
     PageTitle          = $"{geospatialAreaType.GeospatialAreaTypeNamePluralized}";
     MapInitJson        = mapInitJson;
     GeospatialAreaType = geospatialAreaType;
     GridSpec           = new IndexGridSpec(currentFirmaSession, geospatialAreaType)
     {
         ObjectNameSingular = $"{geospatialAreaType.GeospatialAreaTypeName}", ObjectNamePlural = $"{geospatialAreaType.GeospatialAreaTypeNamePluralized}", SaveFiltersInCookie = true
     };
     GridName    = "geospatialAreasGrid";
     GridDataUrl = SitkaRoute <GeospatialAreaController> .BuildUrlFromExpression(tc => tc.IndexGridJsonData(geospatialAreaType));
 }