コード例 #1
0
        /// <summary>
        /// Button click to delete account
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        async void BtnDelete(object sender, EventArgs e)
        {
            Data.Database db    = new Data.Database();
            bool          error = await db.DeleteAccount(_UserName, lblAccountName.Text);

            if (error == false)
            {
                //notify user the account was added
                Data.AccountDataAccessService adas = new Data.AccountDataAccessService();
                //resync with the database
                adas.Resync(_UserName);
                //go back to main menu
                Navigation.InsertPageBefore(new MainPage(_UserName), this);
                await Navigation.PopToRootAsync();
            }
            else
            {
                //notify some error occured
                lblResult.Text = "Error deleting account";
            }
        }