Example #1
0
 private void buttonGetPerson_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         int personID = Convert.ToInt32(textBoxID.Text);
         _currentPerson       = _db.GetPerson(personID);
         gridMain.DataContext = _currentPerson;
         MainImage.Source     = new BitmapImage(new Uri($"/Resources/{_currentPerson.ImageId}.jpg", UriKind.Relative));
     }
     catch (Exception)
     {
         MessageBox.Show("Ошибка при запросе к базе данных.");
     }
 }