public bool DeleteAlbumSong(AlbumSong albumSong) { try { AlbumSongTable.DeleteOnSubmit(albumSong); AlbumSongTable.Context.SubmitChanges(); return true; } catch (Exception) { return false; } }
public bool SaveAlbumSong(AlbumSong albumSong) { try { if (albumSong.AlbumSongId == 0) { AlbumSongTable.InsertOnSubmit(albumSong); } else { AlbumSongTable.Context.Refresh(RefreshMode.KeepCurrentValues, albumSong); } AlbumSongTable.Context.SubmitChanges(); return true; } catch (Exception) { return false; } }