public List <Album> CreateAlbumList() { List <Album> albums = new List <Album>(); List <Music> musics = musicService.GetAll(); HashSet <String> albumNames = new HashSet <String>(); foreach (Music music in musics) { albumNames.Add(music.Album); } foreach (String albumName in albumNames) { List <Music> albumMusics = musicService.GetAllByAlbum(albumName); Album album = new Album(albumMusics[0].Album, albumMusics); albums.Add(album); } return(albums); }
public MusicEdit(Music music) { musicService = new SimpleMusicService(new SimpleConnectionCreater()); musicList = musicService.GetAll(); selectedMusic = music; InitializeComponent(); this.DataContext = selectedMusic; InitComboBoxes(); StartTimerAndPlayer(); }
public async Task <IActionResult> index([FromQuery(Name = "includeMusicTypes")] bool includeMusicTypes = true, [FromQuery(Name = "includeAlbums")] bool includeAlbums = false, [FromQuery(Name = "isCoverPhoto")] bool isCoverPhoto = true) { try { _logger.LogInfo(ControllerContext.ActionDescriptor.DisplayName); var allMusicList = await _musicService.GetAll(includeMusicTypes, includeAlbums, isCoverPhoto); InfoLog($"{ControllerContext.ActionDescriptor.DisplayName} Total Music Count : {allMusicList.Result.Count()}"); return(Ok(allMusicList)); } catch (Exception exception) { return(ErrorInternal(exception, $"{ControllerContext.ActionDescriptor.DisplayName} Exception Message : {exception.Message} - {exception.InnerException}")); } }
public async Task <IActionResult> Tables(string seachString) { var music = from m in _context.musics select m; var category = from a in _context.Categories join b in _context.musics on a.Id equals b.CategoriesId select new MusicView { Name = b.Name, Categories = a.CateName, Single = b.Single, Year = b.Year }; List <MusicView> list = await _musicService.GetAll(seachString); return(View(list)); }
public MusicList(String arg) { musicSerice = new SimpleMusicService(new SimpleConnectionCreater()); if (arg.Equals("All")) { listable = new ObservableCollection <Music>(musicSerice.GetAll()); } InitializeComponent(); musicList.ItemsSource = listable; if (Musics.selectedMusic != null) { selectedMusic = Musics.selectedMusic; selectedDockPanel.DataContext = selectedMusic; } DispatcherTimer timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(1); timer.Tick += timer_Tick; timer.Start(); }