Exemplo n.º 1
0
        public ObjectResult Post()
        {
            try

            {
                DetailTransactionService detailTransactionService = new DetailTransactionService(this._configuration);
                string fileToDownload = detailTransactionService.createExcellFile();
                return(new ObjectResult(new MessageReturn <string>(TypeReturn.SUCCESS, $"Operação realizada com sucesso.", fileToDownload)));
            }
            catch (Infra.Exceptions.HeaderTransactionException ex)
            {
                return(new ObjectResult(new MessageReturn(TypeReturn.WARNING, $"{ex.Message}")));
            }
            catch (Exception ex)
            {
                return(new ObjectResult(new MessageReturn(TypeReturn.ERROR, $"Erro ao importar o arquivo OFX. Erro:{ex.Message}")));
            }
        }
Exemplo n.º 2
0
        public ObjectResult Get()
        {
            try

            {
                DetailTransactionService detailTransactionService = new DetailTransactionService(this._configuration);
                List <DetailTransaction> detailTransactions       = detailTransactionService.GetList().ToList();

                return(new ObjectResult(new MessageReturn <List <DetailTransaction> >(TypeReturn.SUCCESS, $"Operação realizada com sucesso.", detailTransactions)));
            }
            catch (Infra.Exceptions.HeaderTransactionException ex)
            {
                return(new ObjectResult(new MessageReturn(TypeReturn.WARNING, $"{ex.Message}")));
            }
            catch (Exception ex)
            {
                return(new ObjectResult(new MessageReturn(TypeReturn.ERROR, $"Erro ao importar o arquivo OFX. Erro:{ex.Message}")));
            }
        }