private async void PopulateBtn_Click(object sender, RoutedEventArgs e)
        {
            string json = await WeatherConnection.LoadTimeZoneAsync(33, 113, 50);

            JObject data        = JObject.Parse(json);
            var     cities      = from p in data["list"] select(string) p["name"];
            var     weathers    = from p in data["list"] select(string) p["weather"][0]["description"];
            var     temperature = from p in data["list"] select(string) p["main"]["temp"];

            int maxID = weatherDB.weather_table.Max(p => p.ID);

            for (int i = 0; i < cities.Count(); ++i)
            {
                weather_table temp = new weather_table()
                {
                    ID            = ++maxID,
                    city          = cities.ElementAt(i),
                    weather_descr = weathers.ElementAt(i),
                    temp          = (int)float.Parse(temperature.ElementAt(i), CultureInfo.InvariantCulture.NumberFormat)
                };
                weatherDB.weather_table.Add(temp);
            }
            weatherDB.SaveChanges();
            weather_tableViewSource.View.Refresh();
        }
 private void DBBtn_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         int           maxID = weatherDB.weather_table.Max(p => p.ID);
         weather_table temp  = new weather_table()
         {
             ID            = maxID + 1,
             city          = cityTextBox.Text,
             weather_descr = weather_descrTextBox.Text,
             temp          = Int32.Parse(tempTextBox.Text)
         };
         weatherDB.weather_table.Add(temp);
         weatherDB.SaveChanges();
         weather_tableViewSource.View.Refresh();
     }
     catch (Exception ex)
     {
         viewBox.Text = ex.Message;
     }
 }