public void AddDetailedBook(DetailedBook detailedBook) { var authorId = GetAuthorIdByName(detailedBook.Author.FirstName, detailedBook.Author.LastName); if (authorId == 0) { AddAuthor(detailedBook.Author); authorId = GetAuthorIdByName(detailedBook.Author.FirstName, detailedBook.Author.LastName); } var publisherId = GetPublisherIdByName(detailedBook.Publisher.PublisherName); if (publisherId == 0) { AddPublisher(detailedBook.Publisher); publisherId = GetPublisherIdByName(detailedBook.Publisher.PublisherName); } var categoryId = GetCategoryIdByName(detailedBook.Category.CategoryName); if (categoryId == 0) { AddCategory(detailedBook.Category); categoryId = GetCategoryIdByName(detailedBook.Category.CategoryName); } var book = new Book() { ISBN = detailedBook.ISBN, Title = detailedBook.Title, AuthorId = authorId, PublisherId = publisherId, CategoryId = categoryId }; AddBook(book); }
public override void OnNavigatedFrom(NavigationParameters parameters) { _selectedBook = (DetailedBook)parameters["Book"]; }