private void OnModifyBookClick(object sender, RoutedEventArgs e) { try { Librarian lib = (Librarian)SDM.CurrentUser; int price = Convert.ToInt32(PriceTB.Text); int quantity = Convert.ToInt32(CopiesTB.Text); bool isBestseller = IsBestsellerCB.SelectedIndex == 0; lib.ModifyBook ( _docID, TitleTB.Text, AutorsTB.Text, PublisherTB.Text, Convert.ToInt32(PublishYearTB.Text), EditionTB.Text, DescriptionTB.Text, price, isBestseller, quantity, TagsTB.Text ); } catch { MessageBox.Show("The row is empty", "Error"); } prevPage.UpdateTable(); Close(); }