Beispiel #1
0
        } // DeleteLoyaltyAccount_Click

        private void DeleteManagerAccount_Click(object sender, EventArgs e)
        {
            // Get the currently selected item in the ListBox.
            try
            {
                string curItem = ((BoxFormat)AssistantManagers_Listbox.SelectedItem).databaseID;

                // connect to DB if it is not connected
                if (!nsadb.Connected())
                {
                    nsadb.OpenConnection();
                }

                // Update the database to mark selected order Refunded and clear Manager Accounts List
                nsadb.ManagerDeleteManagerAccount(curItem);
                LoadManagerAccountList();

                // Inform User that Account was successfully Deleted.
                MessageBox.Show("Manager Account #" + curItem + " Deleted.", "Delete Manager Account", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch
            {
                MessageBox.Show("Account Not Selected!", "Delete Manager Account", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        } // DeleteManagerAccount_Click