Пример #1
0
 /// <summary>
 /// Initialize model converting Newton Model respectively
 /// </summary>
 /// <param name="d">Newton model object</param>
 public ForecastCard(Newton.ForecastCardNewton d)
 {
     strDate       = d.forecast_date;
     saved         = true;
     icon          = d.icon;
     location      = d.forecast_location;
     temperature   = d.temperature;
     summary       = d.summary;
     humidity      = d.humidity;
     windSpeed     = d.wind_speed;
     windDirection = d.wind_direction;
     waterLevel    = d.water_level;
 }
Пример #2
0
 /// <summary>
 /// Converts ForecastCard model to JSON model
 /// </summary>
 /// <param name="user_email">User email</param>
 /// <param name="f">Forecast card model instance</param>
 /// <returns>Newton model</returns>
 public static Newton.ForecastCardNewton ForecastCard_To_ForecastCardNewton(string user_email, ForecastCard f)
 {
     Newton.ForecastCardNewton result = new Newton.ForecastCardNewton();
     result.user_email        = user_email;
     result.forecast_date     = f.DateFormated;
     result.icon              = f.Icon;
     result.forecast_location = f.Location;
     result.temperature       = f.Temperature;
     result.summary           = f.Summary;
     result.humidity          = f.Humidity;
     result.wind_speed        = f.WindSpeed;
     result.wind_direction    = f.WindDirection;
     result.water_level       = f.WaterLevel;
     return(result);
 }