//returns confidential indicator for pollutant trasnfers. If not calculated yet, it will be calculated and stored in viewstate
    protected bool getPollutantTransferConfidentialityAffected()
    {
        if (PollutantTransferConfidentialityAffected == null)
        {
            PollutantTransferConfidentialityAffected = AreaOverview.IsPollutantTransferAffectedByConfidentiality(SearchFilter);
        }

        return((bool)PollutantTransferConfidentialityAffected);
    }
Esempio n. 2
0
    public void DoSaveCSV(object sender, EventArgs e)
    {
        CultureInfo  csvCulture = CultureResolver.ResolveCsvCulture(Request);
        CSVFormatter csvformat  = new CSVFormatter(csvCulture);

        // Create Header
        var           filter           = SearchFilter;
        int           pollutantGroupID = getPollutantGroupID();
        List <string> pollutantCodes   = getOrderedPollutantCodes();

        bool isConfidentialityAffected = AreaOverview.IsPollutantTransferAffectedByConfidentiality(filter, pollutantGroupID);

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

        // Create Body
        List <AreaOverview.AOPollutantTreeListRow> rows = AreaOverview.GetPollutantTransferActivityTree(filter, pollutantGroupID, pollutantCodes).ToList();

        sortData(rows);

        // dump to file
        string topheader           = csvformat.CreateHeader(header);
        string pollutantinfoHeader = csvformat.GetAreaOverviewPollutantInfoHeader(getOrderedPollutants(filter, pollutantGroupID));
        string rowHeader           = csvformat.GetAreaOverviewPollutantDataHeader(getOrderedPollutants(filter, pollutantGroupID));

        Response.WriteUtf8FileHeader("EPRTR_Areaoverview_PollutantTransfers_List");

        Response.Write(topheader + pollutantinfoHeader + rowHeader);


        foreach (var item in rows)
        {
            string row = csvformat.GetAreaOverviewPollutantsRow(item);

            if (AreaOverview.AOPollutantTreeListRow.CODE_TOTAL.Equals(item.Code))
            {
                Response.Write(rowHeader);
            }
            Response.Write(row);
        }

        Response.End();
    }