/// <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 codeEPER = PollutantCode + "EPER"; string pollutantName = LOVResources.PollutantNameEPER(PollutantCode, codeEPER); 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 { } }
protected string GetPollutantName(object obj) { FACILITYDETAIL_POLLUTANTTRANSFER row = (FACILITYDETAIL_POLLUTANTTRANSFER)obj; string codeEPER = row.PollutantCode + "EPER"; //return LOVResources.PollutantName(row.PollutantCode); return(LOVResources.PollutantNameEPER(row.PollutantCode, codeEPER)); }
protected static void addPollutantEPER(Dictionary <string, string> header, string pollutantCodeEPER, string pollutantCode) { if (!string.IsNullOrEmpty(pollutantCode)) { string key = Resources.GetGlobal("Common", "ContentEmissions"); string value = LOVResources.PollutantNameEPER(pollutantCode, pollutantCodeEPER); header.Add(key, value); } }
protected string GetPollutantName(object obj) { FACILITYDETAIL_POLLUTANTRELEASE row = (FACILITYDETAIL_POLLUTANTRELEASE)obj; string codeEPER = row.PollutantCode; if (!codeEPER.EndsWith("EPER")) { codeEPER = codeEPER + "EPER"; } //return LOVResources.PollutantName(row.PollutantCode); return(LOVResources.PollutantNameEPER(row.PollutantCode, codeEPER)); }
/// <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 { } }