async Task SubmitButtonTappedAsync()
        {
            UpdateViewModelValues();

            try { await SubmitBookChanges(); }
            catch (Exception e) { Alerter.PresentOKAlert("Oops", e.Message, this); }
        }
 void PresentSuccessAlert()
 {
     Alerter.PresentOKAlert(Constants.SuccessMessages.Success,
                            Constants.SuccessMessages.BookAddedWithSuccess, this, (action) =>
     {
         NavigationController.PopViewController(true);
     });
 }
        async Task CheckoutBook(string name)
        {
            try {
                await viewModel.CheckoutBook(name);

                UpdateCheckedOutBy();
                didUpdateBook(viewModel.Book);
            }

            catch (Exception e) {
                Alerter.PresentOKAlert("Oops", e.Message, this);
            }
        }
Esempio n. 4
0
        async Task DeleteBook(Book book)
        {
            try {
                await viewModel.DeleteBook(book);

                InvokeOnMainThread(() => {
                    Alerter.PresentOKAlert("Success!", "Book was deleted", this, null);
                    tableView.ReloadData();
                });
            }

            catch (Exception e) {
                InvokeOnMainThread(() =>
                {
                    Alerter.PresentOKAlert("Opps", e.Message, this, null);
                });
            }
        }
Esempio n. 5
0
 async Task LoadData()
 {
     try { await viewModel.LoadBooks(); }
     catch (Exception exception) { Alerter.PresentOKAlert("Oops", exception.Message, this); }
 }