private void btnSave_Click(object sender, RoutedEventArgs e) { try { Book current = (Book)spInfo.DataContext; if (Bookshop.UpdateBook(current) > 0) { MessageBox.Show(string.Format("Kirja {0} päivitetty tietokantaan onnistuneesti", current.ToString())); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnSave_Click(object sender, RoutedEventArgs e) { try { Book current = (Book)spContent.DataContext; if (Bookshop.UpdateBook(current) > 0) { MessageBox.Show(string.Format("Book {0} updated successfully", current.ToString())); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }