Exemplo n.º 1
0
 public void ViewSong(String id)
 {
     using (AppDatabase context = new AppDatabase(AppDatabase.DBConnectionString))
     {
         IQueryable <vsb_songbook> entityQuery = from slist in context.SongBooks
                                                 where slist.ID.Equals(id) select slist;
         vsb_songbook songview = entityQuery.FirstOrDefault();
         context.SongBooks.DeleteOnSubmit(songview);
         context.SubmitChanges();
     }
 }
Exemplo n.º 2
0
 public void AddSongBook(String title, String content, String icon)
 {
     using (AppDatabase context = new AppDatabase(AppDatabase.DBConnectionString))
     {
         vsb_songbook newsong = new vsb_songbook();
         newsong.Icon    = icon;
         newsong.Title   = title;
         newsong.Content = content;
         context.SongBooks.InsertOnSubmit(newsong);
         context.SubmitChanges();
     }
 }
Exemplo n.º 3
0
        private void MainListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (MainListBox.SelectedIndex == -1)
            {
                return;
            }
            vsb_songbook myresults = MainListBox.SelectedItem as vsb_songbook;

            //settings.CurrSongSetting = myresults.ID - 1;
            NavigationService.Navigate(new Uri("/DdSongView.xaml?selectedSong=" + (myresults.ID - 1).ToString(), UriKind.Relative));

            MainListBox.SelectedIndex = -1;
        }