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

        return((bool)PollutantTransferConfidentialityAffected);
    }
    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.IsPollutantTransferAffectedByConfidentiality(filter);

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

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

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

            Response.WriteUtf8FileHeader("EPRTR_Industrial_Activity_Pollutant_Transfer_List");

            Response.Write(topheader + rowHeader);

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

            Response.End();
        }
        catch
        {
        }
    }