Exemple #1
0
        public Task <GetTransactionDetailResponse> GetTransactionDetail(GetTransactionDetailRequest request)
        {
            var response = new GetTransactionDetailResponse();

            try
            {
                var transactionDetail = (from p in _context.Transactions
                                         join c in _context.TransactionType on p.TransactionTypeId equals c.TransactionTypeId
                                         where p.TransactionId == request.TransactionId
                                         select new
                {
                    TransactionType = c.TransactionTypeName,
                    Amount = p.Amount,
                    TransactionDate = p.TransDate,
                    Status = p.Status,
                    TransactionId = p.TransactionId,
                }).FirstOrDefault();

                response.Data.Amount          = transactionDetail.Amount;
                response.Data.TransactionType = transactionDetail.TransactionType;

                response.Data.TransactionDate = transactionDetail.TransactionDate;
                response.Data.Status          = transactionDetail.Status;

                response.Data.TransactionId = transactionDetail.TransactionId;
            }

            catch (Exception ex)
            {
                response.Code    = ErrorCode.GetError(ErrorCode.SystemError).Key;
                response.Message = ErrorCode.GetError(ErrorCode.SystemError).Value;
                Logger.Error(ex);
            }
            return(Task.FromResult(response));
        }
Exemple #2
0
        public async Task <IActionResult> GetTransactinDetail(GetTransactionDetailRequest request)
        {
            var response = new GetTransactionDetailResponse();

            try
            {
                response = await _accountQueries.GetTransactionDetail(request);
            }
            catch (Exception ex)
            {
                response.Code    = ErrorCode.GetError(ErrorCode.SystemError).Key;
                response.Message = ErrorCode.GetError(ErrorCode.SystemError).Value;

                Logger.Error($"Exception: {ex} , Method:GetTransactinDetail");
            }
            return(Ok(response));
        }