Exemplo n.º 1
0
        public static MapFilter GetMapJavascriptFilter(FacilitySearchFilter filter)
        {
            Expression <Func <FACILITYSEARCH_ALL, bool> > lambda = getLambdaExpression(filter);

            // create sql and sectors to map
            MapFilter mapFilter = new MapFilter();

            mapFilter.SqlWhere = LinqExpressionBuilder.GetSQLJavascript(lambda, lambda.Parameters[0]);
            mapFilter.SqlWhere = "FacilityReportID IN (select FacilityReportID from FACILITYSEARCH_ALL where " + mapFilter.SqlWhere + ")";

            return(mapFilter);
        }
Exemplo n.º 2
0
        public static MapFilter GetMapJavascriptFilter(PollutantTransfersSearchFilter filter)
        {
            ParameterExpression param = Expression.Parameter(typeof(POLLUTANTTRANSFER), "s");
            Expression          exp   = LinqExpressionBuilder.GetLinqExpressionPollutantTransfers(filter, param);
            Expression <Func <POLLUTANTTRANSFER, bool> > lambda = Expression.Lambda <Func <POLLUTANTTRANSFER, bool> >(exp, param);

            // create sql and sectors to map
            MapFilter mapFilter = new MapFilter();

            mapFilter.SqlWhere = LinqExpressionBuilder.GetSQLJavascript(exp, param);
            mapFilter.SqlWhere = "FacilityReportID IN (select FacilityReportID from dbo.POLLUTANTTRANSFER where " + mapFilter.SqlWhere + ")";

            return(mapFilter);
        }
Exemplo n.º 3
0
        public static MapFilter GetMapJavascriptFilter(PollutantTransferTimeSeriesFilter filter)
        {
            //parameter must be "p" to match map config file
            ParameterExpression param = Expression.Parameter(typeof(POLLUTANTTRANSFER), "p");
            Expression          exp   = LinqExpressionBuilder.GetLinqExpressionPollutantTransfers(filter, param);
            Expression <Func <POLLUTANTTRANSFER, bool> > lambda = Expression.Lambda <Func <POLLUTANTTRANSFER, bool> >(exp, param);

            // create sql and sectors to map. Do not remove parameter prefix.
            MapFilter mapFilter = new MapFilter();

            mapFilter.SqlWhere = LinqExpressionBuilder.GetSQLJavascript(lambda.Body, null);
            mapFilter.SqlWhere = "FacilityReportID IN (select p.FacilityReportID from POLLUTANTTRANSFER p where " + mapFilter.SqlWhere + ")";
            mapFilter.SetLayers(filter.ActivityFilter);

            return(mapFilter);
        }