private void FillBooks() { booksCheckedListBox.Items.Clear(); foreach (var book in _publishersRepository.GetAllBooksWithoutAPublisher()) { booksCheckedListBox.Items.Add(book.Name); } }
private void FillDetails() { nameOfPublisherTextBox.Text = _publisher.Name; booksCheckedListBox.Items.Clear(); foreach (var book in _publisher.PublishedBooks) { booksCheckedListBox.Items.Add(book.Name, true); } foreach (var book in _publishersRepository.GetAllBooksWithoutAPublisher()) { booksCheckedListBox.Items.Add(book.Name); } }
private void ShowPublisherAddForm(object sender, EventArgs e) { if (_publishersRepository.GetAllBooksWithoutAPublisher().Count != 0) { var publisherAdd = new PublisherAddForm(); publisherAdd.ShowDialog(); FillPublishersListBox(); } else { MessageBox.Show( "Ne postoji nijedna knjiga bez izdavaca. Kako bi dodao novog izdavaca prvo dodaj novu knjigu!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }