public static void ToAirDayData(CityDayAQIPublishLive source, AirDayData target) { target.Code = source.CityCode; target.Name = source.Area; target.Time = source.TimePoint; try { if (source.SO2_24h != ConfigHelper.EmptyValueString) { target.SO2 = decimal.Parse(source.SO2_24h); } if (source.NO2_24h != ConfigHelper.EmptyValueString) { target.NO2 = decimal.Parse(source.NO2_24h); } if (source.PM10_24h != ConfigHelper.EmptyValueString) { target.PM10 = decimal.Parse(source.PM10_24h); } if (source.CO_24h != ConfigHelper.EmptyValueString) { target.CO = decimal.Parse(source.CO_24h); } if (source.O3_8h_24h != ConfigHelper.EmptyValueString) { target.O38H = decimal.Parse(source.O3_8h_24h); } if (source.PM2_5_24h != ConfigHelper.EmptyValueString) { target.PM25 = decimal.Parse(source.PM2_5_24h); } } catch (Exception e) { LogHelper.Logger.Error("CityDayAQIPublishLive To AirDayData", e); } }
public static AirDayAQIRankData ToAirDayAQIRankData(CityDayAQIPublishLive src) { AirDayAQIRankData data = new AirDayAQIRankData(); ToAirDayAQIData(src, data); return data; }
public static void ToAirDayAQIData(CityDayAQIPublishLive source, AirDayAQIData target) { ToAirDayData(source, target); try { if (source.AQI != ConfigHelper.EmptyValueString) { target.AQI = int.Parse(source.AQI); } } catch (Exception e) { LogHelper.Logger.Error("CityDayAQIPublishLive To AirDayAQIData", e); } target.PrimaryPollutant = source.PrimaryPollutant; target.Type = source.Quality; target.Effect = source.Unheathful; target.Measure = source.Measure; }