Exemple #1
0
 private void btnSave_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         Book current = (Book)spBook.DataContext;
         if (Bookshop.UpdateBook(current) > 0)
         {
             MessageBox.Show(string.Format("Kirja {0} päivitetty tietokantaa onnustuneesti", current.ToString()));
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemple #2
0
 private void btnTallenna_Click(object sender, RoutedEventArgs e)
 {
     //mistä tiedetään mitä muokata --> Book-olion ID:stä!
     try
     {
         Book current = (Book)spBook.DataContext;
         if (Bookshop.UpdateBook(current) > 0)
         {
             tbMessage.Text = string.Format("Kirja {0} päivitetty tietokantaan onnistuneesti", current.ToString());
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }