public AddSongs() { InitializeComponent(); WaitDialog.Show("Loading, please wait..."); cache.ClearAllCache(); tbArtist.SetSource(cache.getArtists(), "artist"); tbBook.SetSource(cache.getBooks(), "book"); WaitDialog.Hide(); }
public ViewSongs(int songFilter, int artistFilter, int bookFilter, string songText, string artistText, string bookText) { fromLookup = true; prvtSongFilter = songFilter; prvtArtistFilter = artistFilter; prvtBookFilter = bookFilter; prvtSongText = songText.Trim(); prvtArtistText = artistText.Trim(); prvtBookText = bookText.Trim(); WaitDialog.Show("Searching, please wait..."); InitializeComponent(); searchSongs(); WaitDialog.Hide(); }
private void btnSaveEntries_Click(object sender, RoutedEventArgs e) { MyPianoSong ps; int count = 0; string artist; string book; string song; if (tbSongs.Text.Trim() == String.Empty) { MessageBox.Show("No songs entered."); return; } if (tbArtist.Text.Trim() == string.Empty) { MessageBox.Show("You must enter an artist..."); artist = ""; return; } else { artist = tbArtist.Text; } if (tbArtist.Text.Trim() == string.Empty) { MessageBox.Show("No book entered, using NONE for book name"); book = "NONE"; } else { book = tbBook.Text; } WaitDialog.Show("Saving songs, please wait..."); for (int i = 0; i < tbSongs.LineCount; i++) { try { ps = new MyPianoSong(); ps.SongArtist = artist; ps.SongBook = book; song = tbSongs.GetLineText(i); if (song != string.Empty) { string pageNum = ""; if (song.Contains("~")) { int index = song.IndexOf("~"); if (song.Substring(index + 1).Trim() != string.Empty) { pageNum = song.Substring(index + 1).Trim(); } ps.SongTitle = song.Substring(0, index).Trim(); if (IsNumeric(pageNum)) { ps.PageNum = int.Parse(pageNum); } } else { ps.SongTitle = song.Trim(); ps.PageNum = -1; } PianoSongDatabase.addSongEntry(ps); count++; } } catch (Exception ex) { Logger.LogError(ex); } } WaitDialog.Hide(); MessageBox.Show("Successfully saved " + count + " songs!"); cache.ClearAllCache(); tbBook.Text = ""; tbArtist.Text = ""; tbSongs.Text = ""; tbArtist.SetSource(cache.getArtists(), "artist"); tbBook.SetSource(cache.getBooks(), "book"); return; }
public ViewSongs() { WaitDialog.Show("Loading, please wait..."); InitializeComponent(); WaitDialog.Hide(); }