/// <summary> /// 删除数据库中歌单 /// </summary> /// <param name="musicList"></param> /// <returns></returns> public bool DeleteMusicList(MusicList musicList) { try { bool n = mDB.DeleteMusicList(musicList); CreatedMusicList.Remove(musicList.ListName); return(n); } catch (Exception ex) { Console.WriteLine(ex.Message + ex.StackTrace); return(false); } }
/// <summary> /// 修改数据库中歌单名 /// </summary> /// <param name="musicList"></param> /// <param name="ListName"></param> public bool UpdateMusicList(MusicList musicList, string ListName) { try { if (musicList != null) { int index = CreatedMusicList[musicList.ListName]; CreatedMusicList.Remove(musicList.ListName); int n = mDB.UpdateMusicList(musicList, ListName); musicList.ListName = ListName; AllMusicLists[index].ListName = ListName; CreatedMusicList.Add(musicList.ListName, index); return(n >= 0); } return(false); } catch (Exception ex) { Console.WriteLine(ex.Message + ex.StackTrace); return(false); } }