public Response Delete(Guid idPlayList) { bool exist = _repositoryVideo.ExistePlayListAssociada(idPlayList); if (exist) { AddNotification("PlayList", Msg.NAO_E_POSSIVEL_EXCLUIR_UMA_X0_ASSOCIADA_A_UM_X1.ToFormat("PlayList", "Video")); return(null); } PlayList playList = _repositoryPlayList.Obter(idPlayList); if (playList == null) { AddNotification("PlayList", Msg.DADOS_NAO_ENCONTRADOS); } if (this.IsInvalid()) { return(null); } _repositoryPlayList.Delete(playList); return(new Response() { Mensagem = Msg.OPERACAO_REALIZADA_COM_SUCESSO }); }
public Response ExcluirPlayList(Guid idPlayList) { bool existe = _repositoryVideo.ExistePlayListAssociada(idPlayList); if (existe) { AddNotification("PlayList", "MSG.NAO_E_POSSIVEL_EXCLUIR_UMA_Playlist"); return(null); } PlayList playList = _repositoryPlayList.Obter(idPlayList); if (playList == null) { AddNotification("PlayList", "DADOS_NAO_ENCONTRADOS"); } if (this.IsInvalid()) { return(null); } _repositoryPlayList.Excluir(playList); return(new Response() { Message = "OPERACAO_REALIZADA_COM_SUCESSO" }); }
public Arguments.Base.Response ExcluirPlayList(Guid id) { bool existe = _repositoryVideo.ExistePlayListAssociada(id); if (existe) { AddNotification("PlayList", MSG.NAO_E_POSSIVEL_EXCLUIR_UMA_X0_ASSOCIADA_A_UMA_X1.ToFormat("PlayList", "Video")); return(null); } PlayList playlist = _repositoryPlayList.Obter(id); if (playlist == null) { AddNotification("PlayList", MSG.DADOS_NAO_ENCONTRADOS); } if (IsInvalid()) { return(null); } _repositoryPlayList.Excluir(playlist); return(new Arguments.Base.Response { Message = MSG.OPERACAO_REALIZADA_COM_SUCESSO }); }