示例#1
0
        /// <summary>
        /// returns the MapFilter (sql and layers) corresponding to the filter.
        /// </summary>
        public static MapFilter GetMapFilter(FacilitySearchFilter filter)
        {
            Expression <Func <FACILITYSEARCH_ALL, bool> > lambda = getLambdaExpression(filter);

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

            mapFilter.SqlWhere = LinqExpressionBuilder.GetSQL(lambda, lambda.Parameters[0]);
            mapFilter.SetLayers(filter.ActivityFilter);

            return(mapFilter);
        }
示例#2
0
        // ----------------------------------------------------------------------------------
        // Map filters
        // ----------------------------------------------------------------------------------
        #region Map

        /// <summary>
        /// returns the MapFilter (sql and layers) corresponding to the filter.
        /// </summary>
        public static MapFilter GetMapFilter(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.GetSQL(exp, param);
            mapFilter.SetLayers(filter.ActivityFilter);

            return(mapFilter);
        }
        // ----------------------------------------------------------------------------------
        // Map filters
        // ----------------------------------------------------------------------------------
        #region Map

        /// <summary>
        /// returns the MapFilter (sql and layers) corresponding to the filter.
        /// </summary>
        public static MapFilter GetMapFilter(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.GetSQL(lambda.Body, null);
            mapFilter.SetLayers(filter.ActivityFilter);

            return(mapFilter);
        }
示例#4
0
        /// <summary>
        /// returns the MapFilter (sql and layers) corresponding to the filter.
        /// </summary>
        public static MapFilter GetMapFilter(IndustrialActivitySearchFilter filter)
        {
            DataClassesFacilityDataContext db    = getFacilityDataContext();
            ParameterExpression            param = Expression.Parameter(typeof(FACILITYSEARCH_MAINACTIVITY), "s");
            Expression exp = LinqExpressionBuilder.GetLinqExpressionIndustrialActivitySearch(filter, param);
            Expression <Func <FACILITYSEARCH_MAINACTIVITY, bool> > lambda = Expression.Lambda <Func <FACILITYSEARCH_MAINACTIVITY, bool> >(exp, param);

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

            mapFilter.SqlWhere = LinqExpressionBuilder.GetSQL(exp, param);
            mapFilter.SetLayers(filter.ActivityFilter);

            return(mapFilter);
        }
示例#5
0
        public static MapFilter GetMapJavascriptFilter(WasteTransferTimeSeriesFilter filter)
        {
            //parameter must be "p" to match map config file
            ParameterExpression param = Expression.Parameter(typeof(WASTETRANSFER), "p");
            Expression          exp   = LinqExpressionBuilder.GetLinqExpressionWasteTransfer(filter, param, false);
            Expression <Func <WASTETRANSFER, bool> > lambda = Expression.Lambda <Func <WASTETRANSFER, 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 WASTETRANSFER p where " + mapFilter.SqlWhere + ")";
            mapFilter.SetLayers(filter.ActivityFilter);

            return(mapFilter);
        }
示例#6
0
        public static MapFilter GetMapJavascriptFilter(PollutantReleasesTimeSeriesFilter filter)
        {
            //parameter must be "p" to match map config file
            ParameterExpression param = Expression.Parameter(typeof(POLLUTANTRELEASE), "p");
            Expression          exp   = LinqExpressionBuilder.GetLinqExpressionPollutantReleases(filter, param);
            Expression <Func <POLLUTANTRELEASE, bool> > lambda = Expression.Lambda <Func <POLLUTANTRELEASE, 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 POLLUTANTRELEASE p where " + mapFilter.SqlWhere + ")";
            mapFilter.SetLayers(filter.ActivityFilter);

            return(mapFilter);
        }