private void EditBook() { Book book = this.Books.FirstOrDefault(b => b.IsSelected); if (book != null) { BookDetailWindow newBookWindow = new BookDetailWindow(); newBookWindow.DataContext = book; bool?save = newBookWindow.ShowDialog(); if (save == true) { ReadingStatDataAccess dataAccess = new ReadingStatDataAccess(); dataAccess.UpdateBook(book); this.Load(this.currentPage); } } }
private void AddBook() { Book book = new Book() { StartDate = DateTime.Today, EndDate = DateTime.Today, Language = ELanguage.German, Type = EType.Entertainment }; BookDetailWindow newBookWindow = new BookDetailWindow(); newBookWindow.DataContext = book; bool?save = newBookWindow.ShowDialog(); if (save == true) { ReadingStatDataAccess dataAccess = new ReadingStatDataAccess(); dataAccess.AddBook(book); this.Load(this.currentPage); } }