private void btnNext_Click(object sender, RoutedEventArgs e) { if (karWindow.CurrentCdgId > 0) { karWindow.Stop(); dal.SetKaraokePlayed(current.Id); current = dal.GetNextFileInQueue(); if (current != null) { karWindow.Start(current.FilePath, current.Id, "Cancion pedida por:" + current.UserName, "Viene la siguiente cancion"); } } }
private void btnPlay_Click(object sender, RoutedEventArgs e) { current = dal.GetNextFileInQueue(); if (current != null) { karWindow.Start(current.FilePath,current.Id, "Cancion pedida por:" + current.UserName, "Viene la siguiente cancion"); } }
void workerAddToQueue_DoWork(object sender, DoWorkEventArgs e) { var file = (KaraokeFile)e.Argument; KaraokeQueue tmp = new KaraokeQueue(); tmp.Date = DateTime.Now; tmp.FileName = file.Filename; tmp.FilePath = file.FullFilePath; tmp.UserName = "******"; tmp.PlayOrder = 10; dal.InsertQueueSlot(tmp); e.Result=dal.GetQueue(); }
void karWindow_KaraokeEnded(int KaraokeId) { dal.SetKaraokePlayed(KaraokeId); Gridqueque.ItemsSource = dal.GetQueue(); current = dal.GetNextFileInQueue(); if (current != null) { karWindow.Start(current.FilePath, current.Id, "Cancion pedida por:" + current.UserName, "Viene la siguiente cancion"); } }
internal KaraokeQueue InsertQueueSlot(int songid, string username) { var file=(KaraokeFile)db.KaraokeFiles.FindById(songid); var slot = new KaraokeQueue(); slot.Date = DateTime.Now; slot.FileName = file.Filename; slot.FilePath = file.FullFilePath; slot.Played = false; slot.PlayOrder = 10; slot.UserName = username; db.Queue.Insert(slot); return slot; }
internal bool InsertQueueSlot(KaraokeQueue tmp) { var result = db.Queue.Insert(tmp); return true; }