private void ReturnBookButton_Click(object sender, EventArgs e) { if (_result != null) { var book = _libraryData.bookRepository.CheckForTakenBook(_result.Text); if (book != null) { _mTakenBookPresenter.RemoveTakenBook(book); MessageBox.Show(Translations.GetTranslatedString("returnSucessfully")); } else { MessageBox.Show(Translations.GetTranslatedString("cannotReturn")); } } else { MessageBox.Show(Translations.GetTranslatedString("addPicture")); } }
private void ReturnBookButton_Click(object sender, EventArgs e) { if (_result != null) { var bookReturnValidator = new BookReturnValidator(); var book = bookReturnValidator.TakenBookListCheckForBook(_result.Text); if (book != null) { _mTakenBookPresenter.RemoveTakenBook(book); MessageBox.Show("Book returned successfully."); } else { MessageBox.Show("You can not return this book."); } } else { MessageBox.Show("Please add picture of the barcode"); } }