Exemple #1
0
        public async void ReadAttivita()
        {
            var activities = await DatabaseToDoHelper.ReadAttivita();

            Activities.Clear();
            foreach (var s in activities)
            {
                Activities.Add(s);
            }
        }
Exemple #2
0
        private async void Delete(object parameter)
        {
            bool result = await DatabaseToDoHelper.DeleteAttivita(Attivita);

            if (result)
            {
                await App.Current.MainPage.Navigation.PopAsync();
            }
            else
            {
                await App.Current.MainPage.DisplayAlert("Error", "There was an error, please try again", "Ok");
            }
        }
Exemple #3
0
        private void SaveAttivita(object obj)
        {
            bool result = DatabaseToDoHelper.InsertAttivita(new Model.Attivita
            {
                Name        = Name,
                Description = Description,
                Source      = Source,
                Scadenza    = Scadenza
            });

            if (result)
            {
                App.Current.MainPage.Navigation.PopAsync();
            }
            else
            {
                App.Current.MainPage.DisplayAlert("Error", "Something went wrong, please try again", "Ok");
            }
        }