예제 #1
0
 private void btnDeleteAuthor_Click(object sender, RoutedEventArgs e)
 {
     if (lstAuthors.SelectedItem != null)
     {
         int ID = int.Parse(lstAuthors.SelectedValue.ToString());
         IF.LoescheAutor(ID);
         FillAuthors();
         FillBooks(IF.GetBuecher());
     }
     else
     {
         MessageBox.Show("Kein Autor ausgewählt.");
     }
     EmptyFields();
 }
        public bool EntferneAutor()
        {
            Console.WriteLine();
            // List authors as help
            var autorenList = IF.GetAutoren();

            foreach (var autor in autorenList)
            {
                Console.WriteLine("ID: " + autor.Autoren_id + " Name: " + autor.Name);
            }

            Console.WriteLine("Bitte geben Sie die ID Nummer ein, um den Autor zu entfernen: ");
            var id = Convert.ToInt32(Console.ReadLine());

            IF.LoescheAutor(id);
            Console.WriteLine("Der Autor wurde entfernt.");
            return(false);
        }