public IActionResult GetRangeTrans(int?Id)
        {
            TransactionRange trRange = new TransactionRange();

            trRange.AccountNumber   = Convert.ToInt32(Id);
            trRange.transactionFrom = DateTime.Now;
            trRange.transactionTo   = DateTime.Now;
            return(View(trRange));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Deposit([FromBody] TransactionRange transaction)
        {
            if (null != transaction.Delay)
            {
                await Task.Delay(transaction.Delay.Value);
            }

            if (transaction.Busy)
            {
                FindPrimeNumber(1000000);
            }

            for (int i = 0; i < transaction.Repetitions; i++)
            {
                var amount = _depositRandom.Next(Convert.ToInt32(transaction.LowAmount), Convert.ToInt32(transaction.HighAmount));
                this._logger.LogInformation($"AMOUNT TO DEPOSIT: {amount} FROM {transaction.Id}");
                await _client.PublishEventAsync <Transaction>("pubsub", "deposit", new Transaction { Id = transaction.Id, Amount = amount });
            }

            return(Ok());
        }
        public async Task <IActionResult> GetRangeTrans([Bind("Id,AccountNumber,transactionFrom,transactionTo")] TransactionRange transactionRange)
        {
            var trList = await _context.Transactions.Where(t => (t.AccFromId == transactionRange.AccountNumber || t.AccToId == transactionRange.AccountNumber) && (t.transactionDate >= transactionRange.transactionFrom && t.transactionDate <= transactionRange.transactionTo)).ToListAsync();

            return(View("Views/Transactions/DislayRangeTrans.cshtml", trList));
        }