public double IndustrialActivityTestE()
        {
            DateTime testStartTime;
            DateTime testEndTime;
            TimeSpan testDelta;

            IndustrialActivitySearchFilter filter = new IndustrialActivitySearchFilter();

            filter.ActivityFilter = new ActivityFilter();
            filter.ActivityFilter.SectorIds.Add(3);
            filter.ActivityFilter.ActivityIds.Add(26);
            filter.ActivityFilter.SubActivityIds.Add(-1);

            filter.AreaFilter             = new AreaFilter();
            filter.AreaFilter.AreaGroupID = 1;
            filter.AreaFilter.CountryID   = 74;
            filter.AreaFilter.RegionID    = -1;

            filter.MapFilter          = new MapFilter();
            filter.MapFilter.SqlWhere = "((((ReportingYear) = 2007) And (LOV_CountryID = 74)) And ((LOV_IAActivityID) = 26))";

            filter.YearFilter      = new YearFilter();
            filter.YearFilter.Year = 2007;

            testStartTime = DateTime.Now;
            IEnumerable <PollutantReleases.ReleasesActivityAreaRow> actual = IndustrialActivity.GetPollutantReleases(filter);

            testEndTime = DateTime.Now;

            testDelta = testEndTime - testStartTime;

            return(testDelta.TotalSeconds);
        }
        public double IndustrialActivityTestA()
        {
            DateTime testStartTime;
            DateTime testEndTime;
            TimeSpan testDelta;

            IndustrialActivitySearchFilter filter = new IndustrialActivitySearchFilter();

            filter.ActivityFilter = new ActivityFilter();
            filter.ActivityFilter.SectorIds.Add(-1);
            filter.ActivityFilter.ActivityIds.Add(-1);
            filter.ActivityFilter.SubActivityIds.Add(-1);

            filter.AreaFilter             = new AreaFilter();
            filter.AreaFilter.AreaGroupID = 1;
            filter.AreaFilter.CountryID   = -1;
            filter.AreaFilter.RegionID    = -1;

            filter.MapFilter          = new MapFilter();
            filter.MapFilter.SqlWhere = "(((ReportingYear) = 2007) And ((((((((((((((((((((((((((((((((LOV_CountryID) = 15) Or ((LOV_CountryID) = 22)) Or ((LOV_CountryID) = 34)) Or ((LOV_CountryID) = 57)) Or ((LOV_CountryID) = 58)) Or ((LOV_CountryID) = 59)) Or ((LOV_CountryID) = 68)) Or ((LOV_CountryID) = 73)) Or ((LOV_CountryID) = 74)) Or ((LOV_CountryID) = 81)) Or ((LOV_CountryID) = 85)) Or ((LOV_CountryID) = 100)) Or ((LOV_CountryID) = 101)) Or ((LOV_CountryID) = 106)) Or ((LOV_CountryID) = 109)) Or ((LOV_CountryID) = 122)) Or ((LOV_CountryID) = 127)) Or ((LOV_CountryID) = 128)) Or ((LOV_CountryID) = 129)) Or ((LOV_CountryID) = 137)) Or ((LOV_CountryID) = 156)) Or ((LOV_CountryID) = 166)) Or ((LOV_CountryID) = 177)) Or ((LOV_CountryID) = 178)) Or ((LOV_CountryID) = 182)) Or ((LOV_CountryID) = 201)) Or ((LOV_CountryID) = 202)) Or ((LOV_CountryID) = 207)) Or ((LOV_CountryID) = 213)) Or ((LOV_CountryID) = 214)) Or ((LOV_CountryID) = 234)))";

            filter.YearFilter      = new YearFilter();
            filter.YearFilter.Year = 2007;

            testStartTime = DateTime.Now;
            IEnumerable <PollutantReleases.ReleasesActivityAreaRow> actual = IndustrialActivity.GetPollutantReleases(filter);

            testEndTime = DateTime.Now;

            testDelta = testEndTime - testStartTime;

            return(testDelta.TotalSeconds);
        }
    public void DoSaveCSV(object sender, EventArgs e)
    {
        try
        {
            CultureInfo  csvCulture = CultureResolver.ResolveCsvCulture(Request);
            CSVFormatter csvformat  = new CSVFormatter(csvCulture);

            // Create Header
            IndustrialActivitySearchFilter filter = SearchFilter;

            bool isConfidentialityAffected = IndustrialActivity.IsPollutantReleaseAffectedByConfidentiality(filter);

            Dictionary <string, string> header = EPRTR.HeaderBuilders.CsvHeaderBuilder.GetIndustrialActivitySearchHeader(
                filter,
                isConfidentialityAffected);

            // Create Body
            var rows = IndustrialActivity.GetPollutantReleases(filter);

            // dump to file
            string topheader = csvformat.CreateHeader(header);
            string rowHeader = csvformat.GetIndustrialActivityPollutantReleasesHeader();

            Response.WriteUtf8FileHeader("EPRTR_Industrial_Activity_Pollutant_Releases_List");

            Response.Write(topheader + rowHeader);

            foreach (var item in rows)
            {
                string row = csvformat.GetIndustrialActivityPollutantReleasesRow(item);
                Response.Write(row);
            }

            Response.End();
        }
        catch
        {
        }
    }