Esempio n. 1
0
        public async void ReadSubscriptions()
        {
            var subs = await DataBaseHelperService.GetSubscription();

            Subscriptions.Clear();
            foreach (var s in subs)
            {
                Subscriptions.Add(s);
            }
        }
Esempio n. 2
0
        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");
            }
        }
Esempio n. 3
0
        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");
            }
        }