Beispiel #1
0
        /// <summary>
        /// Updates SAM WeatherYear from TBD WeatherYear
        /// </summary>
        /// <param name="weatherYear">Destination SAM WeatherYear</param>
        /// <param name="weatherYear_TBD">Source TBD WeatherYear</param>
        /// <returns>True if data Updated</returns>
        public static bool Update(this WeatherYear weatherYear, TBD.WeatherYear weatherYear_TBD)
        {
            if (weatherYear == null || weatherYear_TBD == null)
            {
                return(false);
            }

            weatherYear.Year = weatherYear_TBD.year;

            List <TBD.WeatherDay> weatherDays_TBD = weatherYear_TBD.WeatherDays();

            for (int i = 0; i < weatherDays_TBD.Count; i++)
            {
                WeatherDay weatherDay = weatherYear[i];
                if (weatherDay == null)
                {
                    weatherDay = new WeatherDay();
                }

                Update(weatherDay, weatherDays_TBD[i]);

                weatherYear[i] = weatherDay;
            }

            return(true);
        }
Beispiel #2
0
        /// <summary>
        /// Updates TBD WeatherYear from SAM WeatherYear
        /// </summary>
        /// <param name="weatherYear_TBD">Destination TBD WeatherYear</param>
        /// <param name="weatherYear">Source SAM WeatherYear</param>
        /// <returns>True if data Updated</returns>
        public static bool Update(this TBD.WeatherYear weatherYear_TBD, WeatherYear weatherYear)
        {
            if (weatherYear_TBD == null || weatherYear == null)
            {
                return(false);
            }

            List <TBD.WeatherDay> weatherDays_TBD = weatherYear_TBD.WeatherDays();

            if (weatherDays_TBD == null)
            {
                return(false);
            }

            for (int i = 0; i < weatherDays_TBD.Count; i++)
            {
                Update(weatherDays_TBD[i], weatherYear[i]);
            }

            return(true);
        }