private void showContent(string command)
    {
        hideSubControls();

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

        bool conf = PollutantReleaseTrend.IsAffectedByConfidentiality(FacilityBasic.FacilityID, PollutantCode, CurrentMedium);

        string alert = conf ? Resources.GetGlobal("Common", "ConfidentialityAlertLink") : string.Empty;

        if (command.Equals(TrendReleaseContent.TimeSeries.ToString()))
        {
            this.litHeadline.Text   = Resources.GetGlobal("Facility", "PollutantReleaseTimeSeries");
            ViewState[CONTENT_TYPE] = TrendReleaseContent.TimeSeries;
        }
        else if (command.Equals(TrendReleaseContent.Comparison.ToString()))
        {
            this.litHeadline.Text   = Resources.GetGlobal("Facility", "PollutantReleaseComparison");
            ViewState[CONTENT_TYPE] = TrendReleaseContent.Comparison;
        }
        else if (command.Equals(TrendReleaseContent.Confidentiality.ToString()))
        {
            this.litHeadline.Text = Resources.GetGlobal("Facility", "PollutantReleaseConfidentiality");
            this.ucContentConfidentiality.Visible = true;
            this.ucContentConfidentiality.Populate(FacilityBasic.FacilityID, PollutantCode, CurrentMedium);

            ViewState[CONTENT_TYPE] = TrendReleaseContent.Confidentiality;
            alert = string.Empty;
        }

        updateHeader(txt);
        updateAlert(alert);
    }
Beispiel #2
0
 /// <summary>
 /// Populate charts. Selected year in compare dropdown will be searchyear
 /// </summary>
 public void Populate(PollutantReleasesTimeSeriesFilter filter, int?searchYear)
 {
     SearchFilter = filter;
     SearchYear   = searchYear;
     initializeContentLinks();
     //Only determine once and store in viewstate
     ConfidentialityAffected = PollutantReleaseTrend.IsAffectedByConfidentiality(filter);
     // show timeseries as default
     showContent(Sheets.TimeSeries.TimeSeries.ToString());
 }
    private void showContent(PollutantReleasesTimeSeriesFilter filter, MediumFilter.Medium medium)
    {
        CurrentMedium = medium;

        //examine if there exists any confidential data for the medium given
        bool hasConfidentialInformationMedium = PollutantReleaseTrend.IsAffectedByConfidentiality(filter, medium);

        this.divConfidentialityInformation.Visible   = hasConfidentialInformationMedium;
        this.divNoConfidentialityInformation.Visible = !hasConfidentialInformationMedium;

        if (hasConfidentialInformationMedium)
        {
            this.lvConfidentiality.DataSource = PollutantReleaseTrend.GetConfidentialTimeSeries(filter, medium);
            this.lvConfidentiality.DataBind();
        }
    }
Beispiel #4
0
    /// <summary>
    /// Save release data
    /// </summary>
    protected void doSave(object sender, EventArgs e)
    {
        try
        {
            CultureInfo  csvCulture = CultureResolver.ResolveCsvCulture(Request);
            CSVFormatter csvformat  = new CSVFormatter(csvCulture);

            // Check if current medium is affected confidentiality claims
            bool confidentialityAffected = PollutantReleaseTrend.IsAffectedByConfidentiality(
                SearchFilter,
                CurrentMedium);

            // Create Header
            var header = CsvHeaderBuilder.GetTsPollutantReleasesSearchHeader(SearchFilter,
                                                                             CurrentMedium,
                                                                             confidentialityAffected);

            var data = PollutantReleaseTrend.GetTimeSeries(SearchFilter, CurrentMedium);

            string mediumName    = LOVResources.MediumName(EnumUtil.GetStringValue(CurrentMedium));
            var    pollutant     = ListOfValues.GetPollutant(SearchFilter.PollutantFilter.PollutantID);
            string pollutantName = LOVResources.PollutantName(pollutant.Code);

            // dump to file
            string topheader  = csvformat.CreateHeader(header);
            string rowheaders = csvformat.GetPollutantReleasesTimeSeriesHeader();

            Response.WriteUtf8FileHeader("EPRTR_Pollutant_Releases_Time_Series");

            Response.Write(topheader + rowheaders);

            foreach (var v in data)
            {
                string row = csvformat.GetPollutantReleasesTimeSeriesRow(v, pollutantName, mediumName);
                Response.Write(row);
            }
            Response.End();
        }
        catch
        {
        }
    }
Beispiel #5
0
    /// <summary>
    /// Save
    /// </summary>
    protected void doSave(object sender, EventArgs e)
    {
        try
        {
            CultureInfo  csvCulture = CultureResolver.ResolveCsvCulture(Request);
            CSVFormatter csvformat  = new CSVFormatter(csvCulture);

            // Create Header
            int    facilityReportId = (int)ViewState[FACILITY_REPORTID];
            string pollutantCode    = PollutantCode;

            bool confidentialityAffected       = PollutantReleaseTrend.IsAffectedByConfidentiality(FacilityBasic.FacilityID, PollutantCode, CurrentMedium);
            Dictionary <string, string> header = CsvHeaderBuilder.GetFacilityTrendHeader(facilityReportId, confidentialityAffected);

            // Create Body
            string mediumName    = LOVResources.MediumName(EnumUtil.GetStringValue(CurrentMedium));
            string codeEPER      = pollutantCode + "EPER";
            string pollutantName = LOVResources.PollutantNameEPER(pollutantCode, codeEPER);
            List <TimeSeriesClasses.PollutantReleases> data = getTimeSeriesData(FacilityBasic.FacilityID, CurrentMedium);

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

            Response.WriteUtf8FileHeader("EPRTR_Pollutant_Releases_Time_Series");

            Response.Write(topheader + pollutantHeader);

            foreach (var v in data)
            {
                string row = csvformat.GetPollutantReleaseTrendRow(v, pollutantName, mediumName);
                Response.Write(row);
            }
            Response.End();
        }
        catch
        {
        }
    }