Пример #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);
                }
            }
        }
Пример #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);
            }
        }
Пример #3
0
 private void addButton_Click(object sender, EventArgs e)
 {
     if (this.bookLookup.EditValue != null)
     {
         SongEditDialog songEditDialog = new SongEditDialog();
         Book           book           = (Book)this.bookLookup.EditValue;
         songEditDialog.AddSong(book.BookID);
         if (songEditDialog.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         DataSource.ResetBook((Book)this.bookLookup.EditValue);
         this.bookLookup_EditValueChanged((object)null, EventArgs.Empty);
     }
     else
     {
         int num = (int)MessageBox.Show("Select a book first.", Application.ProductName);
     }
 }