private void btAddAlbumForSong_Click(object sender, RoutedEventArgs e) { try { AddEditAlbum dlg = new AddEditAlbum(true); dlg.Owner = this; if (dlg.ShowDialog() == true) { currAlbum = dlg.ReturnCurrAlbum; if (dlg.ReturnCurrArtist != null) { currArtist = dlg.ReturnCurrArtist; } lblAlbumName.Content = currAlbum.AlbumName; lblAlbumPrice.Content = currAlbum.AlbumPrice; lblAlbumDate.Content = currAlbum.ReleaseDate; if (currAlbum.Id > 0) { lblArtistId.Content = currArtist.Id; lblArtistName.Content = currArtist.ArtistName; lblAlbumName.Content = currAlbum.AlbumName; lblAlbumID.Content = currAlbum.Id; } else { lblAlbumID.Content = "-"; } } } catch (SystemException ex) { MessageBox.Show(ex.Message, "Database operation failed", MessageBoxButton.OK, MessageBoxImage.Warning); } }
private void btAddEditAlbum_Click(object sender, RoutedEventArgs e) { AddEditAlbum dlg = new AddEditAlbum(); dlg.Owner = this; dlg.ShowDialog(); }