Exemple #1
0
        private async void DeleteAccount_Clicked(object sender, EventArgs e)
        {
            try
            {
                var result = await DisplayAlert("Delete  User", "You are about to delete your user account, " +
                                                "are you sure you want to do this?", "Ok", "No");

                if (!result)
                {
                    return;
                }

                LoginManager deleteAccount = new LoginManager();
                deleteAccount.DeleteAccount();

                if (!deleteAccount.DeletionSuccessful)
                {
                    return;
                }

                DatabaseManagement dbMgr = new DatabaseManagement();
                dbMgr.DeleteRecords <Settings>();
                dbMgr.DeleteRecords <UserDB>();
                dbMgr.DeleteRecords <Token>();
                dbMgr.CloseDB();

                App.Current.MainPage = new LoginPage();
            }
            catch (Exception ex)
            {
            }
        }