public IHttpActionResult Putsongs(int id, songs songs) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != songs.idSong) { return(BadRequest()); } db.Entry(songs).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!songsExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public SoundManager(Game1 game) { this.game = game; jump = game.Content.Load <SoundEffect>("Sound/SFX/SFX Jump"); athletic = game.Content.Load <Song>("Sound/Music/Map BGM"); star = game.Content.Load <Song>("Sound/Music/Star BGM"); ninja = game.Content.Load <Song>("Sound/Music/Shadow Ninja"); death = game.Content.Load <SoundEffect>("Sound/SFX/Player Down"); coinCollect = game.Content.Load <SoundEffect>("Sound/SFX/SFX coin collect"); brickBreak = game.Content.Load <SoundEffect>("Sound/SFX/SFX Brick Break"); itemSpawn = game.Content.Load <SoundEffect>("Sound/SFX/SFX item spawn"); grow = game.Content.Load <SoundEffect>("Sound/SFX/SFX Grow"); shrink = game.Content.Load <SoundEffect>("Sound/SFX/SFX shrink"); blockHit = game.Content.Load <SoundEffect>("Sound/SFX/SFX land"); oneUp = game.Content.Load <SoundEffect>("Sound/SFX/SFX 1up"); pause = game.Content.Load <SoundEffect>("Sound/SFX/menu"); enemyDamage = game.Content.Load <SoundEffect>("Sound/SFX/SFX Enemy damage"); placeHolderSong = game.Content.Load <Song>("Sound/Music/Star BGM"); gameOver = game.Content.Load <SoundEffect>("Sound/Music/Game Over"); fireball = game.Content.Load <SoundEffect>("Sound/SFX/fireball"); launch = game.Content.Load <SoundEffect>("Sound/SFX/BillLaunch"); overworld = game.Content.Load <Song>("Sound/Music/Overworld BGM"); vmusic = game.Content.Load <Song>("Sound/Music/Potential For Anything"); underground = game.Content.Load <Song>("Sound/Music/Underground BGM"); clear = game.Content.Load <SoundEffect>("Sound/Music/Course Clear Fanfare"); overworldFast = game.Content.Load <Song>("Sound/Music/OverworldTimeRunningOut"); achUnlocked = game.Content.Load <SoundEffect>("Achievements/AchievementUnlocked"); title = game.Content.Load <Song>("Sound/Music/title music"); flip = game.Content.Load <SoundEffect>("Sound/SFX/flip"); currentSong = songs.nullSong; }
public void Save(songs song) { if (sr.Exists(song)) { try { sr.Update(song); } catch (Exception ex) { view.errorMsg = ex.Message; } } else { try { sr.Insert(song); } catch (Exception ex) { view.errorMsg = ex.Message; } } }
public void Insert(songs song) { if (context.songs.Any(x => x.name == song.name)) { throw new Exception("Már létezik ilyen nevű szám!"); } context.songs.Add(song); }
public ActionResult DeleteConfirmed(int id) { songs songs = db.songs.Find(id); db.songs.Remove(songs); db.SaveChanges(); return(RedirectToAction("Index")); }
public void Update(songs song) { var csong = context.songs.Find(song.id); if (csong != null) { context.Entry(csong).CurrentValues.SetValues(song); } }
public IHttpActionResult Getsongs(int id) { songs songs = db.songs.Find(id); if (songs == null) { return(NotFound()); } return(Ok(songs)); }
public IHttpActionResult Postsongs(songs songs) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.songs.Add(songs); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = songs.idSong }, songs)); }
public IHttpActionResult Deletesongs(int id) { songs songs = db.songs.Find(id); if (songs == null) { return(NotFound()); } db.songs.Remove(songs); db.SaveChanges(); return(Ok(songs)); }
// GET: songs/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } songs songs = db.songs.Find(id); if (songs == null) { return(HttpNotFound()); } return(View(songs)); }
public ActionResult Edit([Bind(Include = "song_id,format_id,path_id,genre_id,author_id,duration,song_name,song_date,country_id")] songs songs) { if (ModelState.IsValid) { db.Entry(songs).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.author_id = new SelectList(db.authors, "author_id", "author_name", songs.author_id); ViewBag.country_id = new SelectList(db.countries, "country_id", "country_name", songs.country_id); ViewBag.format_id = new SelectList(db.formats, "format_id", "format_name", songs.format_id); ViewBag.genre_id = new SelectList(db.genres, "genre_id", "genre_name", songs.genre_id); ViewBag.path_id = new SelectList(db.paths, "path_id", "path_name", songs.path_id); return(View(songs)); }
// GET: songs/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } songs songs = db.songs.Find(id); if (songs == null) { return(HttpNotFound()); } ViewBag.author_id = new SelectList(db.authors, "author_id", "author_name", songs.author_id); ViewBag.country_id = new SelectList(db.countries, "country_id", "country_name", songs.country_id); ViewBag.format_id = new SelectList(db.formats, "format_id", "format_name", songs.format_id); ViewBag.genre_id = new SelectList(db.genres, "genre_id", "genre_name", songs.genre_id); ViewBag.path_id = new SelectList(db.paths, "path_id", "path_name", songs.path_id); ViewBag.aaa = 1; return(View(songs)); }
public static void PlaySong(SoundManager.songs song) { if (song == songs.athletic) { placeHolderSong = athletic; } if (song == songs.star) { placeHolderSong = star; } if (song == songs.ninja) { placeHolderSong = ninja; } if (song == songs.overworld) { placeHolderSong = overworld; } if (song == songs.underground) { placeHolderSong = underground; } if (song == songs.overworldFast) { placeHolderSong = overworldFast; } if (song == songs.vmusic) { placeHolderSong = vmusic; } if (song == songs.title) { placeHolderSong = title; } if (!currentSong.Equals(song)) { MediaPlayer.Play(placeHolderSong); MediaPlayer.IsRepeating = true; currentSong = song; } }
void MusicMenuEntrySelected(object sender, PlayerIndexEventArgs e) { MediaPlayer.Stop(); currentSong++; if (currentSong > songs.Techno) currentSong = songs.Rock; if(currentSong.ToString()=="Techno") sounds.Play(Sound.Music.Background); if (currentSong.ToString() == "Rock") sounds.Play(Sound.Music.Background1); SetMenuEntryText(); }
/// <summary> /// Event handler for when the Ungulate menu entry is selected. /// </summary> void MusicMenuEntrySelected(object sender, PlayerIndexEventArgs e) { MediaPlayer.Stop(); currentSong++; if (currentSong > songs.TheFunkyBandit) currentSong = songs.RaveParty; if(currentSong.ToString()=="RaveParty") mSound.Play(Sound.Music.Background); if (currentSong.ToString() == "TechnoRampage") mSound.Play(Sound.Music.Background1); if (currentSong.ToString() == "TribalTrain") mSound.Play(Sound.Music.Background2); if (currentSong.ToString() == "TheFunkyBandit") mSound.Play(Sound.Music.Background3); SetMenuEntryText(); }
public void AddSong(songs ob) { LikeSongs.Add(new LikeSongs(ob.GetName, ob.GetP1, ob.GetP2, ob.GetP3, 1/2)); }
public bool Exists(songs song) { return(context.songs.Any(x => x.id == song.id)); }
public void Add(songs song) { view.songlist.Add(song); sr.Insert(song); }
public void Modify(songs song) { ur.Update(song); }
public void Add(songs song) { view.songLista.Add(song); ur.Insert(song); }