示例#1
0
 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);
     }
 }
示例#2
0
 public static AirDayData ToAirDayData(AQIDataPublishLive src)
 {
     AirDayData data = new AirDayData();
     ToAirDayData(src, data);
     return data;
 }