private void UpdateAuthors() { _authors = AuthorDataProvider.GetAuthors(); AuthorComboBox.ItemsSource = _authors; }
private void RegisterAuthorButton_Click(object sender, RoutedEventArgs e) { if (ValidateAuthor()) { _author.FirstName = FirstNameTextBox.Text; _author.LastName = LastNameTextBox.Text; _author.DateOfBirth = DobPicker.SelectedDate.Value; AuthorDataProvider.CreateAuthor(_author); DialogResult = true; Close(); } }
private void FillOutFields(Book selectedbook) { BookTitleTextBox.Text = selectedbook.Title; BookIsbnTextBox.Text = selectedbook.ISBN; PublisherTextBox.Text = selectedbook.Publisher; PublishDatePicker.SelectedDate = selectedbook.ReleaseDate; GenreTextBox.Text = selectedbook.Genre; PagesTextBox.Text = selectedbook.Pages.ToString(); IList <Author> authors = AuthorDataProvider.GetAuthors(); AuthorComboBox.ItemsSource = authors; var bookauthor = AuthorDataProvider.GetAuthorByBookId(selectedbook.BookId); AuthorComboBox.SelectedItem = bookauthor; AuthorComboBox.Text = bookauthor.ToString(); }