Ejemplo n.º 1
0
        public async Task Deletar(LancamentoAnexo anexo)
        {
            if (_apiGoogleDriveProxy.Invalido)
            {
                this.AdicionarNotificacoes(_apiGoogleDriveProxy.Notificacoes);
                return;
            }

            // Exclui o arquivo do anexo do Google Drive
            await _apiGoogleDriveProxy.ExcluirPorId(anexo.IdGoogleDrive);

            _efContext.LancamentosAnexo.Remove(anexo);
        }
Ejemplo n.º 2
0
        public LancamentoAnexoSaida(LancamentoAnexo anexo)
        {
            if (anexo == null)
            {
                return;
            }

            this.Id            = anexo.Id;
            this.IdLancamento  = anexo.IdLancamento;
            this.IdGoogleDrive = anexo.IdGoogleDrive;
            this.Descricao     = anexo.Descricao;
            this.NomeArquivo   = anexo.NomeArquivo;
        }
Ejemplo n.º 3
0
        public async Task <LancamentoAnexo> Inserir(int idLancamento, DateTime dataLancamento, LancamentoAnexoEntrada cadastroEntrada)
        {
            // Realiza o upload do arquivo do anexo para o Google Drive
            var idGoogleDrive = await RealizarUploadAnexo(dataLancamento, cadastroEntrada);

            if (this.Invalido)
            {
                return(null);
            }

            var anexo = new LancamentoAnexo(idLancamento, cadastroEntrada, idGoogleDrive);

            await _efContext.AddAsync(anexo);

            return(anexo);
        }