private void btnDisCD_Click(object sender, EventArgs e) { /*Retrieve details of selected CDs.For now, type in details of selected CDs * Regardless of method, display the details on choice screen*/ /*foreach (Object item in chkDisCD.CheckedItems) * { * MessageBox.Show(item.ToString()); * }*/ //Outputs the selected CDs according to the checked CDs for (int i = 0; i <= chkDisCD.Items.Count - 1; i++) { if (chkDisCD.GetItemChecked(i)) { MessageBox.Show(chkDisCD.Items[i].ToString() + "\nCD ID: " + txtDisCDID.Text + "\nAlbum: " + txtDeregAlbum.Text + "\nArtist: " + txtDeregArtist.Text + "\nYear Released: " + txtDisYr.Text + "\nArtist Label: " + txtDisArtLabel.Text + "\nCost Price: €" + txtDisCostPrice.Text + "\nQty: " + txtDisQty.Text); } } /*Asks Manager to either discontinue the chosen CDs or to keep them available*/ DialogResult dr = MessageBox.Show("Are you sure you want to discontinue these CDs? \nCD: " + chkDisCD.GetItemText(chkDisCD.SelectedItems), "Confirm CD Discontinuation", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { availability = 'u'; CD.disCD(Convert.ToInt32(txtDisCDID.Text)); MessageBox.Show("These CDs are now discontinued. \nThey are now " + availability, "CD Discontinued", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } loadCDs(); grpDisCD.Visible = false; txtDisCDID.Clear(); txtDeregAlbum.Clear(); txtDeregArtist.Clear(); txtDisYr.Clear(); txtDisArtLabel.Clear(); txtDisCostPrice.Clear(); txtDisQty.Clear(); }