Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Song song = ss.GetSongById(id);

            ss.DeleteSong(song);
            return(RedirectToAction("Index"));
        }
        public ActionResult DeleteSong(int id)
        {
            var service = new SongService();

            service.DeleteSong(id);
            TempData["SaveResult"] = "Song has been deleted";
            return(RedirectToAction("Index"));
        }
Esempio n. 3
0
        //public IHttpActionResult Put(SongEditModel model)
        //{
        //    if (!ModelState.IsValid) return BadRequest(ModelState);
        //    var songService = new SongService(Guid.Parse(User.Identity.GetUserId()));
        //    var song = songService.GetSongById(model.SongId);
        //    if (song == null) return NotFound();

        //    return Ok(songService.UpdateSong(model));
        //}



        public IHttpActionResult Delete(int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var songService = new SongService(Guid.Parse(User.Identity.GetUserId()));

            return(Ok(songService.DeleteSong(id)));
        }
Esempio n. 4
0
 /// <summary>
 /// 删除歌曲
 /// </summary>
 /// <param name="songId"></param>
 /// <returns></returns>
 public bool DeleteSong(int songId)
 {
     return(songservice.DeleteSong(songId));
 }
 public IActionResult DeleteSong(int SongId)
 {
     songService.DeleteSong(SongId);
     return(Ok());
 }
Esempio n. 6
0
        async Task DeleteSong(Song song)
        {
            await SongService.DeleteSong(song.Id);

            await Refresh();
        }