Ejemplo n.º 1
0
 public void DeleteOwnsong(int id)
 {
     using (AppDatabase context = new AppDatabase(AppDatabase.DBConnectionString))
     {
         IQueryable <vsb_ownsong> entityQuery = from own in context.OwnSongs where own.ID.Equals(id) select own;
         vsb_ownsong entityToDelete           = entityQuery.FirstOrDefault();
         context.OwnSongs.DeleteOnSubmit(entityToDelete);
         context.SubmitChanges();
     }
 }
Ejemplo n.º 2
0
 public void DeleteFavourite(int id)
 {
     using (AppDatabase context = new AppDatabase(AppDatabase.DBConnectionString))
     {
         IQueryable <vsb_favourite> entityQuery = from fav in context.Favourites where fav.ID.Equals(id) select fav;
         vsb_favourite entityToDelete           = entityQuery.FirstOrDefault();
         context.Favourites.DeleteOnSubmit(entityToDelete);
         context.SubmitChanges();
     }
 }
Ejemplo n.º 3
0
 public void DeleteAllOwnsongs()
 {
     using (AppDatabase context = new AppDatabase(AppDatabase.DBConnectionString))
     {
         IQueryable <vsb_ownsong> entityQuery    = from owns in context.OwnSongs select owns;
         IList <vsb_ownsong>      entityToDelete = entityQuery.ToList();
         context.OwnSongs.DeleteAllOnSubmit(entityToDelete);
         context.SubmitChanges();
     }
 }
Ejemplo n.º 4
0
 public void DeleteAllFavourites()
 {
     using (AppDatabase context = new AppDatabase(AppDatabase.DBConnectionString))
     {
         IQueryable <vsb_favourite> entityQuery    = from favs in context.Favourites select favs;
         IList <vsb_favourite>      entityToDelete = entityQuery.ToList();
         context.Favourites.DeleteAllOnSubmit(entityToDelete);
         context.SubmitChanges();
     }
 }
Ejemplo n.º 5
0
 public void UpdateOwnSong(int id, String title, string content)
 {
     using (AppDatabase context = new AppDatabase(AppDatabase.DBConnectionString))
     {
         IQueryable <vsb_ownsong> entityQuery = from own in context.OwnSongs where own.ID == id select own;
         vsb_ownsong entityToUpdate           = entityQuery.FirstOrDefault();
         entityToUpdate.Title   = title;
         entityToUpdate.Content = content;
         context.SubmitChanges();
     }
 }
Ejemplo n.º 6
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();
     }
 }
Ejemplo n.º 7
0
 public void FavoriteThis(String title, String content)
 {
     using (AppDatabase context = new AppDatabase(AppDatabase.DBConnectionString))
     {
         vsb_favourite favour = new vsb_favourite();
         favour.Title   = title;
         favour.Content = content;
         context.Favourites.InsertOnSubmit(favour);
         context.SubmitChanges();
     }
 }
Ejemplo n.º 8
0
 public void AddOwnSong(String title, String content)
 {
     using (AppDatabase context = new AppDatabase(AppDatabase.DBConnectionString))
     {
         vsb_ownsong ownsong = new vsb_ownsong();
         ownsong.Title   = title;
         ownsong.Content = content;
         context.OwnSongs.InsertOnSubmit(ownsong);
         context.SubmitChanges();
     }
 }
Ejemplo n.º 9
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();
     }
 }
Ejemplo n.º 10
0
 public void UpdateUserToLower()
 {
     using (AppDatabase context = new AppDatabase(AppDatabase.DBConnectionString))
     {
         IQueryable <vsb_ownsong> entityQuery    = from own in context.OwnSongs select own;
         IList <vsb_ownsong>      entityToUpdate = entityQuery.ToList();
         foreach (vsb_ownsong song in entityToUpdate)
         {
             song.Title = song.Title.ToLower();
         }
         context.SubmitChanges();
     }
 }
Ejemplo n.º 11
0
 public void SaveChangesToDB()
 {
     vSongBookDb.SubmitChanges();
 }