private void ResetAll() { // Setzt Index der Combobox auf kein vorhandenes Element if (comboBoxID.SelectedIndex == -1) { // Leeren der Comcobox-Einträge comboBoxID.Items.Clear(); // Leeren Eintrag einfügen, um alle Einträge zu erhalten comboBoxID.Items.Add(""); // Alle in der DB gefunden IDs in der comboBoxID anzeigen comboBoxID.Items.AddRange(_logicSearch.ReadID("")); // ComboBoxID.Text auf das erste Element setzen if (comboBoxID.Items.Count > 0) { comboBoxID.Text = comboBoxID.Items[0].ToString(); } } // Auswahl Titel if (comboBoxTitle.SelectedIndex == -1) { comboBoxTitle.Items.Clear(); comboBoxTitle.Items.Add(""); comboBoxTitle.Items.AddRange(_logicSearch.ReadTitle("")); if (comboBoxTitle.Items.Count > 0) { comboBoxTitle.Text = comboBoxTitle.Items[0].ToString(); } } // Auswahl Genre if (comboBoxGenre.SelectedIndex == -1) { comboBoxGenre.Items.Clear(); comboBoxGenre.Items.Add(""); comboBoxGenre.Items.AddRange(_logicSearch.ReadGenre("")); if (comboBoxGenre.Items.Count > 0) { comboBoxGenre.Text = comboBoxGenre.Items[0].ToString(); } } // Auswahl Preis if (comboBoxBorrowingRate.SelectedIndex == -1) { comboBoxBorrowingRate.Items.Clear(); comboBoxBorrowingRate.Items.Add(""); comboBoxBorrowingRate.Items.AddRange(_logicSearch.ReadBorrowingRate("")); if (comboBoxBorrowingRate.Items.Count > 0) { comboBoxBorrowingRate.Text = comboBoxBorrowingRate.Items[0].ToString(); } } // Auswahl Erscheinungsjahr if (comboBoxReleaseYear.SelectedIndex == -1) { comboBoxReleaseYear.Items.Clear(); comboBoxReleaseYear.Items.Add(""); comboBoxReleaseYear.Items.AddRange(_logicSearch.ReadReleaseYear("")); if (comboBoxReleaseYear.Items.Count > 0) { comboBoxReleaseYear.Text = comboBoxReleaseYear.Items[0].ToString(); } } // Auswahl Laufzeit if (comboBoxRunningTime.SelectedIndex == -1) { comboBoxRunningTime.Items.Clear(); comboBoxRunningTime.Items.Add(""); comboBoxRunningTime.Items.AddRange(_logicSearch.ReadRunningTime("")); if (comboBoxRunningTime.Items.Count > 0) { comboBoxRunningTime.Text = comboBoxRunningTime.Items[0].ToString(); } } // Auswahl FSK if (comboBoxRated.SelectedIndex == -1) { comboBoxRated.Items.Clear(); comboBoxRated.Items.Add(""); comboBoxRated.Items.AddRange(_logicSearch.ReadRated("")); if (comboBoxRated.Items.Count > 0) { comboBoxRated.Text = comboBoxRated.Items[0].ToString(); } } // Auswahl Ausleihender if (comboBoxBorrower.SelectedIndex == -1) { comboBoxBorrower.Items.Clear(); comboBoxBorrower.Items.Add(""); comboBoxBorrower.Items.AddRange(_logicSearch.ReadBorrower("")); if (comboBoxBorrower.Items.Count > 0) { comboBoxBorrower.Text = comboBoxBorrower.Items[0].ToString(); } } // Auswahl Rückgabedatum if (comboBoxReturnDate.SelectedIndex == -1) { comboBoxReturnDate.Items.Clear(); comboBoxReturnDate.Items.Add(""); comboBoxReturnDate.Items.AddRange(_logicSearch.ReadReturnDate("")); if (comboBoxReturnDate.Items.Count > 0) { comboBoxReturnDate.Text = comboBoxReturnDate.Items[0].ToString(); } } }