Exemplo n.º 1
0
 //creates header for facility country and adds to dictionary
 protected static void addFacilityCountry(Dictionary <string, string> header, Facility.FacilityBasic basic)
 {
     if (basic != null)
     {
         header.Add(Resources.GetGlobal("Common", "Country"), LOVResources.CountryName(basic.CountryCode));
     }
 }
Exemplo n.º 2
0
 //creates header for facility address and adds to dictionary
 protected static void addFacilityAddress(Dictionary <string, string> header, Facility.FacilityBasic basic)
 {
     if (basic != null)
     {
         header.Add(Resources.GetGlobal("Facility", "FacilityAddress"), AddressFormat.Format(basic.Address, basic.City, basic.PostalCode, basic.Confidential));
     }
 }
Exemplo n.º 3
0
 //creates header for facility name and adds to dictionary
 protected static void addFacilityName(Dictionary <string, string> header, Facility.FacilityBasic basic)
 {
     if (basic != null)
     {
         header.Add(Resources.GetGlobal("Facility", "FacilityName"), ConfidentialFormat.Format(basic.FacilityName, basic.Confidential));
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// returns a dictionary with sheet headers <key, value> for facility details
        /// </summary>
        public static Dictionary <string, string> GetFacilityDetailWasteTrendHeader(Facility.FacilityBasic facilityBasic, WasteTypeFilter.Type wasteType)
        {
            Dictionary <string, string> header = new Dictionary <string, string>();

            addFacilityName(header, facilityBasic);
            addFacilityAddress(header, facilityBasic);
            addFacilityCountry(header, facilityBasic);
            addWasteType(header, wasteType);
            return(header);
        }
Exemplo n.º 5
0
    //set prevoius/next year
    private void setYears()
    {
        Facility.FacilityBasic basic = FacilityBasic;

        if (basic != null)
        {
            List <Facility.FacilityReportingYear> fys = Facility.GetReportingYears(basic.FacilityID).ToList();

            this.divYearLinks.Visible = fys.Count() > 1;

            if (fys.Count() > 1)
            {
                int currentYear = basic.ReportingYear;

                this.litYear.Text = currentYear.ToString();

                //find previous year
                PreviousYear = null;
                List <Facility.FacilityReportingYear> fysPrevious = fys.Where(y => y.ReportingYear < currentYear).ToList();
                if (fysPrevious != null && fysPrevious.Count() > 0)
                {
                    PreviousYear = fysPrevious.OrderBy(y => y.ReportingYear).Last();
                }

                //find next year
                NextYear = null;
                List <Facility.FacilityReportingYear> fysNext = fys.Where(y => y.ReportingYear > currentYear).ToList();
                if (fysNext != null && fysNext.Count() > 0)
                {
                    NextYear = fysNext.OrderBy(y => y.ReportingYear).First();
                }

                //hide or show links
                if (PreviousYear != null)
                {
                    lnbPrevious.Visible = true;
                }
                else
                {
                    lnbPrevious.Visible = false;
                }

                if (NextYear != null)
                {
                    lnbNext.Visible = true;
                }
                else
                {
                    lnbNext.Visible = false;
                }
            }
        }
    }
Exemplo n.º 6
0
        /// <summary>
        /// returns a dictionary with sheet headers <key, value> for the facility given
        /// </summary>
        public static Dictionary <string, string> GetFacilityDetailHeader(Facility.FacilityBasic facilityBasic)
        {
            Dictionary <string, string> header = new Dictionary <string, string>();

            if (facilityBasic != null)
            {
                addFacilityName(header, facilityBasic);
                addFacilityAddress(header, facilityBasic);
                addFacilityCountry(header, facilityBasic);
                addFacilityYear(header, facilityBasic);
                addRegulation(header, facilityBasic.ReportingYear);
            }

            return(header);
        }
Exemplo n.º 7
0
    /// <summary>
    /// Search, fill data into summery
    /// </summary>
    public void Populate(int facilityReportId, string pollutantCode, int searchYear)
    {
        FacilityBasic         = Facility.GetFacilityBasic(facilityReportId);
        PollutantCode         = pollutantCode;
        SearchYear            = searchYear;
        ViewState[TIMESERIES] = null;

        // first sheet is the time series sheet
        showContent(TrendTransferContent.TimeSeries.ToString());

        // set the year according to search. Include EPER
        List <int> years = ListOfValues.ReportYearsSeries().ToList();

        this.ucYearCompareSeries.Initialize(years, searchYear);
    }
Exemplo n.º 8
0
        /// <summary>
        /// returns a dictionary with csv headers <key, value> for facility details
        /// </summary>
        public static Dictionary <string, string> GetFacilityTrendHeader(
            int facilityReportId,
            bool confidentialityAffected)
        {
            Facility.FacilityBasic basic = Facility.GetFacilityBasic(facilityReportId);

            Dictionary <string, string> header = makeHeader();

            addFacilityIdentification(header, basic);
            addFacilityName(header, basic);
            addFacilityAddress(header, basic);
            addFacilityCountry(header, basic);
            addConfidentiality(header, confidentialityAffected);

            return(header);
        }
Exemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string facilityReportId = Request.Params["FacilityReportId"];
        string facilityId       = Request.Params["FacilityId"];
        string reportingYear    = Request.Params["ReportingYear"];

        if (!IsPostBack)
        {
            ucFacilitySheet.Visible     = false;
            ucFacilitySheetEPER.Visible = false;

            //load facility basics
            if (!String.IsNullOrEmpty(facilityReportId))
            {
                int facRepId = Convert.ToInt32(facilityReportId);
                FacilityBasic = Facility.GetFacilityBasic(facRepId);
            }
            else if (!String.IsNullOrEmpty(facilityId) && !String.IsNullOrEmpty(reportingYear))
            {
                int facId = Convert.ToInt32(facilityId);
                int year  = Convert.ToInt32(reportingYear);
                FacilityBasic = Facility.GetFacilityBasic(facId, year);
            }
            //RRP START-18-04-2013
            //Code to create a bookmarkable link for the latest report for a facility without the year.
            //The problem with the year is that we can expect links to facilities from other websites to be unchanged effectively forever.
            //Therefore they will link to pages that are become more and more obsolete.
            //With this link, all external applications can access to the
            //Facility details without the year parameter. The URL access to the last documented year.
            else if (!String.IsNullOrEmpty(facilityId) && String.IsNullOrEmpty(reportingYear))
            {
                int facId = Convert.ToInt32(facilityId);
                //int year = Convert.ToInt32(reportingYear);
                int year = Facility.GetMaxYearFacilityId(facId);
                FacilityBasic = Facility.GetFacilityBasic(facId, year);
            }
            //RRP END-18-04-2013


            //pouplate
            populateTitle();
            populateSheet();
        }
    }
Exemplo n.º 10
0
        //creates header for facility reproting year and adds to dictionary
        protected static void addFacilityYear(Dictionary <string, string> header, Facility.FacilityBasic basic)
        {
            if (basic != null)
            {
                string key = Resources.GetGlobal("Common", "Year");

                string published;
                if (basic.Published.HasValue)
                {
                    published = string.Format("{0}: {1}", Resources.GetGlobal("Common", "Published"), basic.Published.Format());
                }
                else
                {
                    published = Resources.GetGlobal("Common", "NotPublished");
                }
                string value = string.Format("{0} ({1})", basic.ReportingYear.ToString(), published);

                header.Add(key, value);
            }
        }
Exemplo n.º 11
0
        public static Dictionary <string, string> GetFacilityDetailPollutantTrendHeaderEPER(Facility.FacilityBasic facilityBasic, string pollutantCodeEPER, string pollutantCode)
        {
            Dictionary <string, string> header = new Dictionary <string, string>();

            addFacilityName(header, facilityBasic);
            addFacilityAddress(header, facilityBasic);
            addFacilityCountry(header, facilityBasic);
            addPollutantEPER(header, pollutantCodeEPER, pollutantCode);
            return(header);
        }
Exemplo n.º 12
0
    private void showContent(string command)
    {
        Content = command;
        hideSubControls();
        this.ucSheetLinks.HighLight(command);
        string   txt        = string.Empty;
        string   alert      = string.Empty;
        string   disclaimer = string.Empty;
        InfoType?info       = null;
        string   headline   = string.Empty;

        this.ucSheetTitleIcon.ImageURL = null;

        Facility.FacilityBasic basic = FacilityBasic;

        if (basic != null)
        {
            int facilityReportID = basic.FacilityReportId;
            int year             = basic.ReportingYear;

            if (command == Sheets.FacilityDetails.Details.ToString())
            {
                headline = Resources.GetGlobal("Facility", "FacilitylevelDetails");
                this.ucSheetTitleIcon.ImageURL = null;
                info = null;
                this.ucFacilityDetails.Populate(facilityReportID);
                //this.ucFacilityDetails.reloadMap(facilityReportID);



                this.ucFacilityDetails.Visible = true;
                disclaimer = CMSTextCache.CMSText("Facility", "DisclaimerTextFacilityDetails");
                alert      = basic.Confidential ? Resources.GetGlobal("Facility", "ConfidentialityAlertLink") : string.Empty;

                this.ucDetailPrint.SetClientClick(this.ucFacilityDetails.DetailMapUniqueID, this.ucFacilityDetails.DetailMapUrlName);
                this.ucDetailPrint.SetPrintControl(this);
            }
            else if (command == Sheets.FacilityDetails.PollutantReleases.ToString())
            {
                headline = Resources.GetGlobal("Facility", "FacilitylevelPollutantreleases");
                this.ucSheetTitleIcon.ImageURL = "~/images/SheetTitleIcon_PollutantRelease.png";
                info = InfoType.Pollutant;
                this.ucFacilityPollutantReleases.Visible = true;
                this.ucFacilityPollutantReleases.PopulateLists(facilityReportID, year);
                disclaimer = CMSTextCache.CMSText("Facility", "DisclaimerTextPollutantReleases");
                txt        = Resources.GetGlobal("Pollutant", "AllValuesAreYearlyReleases");
                alert      = basic.PollutantReleaseConfidential ? Resources.GetGlobal("Facility", "ConfidentialityAlertLink") : string.Empty;
                this.ucDetailPrint.SetClientClick();
                this.ucDetailPrint.SetPrintControl(this);
            }
            else if (command == Sheets.FacilityDetails.PollutantTransfers.ToString())
            {
                headline = Resources.GetGlobal("Facility", "FacilitylevelPollutanttransfers");
                this.ucSheetTitleIcon.ImageURL = "~/images/SheetTitleIcon_PollutantTransfer.png";
                info = InfoType.Pollutant;
                this.ucFacilityPollutantTransfers.Visible = true;
                this.ucFacilityPollutantTransfers.PopulateLists(facilityReportID, year);
                disclaimer = CMSTextCache.CMSText("Facility", "DisclaimerTextPollutantTransfers");
                txt        = Resources.GetGlobal("Pollutant", "AllValuesAreYearlyTransfers");
                alert      = basic.PollutantTransferConfidential ? Resources.GetGlobal("Facility", "ConfidentialityAlertLink") : string.Empty;
                this.ucDetailPrint.SetClientClick();
                this.ucDetailPrint.SetPrintControl(this);
            }
            else if (command == Sheets.FacilityDetails.Waste.ToString())
            {
                headline = Resources.GetGlobal("Facility", "FacilitylevelWaste");
                this.ucSheetTitleIcon.ImageURL = "~/images/SheetTitleIcon_WasteTransfer.png";
                info = null;
                this.ucFacilityWaste.Visible = true;
                this.ucFacilityWaste.Populate(facilityReportID, year);
                disclaimer = CMSTextCache.CMSText("Facility", "DisclaimerTextWaste");
                txt        = Resources.GetGlobal("WasteTransfers", "AllValuesAreYearlyTransfers");
                alert      = basic.WasteConfidential ? Resources.GetGlobal("Facility", "ConfidentialityAlertLink") : string.Empty;
                this.ucDetailPrint.SetClientClick();
                this.ucDetailPrint.SetPrintControl(this);
            }
            else if (command == Sheets.FacilityDetails.Confidentiality.ToString())
            {
                headline = Resources.GetGlobal("Facility", "FacilitylevelConfidentiality");
                this.ucSheetTitleIcon.ImageURL = null;
                info = null;
                this.ucFacilityConfidentiality.Visible = true;
                disclaimer = CMSTextCache.CMSText("Facility", "DisclaimerTextConfidentiality");
                alert      = string.Empty;
                this.ucDetailPrint.SetClientClick();
                this.ucDetailPrint.SetPrintControl(this);
            }
            else
            {
                headline = Resources.GetGlobal("Facility", "FacilitylevelDetails");
            }
        }
        else
        {
            headline = Resources.GetGlobal("Facility", "FacilitylevelNotFound");
        }

        this.litHeadline.Text            = headline;
        this.ucDisclaimer.DisclaimerText = disclaimer;
        setInfoIcon(info);
        updateHeader(txt);
        updateAlert(alert);
    }
Exemplo n.º 13
0
    private void showContent(string command)
    {
        Content = command;
        hideSubControls();
        this.ucSheetLinks.HighLight(command);
        string       txt        = string.Empty;
        string       alert      = string.Empty;
        string       disclaimer = string.Empty;
        InfoTypeEPER?info       = null;
        //InfoDisclaimerTypeEPER? info1 = null;
        string headline = string.Empty;

        this.ucSheetTitleIcon.ImageURL = null;

        Facility.FacilityBasic basic = FacilityBasic;

        if (basic != null)
        {
            int facilityReportID = basic.FacilityReportId;
            int year             = basic.ReportingYear;

            if (command == Sheets.FacilityDetails.Details.ToString())
            {
                headline = Resources.GetGlobal("Facility", "FacilitylevelDetails");
                this.ucSheetTitleIcon.ImageURL = null;
                info = null;

                this.ucFacilityDetailsEPER.Populate(facilityReportID);
                this.ucFacilityDetailsEPER.Visible = true;
                disclaimer = CMSTextCache.CMSText("Facility", "DisclaimerTextFacilityDetailsEmissions");

                this.ucDetailPrint.SetClientClick(this.ucFacilityDetailsEPER.DetailMapUniqueID, this.ucFacilityDetailsEPER.DetailMapUrlName);
                this.ucDetailPrint.SetPrintControl(this);
            }
            else if (command == Sheets.FacilityDetails.Emissions.ToString())
            {
                headline = Resources.GetGlobal("Facility", "FacilityEmissionsEPER");
                this.ucSheetTitleIcon.ImageURL = "~/images/SheetTitleIcon_Emissions.png";
                info = InfoTypeEPER.Pollutant;
                this.ucFacilityEmissionsEPER.Visible = true;
                this.ucFacilityEmissionsEPER.PopulateLists(facilityReportID, year);
                disclaimer = CMSTextCache.CMSText("Facility", "DisclaimerTextEmmissionsDirect");
                txt        = Resources.GetGlobal("Pollutant", "AllValuesAreYearlyTransfersEPER");
                this.ucDetailPrint.SetClientClick();
                this.ucDetailPrint.SetPrintControl(this);
            }
            else if (command == Sheets.FacilityDetails.EmissionsTransfer.ToString())
            {
                headline = Resources.GetGlobal("Facility", "FacilitylevelPollutanttransfersEPER");
                this.ucSheetTitleIcon.ImageURL = "~/images/SheetTitleIcon_EmissionsIndirect.png";
                this.ucFacilityEmissionsTransfersEPER.Visible = true;
                this.ucFacilityEmissionsTransfersEPER.PopulateLists(facilityReportID, year);
                disclaimer = CMSTextCache.CMSText("Facility", "DisclaimerTextEmisionsIndirect");
                txt        = Resources.GetGlobal("Pollutant", "AllValuesAreYearlyEmissions");
                this.ucDetailPrint.SetClientClick();
                this.ucDetailPrint.SetPrintControl(this);
            }

            else
            {
                headline = Resources.GetGlobal("Facility", "FacilitylevelDetails");
            }
        }
        else
        {
            headline = Resources.GetGlobal("Facility", "FacilitylevelNotFound");
        }

        this.litHeadline.Text = headline;
        this.ucDisclaimerEPER.DisclaimerText = disclaimer;
        setInfoIconEPER(info);
        updateHeader(txt);
    }
Exemplo n.º 14
0
 //creates header for facility ids and adds to dictionary
 protected static void addFacilityIdentification(Dictionary <string, string> header, Facility.FacilityBasic basic)
 {
     if (basic != null)
     {
         header.Add(Resources.GetGlobal("Facility", "EPRTRFacilityID"), basic.FacilityID.ToString());
         header.Add(Resources.GetGlobal("Facility", "NationalID"), basic.NationalID);
     }
 }