Пример #1
0
    protected void showContent(string command)
    {
        hideSubControls();

        this.ucSheetLinks.HighLight(command);
        string txt = Resources.GetGlobal("Pollutant", "AllValuesAreYearlyTransfers");

        bool   conf  = PollutantTransferTrend.IsAffectedByConfidentiality(FacilityBasic.FacilityID, PollutantCode);
        string alert = conf ? Resources.GetGlobal("Common", "ConfidentialityAlertLink") : string.Empty;

        if (command.Equals(TrendTransferContent.TimeSeries.ToString()))
        {
            this.litHeadline.Text   = Resources.GetGlobal("Facility", "PollutantTransfersTimeSeries");
            ViewState[CONTENT_TYPE] = TrendTransferContent.TimeSeries;
        }
        else if (command.Equals(TrendTransferContent.Comparison.ToString()))
        {
            this.litHeadline.Text   = Resources.GetGlobal("Facility", "PollutantTransfersComparison");
            ViewState[CONTENT_TYPE] = TrendTransferContent.Comparison;
        }
        else if (command.Equals(TrendTransferContent.Confidentiality.ToString()))
        {
            this.litHeadline.Text = Resources.GetGlobal("Facility", "PollutantTransfersConfidentiality");
            this.ucContentConfidentiality.Visible = true;
            this.ucContentConfidentiality.Populate(FacilityBasic.FacilityID, PollutantCode);
            ViewState[CONTENT_TYPE] = TrendTransferContent.Confidentiality;
            alert = String.Empty;
        }

        updateHeader(txt);
        updateAlert(alert);
    }
Пример #2
0
    /// <summary>
    /// Save
    /// </summary>
    protected void doSave(object sender, EventArgs e)
    {
        try
        {
            CultureInfo  csvCulture = CultureResolver.ResolveCsvCulture(Request);
            CSVFormatter csvformat  = new CSVFormatter(csvCulture);

            // Create Header
            bool confidentialityAffected       = PollutantTransferTrend.IsAffectedByConfidentiality(FacilityBasic.FacilityID, PollutantCode);
            Dictionary <string, string> header = CsvHeaderBuilder.GetFacilityTrendHeader(FacilityBasic.FacilityReportId, true);

            // Create Body
            string pollutantName = LOVResources.PollutantName(PollutantCode);
            List <TimeSeriesClasses.PollutantTransfers> data = getTimeSeriesData(FacilityBasic.FacilityID, PollutantCode);

            // dump to file
            string topheader       = csvformat.CreateHeader(header);
            string pollutantHeader = csvformat.GetPollutantTransfersTrendHeader();

            Response.WriteUtf8FileHeader("EPRTR_Pollutant_Transfers_Time_Series");

            Response.Write(topheader + pollutantHeader);
            foreach (var v in data)
            {
                string row = csvformat.GetPollutantTransfersTrendRow(v, pollutantName);
                Response.Write(row);
            }
            Response.End();
        }
        catch
        {
        }
    }
    /// <summary>
    /// Populate charts. Selected year in compare dropdown will be searchyear
    /// </summary>
    public void Populate(PollutantTransferTimeSeriesFilter filter, int?searchYear)
    {
        SearchFilter = filter;
        SearchYear   = searchYear;

        initializeContentLinks();

        //Only determine once and store in viewstate
        ConfidentialityAffected = PollutantTransferTrend.IsAffectedByConfidentiality(filter);
        // show timeseries as default
        showContent(Sheets.TimeSeries.TimeSeries.ToString());
    }