示例#1
0
        private async Task AddNewIncome()
        {
            for (int currentAttempt = 1; currentAttempt <= MaxAttemptsNumber; currentAttempt++)
            {
                _displayer.DisplayMessage("Enter new income", isClearAll: true);
                if (_dataReceiver.TryGetDecimal(out var inputResult))
                {
                    await _financeService.AddNewIncome(inputResult);

                    return;
                }

                _displayer.DisplayErrorMessage("Try again :(");
            }

            _displayer.DisplayNotification("Ended typing attempts");
        }