public IActionResult GetIncomes() { var notes = _financeNoteService.GetAllIncomes(); if (notes == null) { return(BadRequest(NotesErrorMessage)); } return(Ok(notes)); }
private void PerformAction(ConsoleKeyInfo actionKey) { switch (char.GetNumericValue(actionKey.KeyChar)) { case (double)Operation.AddIncome: { var financeAmount = GetFinanceAmount(); _financeNoteService.AddIncomeNote(financeAmount); Console.WriteLine(AddingIsSuccessful); break; } case (double)Operation.AddExpense: { var financeAmount = GetFinanceAmount(); _financeNoteService.AddExpenseNote(financeAmount); Console.WriteLine(AddingIsSuccessful); break; } case (double)Operation.ShowIncomes: { var financeNotes = _financeNoteService.GetAllIncomes(); _reporter.SaveReport(financeNotes, "Your incomes: "); break; } case (double)Operation.ShowExpenses: { var financeNotes = _financeNoteService.GetAllExpenses(); _reporter.SaveReport(financeNotes, "Your expenses: "); break; } case (double)Operation.ShowTotalFinancialFlow: { Console.Write("Your financial flow: "); var totalFinancialFlow = _financeFlowAnalyzer.GetTotalFinanceFlow(); Console.WriteLine($"{totalFinancialFlow}$"); break; } } }