public async Task <IActionResult> DeleteTransactionAsync(int transactionID)
        {
            // Get response from business logic
            var response = await _transactionsService.DeleteTransactionAsync(transactionID);

            // Return as http response
            return(response.ToHttpResponse());
        }
Esempio n. 2
0
        public async Task <ActionResult> DeleteTransaction(Guid transactionId)
        {
            var transaction = await _transactions.GetTransactionAsync(transactionId);

            if (transaction != null)
            {
                await _transactions.DeleteTransactionAsync(transaction);

                return(Ok());
            }

            return(BadRequest(new { message = $"Could not reject transaction" }));
        }
        /// <summary>
        /// Delete transaction
        /// </summary>
        /// <param name="id"></param>
        /// <returns>result delete transaction</returns>
        public async Task <IActionResult> Delete(int transactionId)
        {
            var transactionsDto = new TransactionsDto
            {
                Id = transactionId,
            };

            var transaction = await _transactionsService.GetTransactionAsync(transactionId);

            await _transactionsService.DeleteTransactionAsync(transactionsDto);

            return(RedirectToAction("Detail", "Group", new { id = transaction.GroupId }));
        }