Exemplo n.º 1
0
        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");
            }
        }
Exemplo n.º 2
0
 internal void Update(WeatherHistoric item)
 {
     database.UpdateAsync(item).Wait();
 }
Exemplo n.º 3
0
 public void Insert(WeatherHistoric item)
 {
     database.InsertAsync(item).Wait();
 }