Ejemplo n.º 1
0
        private void searchButton_Click(object sender, EventArgs e)
        {
            SongSearchDialog songSearchDialog = new SongSearchDialog();

            if (songSearchDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            Song selectedSong = songSearchDialog.SelectedSong;

            songSearchDialog.Close();
            SongEditDialog songEditDialog = new SongEditDialog();

            songEditDialog.MustSave = true;
            songEditDialog.EditSong(selectedSong);
            DialogResult dialogResult = songEditDialog.ShowDialog();

            if (dialogResult == DialogResult.OK || dialogResult == DialogResult.Retry)
            {
                DataSource.ResetBook(selectedSong.Book);
                if (this.bookLookup.EditValue != null && ((Book)this.bookLookup.EditValue).BookID == selectedSong.Book.BookID)
                {
                    this.bookLookup_EditValueChanged(null, EventArgs.Empty);
                }
            }
        }
Ejemplo n.º 2
0
        private void editButton_Click(object sender, EventArgs e)
        {
            if (this.songBindingSource.Current == null)
            {
                return;
            }
            SongItem       songItem       = (SongItem)this.songBindingSource.Current;
            SongEditDialog songEditDialog = new SongEditDialog();

            songEditDialog.EditSong(songItem.SongID);
            if (songEditDialog.ShowDialog() != DialogResult.Cancel)
            {
                DataSource.ResetBook((Book)this.bookLookup.EditValue);
                this.bookLookup_EditValueChanged(null, EventArgs.Empty);
            }
        }