public Response ExcluirPlayList(Guid idPlayList) { // bool existe =_repositorioVideo.ExistePlayListAssociado(idPlayList) bool existe = false; if (existe) { AddNotification("PlayList", "Não é possível excluir uma playlist associada a um vídeo"); return(null); } PlayList playList = _repositorioPlayList.Obter(idPlayList); if (playList == null) { AddNotification("PlayList", "Dados não encontrados"); } if (IsInvalid()) { return(null); } _repositorioPlayList.Excluir(playList); return(new Response() { Message = "Operação realizada com sucesso", }); }
public Response ExcluirPlayList(Guid idPlayList) { // bool existe _respositoryVideo.ExistePlayListAssociado(idPlayList); bool existe = false; if (existe) { AddNotification("PlayList", MSG.NAO_E_POSSIVEL_EXCLUIR_UMA_X0_ASSOCIADA_A_UMA_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.Excluir(playList); return(new Response() { Message = MSG.OPERACAO_REAIZADA_COM_SUCESSO }); }
public Arguments.Base.Response ExcluirPlayList(Guid idPlayList) { //bool existe _repositoryVideo.ExistePlayListAssociada(idPlayList); bool existe = false; if (existe) { AddNotification("PlayList", "Não é possivel exvluir uma PlayList associada"); return(null); } PlayList playList = _repositoryPlayList.Obter(idPlayList); if (playList == null) { AddNotification("PlayList", "Dados não encontrados"); } if (this.IsInvalid()) { return(null); } _repositoryPlayList.Excluir(playList); return(new Response() { Message = "Operação realizada com sucesso" }); }
public ResponseBase Excluir(Guid id) { if (id == null) { AddNotification("IdPlayList", MSG.X0_E_OBRIGATORIO.ToFormat("IdPlayList")); return(null); } var playListExcluir = _repositoryPlayList.Obter(id); if (playListExcluir == null) { AddNotification("PlayList", MSG.X0_INVALIDO.ToFormat("IdPlayList")); return(null); } bool existeVideoRelacionado = _repositoryVideo.ExistePlayListAssociado(id); if (existeVideoRelacionado) { AddNotification("PlayList", MSG.NAO_E_POSSIVEL_EXCLUIR_UMA_X0_ASSOCIADA_A_UMA_X1.ToFormat("PlayList", "Video")); return(null); } _repositoryPlayList.Excluir(id); return(new ResponseBase() { Mensagem = MSG.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 }); }