} // DeleteUpdateInventory_Click private void DeleteComponent_Click(object sender, EventArgs e) { // Get the currently selected item in the ListBox. try { string curItem = ((BoxFormat)Components_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.ManagerDeleteComponent(curItem); LoadManagerComponentList(); // Inform User that Account was successfully Deleted. MessageBox.Show("Component #" + curItem + " Deleted.", "Delete Component", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch { MessageBox.Show("Component Not Selected!", "Delete Component", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } // DeleteComponent_Click