コード例 #1
0
        private async void btnDelete_Click(object sender, EventArgs e)
        {
            if (MetroFramework.MetroMessageBox.Show(this, "Are you sure?", "Delete Loan", MessageBoxButtons.YesNo,
                                                    MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
            {
                string token = txtLoanId.Text.Substring(4);
                int    _id   = int.Parse(token);
                await loans.Delete(_id);

                Collectables c  = new Collectables();
                Collections  c2 = new Collections();
                c.DeleteCollectables(_id);
                c2.DeleteCollections(_id);
                MetroFramework.MetroMessageBox.Show(this, loans.msg, "Delete Loan", MessageBoxButtons.OK, MessageBoxIcon.Question);
                this.Close();
            }
        }