public static AMEERequest getAMEERequest(int commodityId, String dataItemUid, decimal volume, String unit, String startDate, String endDate, String countryName) { AMEERequest aMEERequest = new AMEERequest(); String body = null; String strVolume = null; if (dataItemUid != null) { strVolume = "" + volume; strVolume = strVolume.Replace(',', '.'); body = "representation=full&name=bergen&dataItemUid=" + dataItemUid; } DimEmissionCategories dimCat = DimEmissionCategories.ameeDataPathDrillDown[commodityId]; aMEERequest.dataPath = dimCat.ameeDataPath; aMEERequest.dataPathDrillDown = dimCat.ameeDataPath + dimCat.ameeDrillDownURL; switch (commodityId) { // 1 case DimCommodities.Electricity: if (body != null) { body += getBodyBusinessEnergyElectricity(strVolume, unit); } aMEERequest.dataPathDrillDown += countryName; break; // 3 21 22 23 24 31 case DimCommodities.Oil: case DimCommodities.NaturalGas: case DimCommodities.LPG: case DimCommodities.Butane: case DimCommodities.HeatingOil: case DimCommodities.Propane: case DimCommodities.Coal: case DimCommodities.Biomass: if (body != null) { body += getBodyBusinessEnergyStationaryCombustion(strVolume, unit); } break; //53 case DimCommodities.FugitiveEmission: if (body != null) { body += getBodyFugitiveEmissions(strVolume, unit); } break; case DimCommodities.AirTravel: //32 if (body != null) { body += getBodyTransportGhgpPassenger(strVolume, unit); } break; // 33 34 35 36 case DimCommodities.Taxi: case DimCommodities.Train: case DimCommodities.Bus: case DimCommodities.Boat: if (body != null) { body += getBodyTransportGhgpPassenger(strVolume, unit); } break; // 38 39 40 41 case DimCommodities.FreightAir: case DimCommodities.FreightRoad: case DimCommodities.FreightTrain: case DimCommodities.FreightBoat: if (body != null) { body += getBodyTransportGhgpFreight(strVolume, unit); } break; // 42 43 44 45 46 47 case DimCommodities.RentalOrPrivateVehiculeCar: case DimCommodities.RentalOrPrivateVehiculeVan: case DimCommodities.RentalOrPrivateVehiculeTruck: case DimCommodities.CompanyVehicleMileageCar: case DimCommodities.CompanyVehicleMileageVan: case DimCommodities.CompanyVehicleMileageTruck: if (body != null) { body += getBodyTransportGhgpVehicleOther(strVolume, unit); } break; // 48 49 50 51 case DimCommodities.CompanyVehicleFuelPetrol: case DimCommodities.CompanyVehicleFuelDiesel: case DimCommodities.CompanyVehicleFuelLPG: case DimCommodities.CompanyVehicleFuelNaturalGas: if (body != null) { body += getBodyTransportGhgpFuel(strVolume, unit); } break; default: throw new Exception("This commodity ID [" + commodityId + "] is not yet supported"); } if (startDate != null) { body += "&startDate=" + startDate; } if (endDate != null) { body += "&endDate=" + endDate; } aMEERequest.body = body; return aMEERequest; }
public static AMEERequest getAMEERequest(int commodityId, String dataItemUid, decimal volume, String unit, String startDate, String endDate, String countryName) { AMEERequest aMEERequest = new AMEERequest(); String body = null; String strVolume = null; if (dataItemUid != null) { strVolume = "" + volume; strVolume = strVolume.Replace(',', '.'); body = "representation=full&name=bergen&dataItemUid=" + dataItemUid; } DimEmissionCategories dimCat = DimEmissionCategories.ameeDataPathDrillDown[commodityId]; aMEERequest.dataPath = dimCat.ameeDataPath; aMEERequest.dataPathDrillDown = dimCat.ameeDataPath + dimCat.ameeDrillDownURL; switch (commodityId) { // 1 case DimCommodities.Electricity: if (body != null) { body += getBodyBusinessEnergyElectricity(strVolume, unit); } aMEERequest.dataPathDrillDown += countryName; break; // 3 21 22 23 24 31 case DimCommodities.Oil: case DimCommodities.NaturalGas: case DimCommodities.LPG: case DimCommodities.Butane: case DimCommodities.HeatingOil: case DimCommodities.Propane: case DimCommodities.Coal: case DimCommodities.Biomass: if (body != null) { body += getBodyBusinessEnergyStationaryCombustion(strVolume, unit); } break; //53 case DimCommodities.FugitiveEmission: if (body != null) { body += getBodyFugitiveEmissions(strVolume, unit); } break; case DimCommodities.AirTravel: //32 if (body != null) { body += getBodyTransportGhgpPassenger(strVolume, unit); } break; // 33 34 35 36 case DimCommodities.Taxi: case DimCommodities.Train: case DimCommodities.Bus: case DimCommodities.Boat: if (body != null) { body += getBodyTransportGhgpPassenger(strVolume, unit); } break; // 38 39 40 41 case DimCommodities.FreightAir: case DimCommodities.FreightRoad: case DimCommodities.FreightTrain: case DimCommodities.FreightBoat: if (body != null) { body += getBodyTransportGhgpFreight(strVolume, unit); } break; // 42 43 44 45 46 47 case DimCommodities.RentalOrPrivateVehiculeCar: case DimCommodities.RentalOrPrivateVehiculeVan: case DimCommodities.RentalOrPrivateVehiculeTruck: case DimCommodities.CompanyVehicleMileageCar: case DimCommodities.CompanyVehicleMileageVan: case DimCommodities.CompanyVehicleMileageTruck: if (body != null) { body += getBodyTransportGhgpVehicleOther(strVolume, unit); } break; // 48 49 50 51 case DimCommodities.CompanyVehicleFuelPetrol: case DimCommodities.CompanyVehicleFuelDiesel: case DimCommodities.CompanyVehicleFuelLPG: case DimCommodities.CompanyVehicleFuelNaturalGas: if (body != null) { body += getBodyTransportGhgpFuel(strVolume, unit); } break; default: throw new Exception("This commodity ID [" + commodityId + "] is not yet supported"); } if (startDate != null) { body += "&startDate=" + startDate; } if (endDate != null) { body += "&endDate=" + endDate; } aMEERequest.body = body; return(aMEERequest); }