/// <summary> /// Save transfers data /// </summary> protected void doSave(object sender, EventArgs e) { try { CultureInfo csvCulture = CultureResolver.ResolveCsvCulture(Request); CSVFormatter csvformat = new CSVFormatter(csvCulture); // Create Header var header = CsvHeaderBuilder.GetTsPollutantTransfersSearchHeader(SearchFilter, ConfidentialityAffected); var data = PollutantTransferTrend.GetTimeSeries(SearchFilter); var pollutant = ListOfValues.GetPollutant(SearchFilter.PollutantFilter.PollutantID); string pollutantName = LOVResources.PollutantName(pollutant.Code); // dump to file string topheader = csvformat.CreateHeader(header); string rowheaders = csvformat.GetPollutantTransfersTimeSeriesHeader(); Response.WriteUtf8FileHeader("EPRTR_Pollutant_Transfers_Time_Series"); Response.Write(topheader + rowheaders); foreach (var v in data) { string row = csvformat.GetPollutantTransfersTimeSeriesRow(v, pollutantName); Response.Write(row); } Response.End(); } catch { } }
protected void OnConfDatabinding(object sender, EventArgs args) { Control headerGroup = this.lvConfidentiality.FindControl("divPollutantGroupHeader"); headerGroup.Visible = ShowGroup; string pollutantCode = PollutantCode; if (!String.IsNullOrEmpty(pollutantCode)) { Label lbPollutant = this.lvConfidentiality.FindControl("lbPollutant") as Label; if (lbPollutant != null) { lbPollutant.Text = LOVResources.PollutantName(pollutantCode); } } if (ShowGroup) { Label lbPollutantGroup = this.lvConfidentiality.FindControl("lbPollutantGroup") as Label; if (lbPollutantGroup != null) { lbPollutantGroup.Text = LOVResources.PollutantName(ParentCode); } } }
/// <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 { } }
private void populatePollutants() { this.cbPollutant.Items.Clear(); //int startYear = 2001; int endYear = 2004; int groupID = Convert.ToInt32(this.cbPollutantGroup.SelectedItem.Value); IEnumerable <LOV_POLLUTANT> pollutants = QueryLayer.ListOfValues.GetLeafPollutants(groupID).Where(x => x.EndYear != endYear); //.Where(x => x.StartYear >= startYear); if (includeAll) { this.cbPollutant.Items.Add(new ListItem(Resources.GetGlobal("Common", "AllPollutants"), PollutantFilter.AllPollutantsInGroupID.ToString())); } foreach (LOV_POLLUTANT p in pollutants) { this.cbPollutant.Items.Add(new ListItem(LOVResources.PollutantName(p.Code), p.LOV_PollutantID.ToString())); } //add option for confidential within group if (groupID != PollutantFilter.AllGroupsID) { this.cbPollutant.Items.Add(new ListItem(Resources.GetGlobal("Common", "ConfidentialInGroup"), groupID.ToString())); } setSelectedPollutant(); }
//creates header for Pollutant filter and adds to dictionary protected static void addPollutant(Dictionary <string, string> header, PollutantFilter filter) { if (filter != null) { string key = Resources.GetGlobal("Common", "Pollutant"); string value = string.Empty; PollutantFilter.Level level = filter.SearchLevel(); if (level == PollutantFilter.Level.All) { value = Resources.GetGlobal("Common", "AllPollutants"); } else if (level == PollutantFilter.Level.PollutantGroup) { value = LOVResources.PollutantGroupName(ListOfValues.GetPollutant(filter.PollutantGroupID).Code); } else { value = LOVResources.PollutantName(ListOfValues.GetPollutant(filter.PollutantID).Code); } header.Add(key, value); } }
//creates header for Pollutant filter and adds to dictionary protected static void addPollutant(Dictionary <string, string> header, string pollutantCode) { if (!string.IsNullOrEmpty(pollutantCode)) { string key = Resources.GetGlobal("Common", "Pollutant"); string value = LOVResources.PollutantName(pollutantCode); header.Add(key, value); } }
protected string GetName(object obj) { PollutantReleases.ReleasesTreeListRow row = (PollutantReleases.ReleasesTreeListRow)obj; if (row.HasChildren) //this is a pollutant group { return(LOVResources.PollutantGroupName(row.Code) + " " + GetGroupCount(row)); } else { return(LOVResources.PollutantName(row.Code)); } }
/// <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 { } }
/// <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 pollutantName = LOVResources.PollutantName(pollutantCode); 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 { } }
protected string GetPollutantName(object obj) { FACILITYDETAIL_POLLUTANTRELEASE row = (FACILITYDETAIL_POLLUTANTRELEASE)obj; return(LOVResources.PollutantName(row.PollutantCode)); }
protected string GetPTPollutantName(object obj) { IndustrialActivity.ConfidentialTransfersRow row = (IndustrialActivity.ConfidentialTransfersRow)obj; return(LOVResources.PollutantName(row.PollutantCode)); }
protected string GetPollutantName(object obj) { PollutantReleases.ConfidentialTotal row = (PollutantReleases.ConfidentialTotal)obj; return(LOVResources.PollutantName(row.Code)); }
protected string GetPollutantName(object obj) { PollutantTransfers.TransfersConfidentialRow row = (PollutantTransfers.TransfersConfidentialRow)obj; return(LOVResources.PollutantName(row.Code)); }
/// <summary> /// Header tooltip for pollutant /// </summary> protected string GetColNameToolTip(object obj) { KeyValuePair <string, string> row = (KeyValuePair <string, string>)obj; return(LOVResources.PollutantName(row.Key)); }