public async void ReadSubscriptions() { var subs = await DataBaseHelperService.GetSubscription(); Subscriptions.Clear(); foreach (var s in subs) { Subscriptions.Add(s); } }
private async void Delete(object parameter) { bool result = await DataBaseHelperService.DeleteSubscription(Subscription); if (result) { await App.Current.MainPage.Navigation.PopAsync(); } else { await App.Current.MainPage.DisplayAlert("Error", "There was an error, please try again", "Ok"); } }
private void SaveSubs(object obj) { Subscription x = new Subscription(); bool req = DataBaseHelperService.InsertSubscription(new Subscription { IsActive = IsActive, Name = Name, UserId = Auth.GetCurrentId(), SubscribedDate = DateTime.Now, Id = Auth.GetCurrentId() }); if (req) { App.Current.MainPage.Navigation.PopAsync(); } else { App.Current.MainPage.DisplayAlert("Error", "Intente en otro momento", "ok"); } }