Exemplo n.º 1
0
        private void DeleteTeam()
        {
            int si = 0;

            try
            {
                si = lvTeam.SelectedItems[0].Index;
            }
            catch
            {
                MessageBox.Show("Please select you want to update");
                return;
            }

            Team   team    = listOfTeam[si];
            string message = "[Deleting team will also delete the player who are in this team]\nDo you really want to delete this team?";

            if (DialogResult.Yes == MessageBox.Show(message, "System", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2))
            {
                TeamHelper.DeleteTeam(team);
                DisplayData();
            }
        }