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(); } }
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(); } }
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(); } }
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(); } }
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(); } }
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(); } }
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(); } }
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(); } }
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(); } }
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(); } }
public void SaveChangesToDB() { vSongBookDb.SubmitChanges(); }