Exemple #1
0
        public async void ReadCorsi()
        {
            var corsi = await DatabaseCorsiHelper.ReadCorsi();

            Corsi.Clear();
            foreach (var c in corsi)
            {
                Corsi.Add(c);
            }
        }
Exemple #2
0
        private async void Delete(object parameter)
        {
            bool result = await DatabaseCorsiHelper.DeleteCorso(Corso);

            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 SaveCorso(object obj)
        {
            bool result = DatabaseCorsiHelper.InsertCorso(new Model.Corso
            {
                Name      = Name,
                NameProf  = NameProf,
                EmailProf = EmailProf,
                NumCFU    = NumCFU
            });

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