public bool FuegBuchHinzu()
        {
            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.ReadLine();
            Console.WriteLine("Bitte geben Sie die ID Nummer von einem Autor ein, um ein neues Buch für diesen Autor hinzufügen: ");
            var id = Convert.ToInt32(Console.ReadLine());

            //  Console.ReadLine();
            Console.WriteLine("Bitte Geben Sie den Titel ein: ");
            var titel = Console.ReadLine();

            //  Console.ReadLine();
            Console.WriteLine("Bitte Geben Sie die ISBN ein: ");
            var isbn = Console.ReadLine();

            IF.SpeichereBuch(id, isbn, titel);
            Console.WriteLine("Das Buch wurde hinzugefügt.");
            return(false);
        }
Esempio n. 2
0
 private void btnAddBook_Click(object sender, RoutedEventArgs e)
 {
     if (lstAuthors.SelectedItem != null)
     {
         int    AuthorID = int.Parse(lstAuthors.SelectedValue.ToString());
         string ISBN     = txtBookISBN.Text;
         string Titel    = txtBookTitle.Text;
         IF.SpeichereBuch(AuthorID, ISBN, Titel);
         FillBooks(IF.GetBuecher(int.Parse(lstAuthors.SelectedValue.ToString())));
     }
     else
     {
         MessageBox.Show("Kein Autor ausgewählt.");
     }
     EmptyFields();
 }