Ejemplo n.º 1
0
        public async Task <GetTransactionForViewDto> GetTransactionForView(int id)
        {
            var transaction = await _transactionRepository.GetAsync(id);

            var output = new GetTransactionForViewDto {
                Transaction = ObjectMapper.Map <TransactionDto>(transaction)
            };

            return(output);
        }
Ejemplo n.º 2
0
        public async Task <GetTransactionForViewDto> GetTransactionForView(int id)
        {
            var transaction = await _transactionRepository.GetAsync(id);

            var output = new GetTransactionForViewDto {
                Transaction = ObjectMapper.Map <TransactionDto>(transaction)
            };

            if (output.Transaction.Pin > 0)
            {
                var _lookupUser = await _lookup_userRepository.FirstOrDefaultAsync((long)output.Transaction.Pin);

                output.UserName = _lookupUser.Name.ToString();
            }


            return(output);
        }
Ejemplo n.º 3
0
        public async Task UpdateSingleTransaction(GetTransactionForViewDto input)
        {
            var transaction = await _transactionRepository.FirstOrDefaultAsync(input.Transaction.Id);

            ObjectMapper.Map(input.Transaction, transaction);
        }