private void InsertIntoDB()
        {
            if (Weather == null)
            {
                App.Current.MainPage.DisplayAlert("Error", "El Objeto a Insertar esta vacio.", "OK");
                return;
            }

            try
            {
                var history = new WeatherHistoric
                {
                    City            = Weather.location.name,
                    Country         = Weather.location.country,
                    LastConsultDate = DateTime.UtcNow
                };
                this.DataContext.Insert(history);
            }
            catch (Exception e)
            {
                App.Current.MainPage.DisplayAlert("Error", e.Message, "OK");
            }
        }
示例#2
0
 internal void Update(WeatherHistoric item)
 {
     database.UpdateAsync(item).Wait();
 }
示例#3
0
 public void Insert(WeatherHistoric item)
 {
     database.InsertAsync(item).Wait();
 }