示例#1
0
        static private void DeleteArtist()
        {
            Console.Clear();
            Console.WriteLine("------ Delete artist ------ \n");

            Console.Write("Type the artist ID: ");
            string artistID = Console.ReadLine();

            while (artistID.Length != 5 || gal.SearchArtist(artistID) == null)
            {
                Console.WriteLine("Invalid ID!Please try again.");
                artistID = Console.ReadLine();
            }

            gal.DeletArtist(artistID);
            Console.WriteLine();
            Console.WriteLine("Artist deleted!Press any key to continue.");
            Console.ReadLine();
        }
示例#2
0
        private void DeleteArtists_Click(object sender, RoutedEventArgs e)
        {
            artistsText.Text = "";

            if (artistID.Text == "")
            {
                MessageBox.Show("Artist ID is required!");
                return;
            }
            Artist a = gal.DeletArtist(artistID.Text);

            if (a != null)
            {
                artistsText.Text  = "Artist deleted!\n";
                artistsText.Text += a.ToString();
            }
            else
            {
                MessageBox.Show("Artist ID not registred!");
                return;
            }
        }