public async Task <IActionResult> Search(string currency, string status, string fromDate, string toDate)
        {
            var isValidStatus = Enum.TryParse(status, out TransactionStatusId statusId);
            var startDate     = DateTimeUtility.ParseDateFromParam(fromDate);
            var endDate       = DateTimeUtility.ParseDateFromParam(toDate);
            var result        = await _transactionDataHandler.GetTransactions(currency, startDate, endDate, isValidStatus?(TransactionStatusId?)statusId : null);

            return(View("ShowData", result));
        }
Exemple #2
0
        public async Task <IActionResult> Get([FromQuery] string currency, [FromQuery] string fromDate, [FromQuery] string toDate, [FromQuery] string status)
        {
            var startDate = DateTimeUtility.ParseDateFromParam(fromDate);
            var endDate   = DateTimeUtility.ParseDateFromParam(toDate);

            var isValidStatus = Enum.TryParse(status, out TransactionStatusId statusId);
            var transactions  = await _transactionDataHandler.GetTransactions(currency, startDate, endDate, isValidStatus?(TransactionStatusId?)statusId : null);

            return(Ok(transactions));
        }