Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BAA45H - Költségvezető #16

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

RakDavid
Copy link

No description provided.

@RakDavid RakDavid changed the title Elkészült az alkalmazás BAA45H - Költségvezető Nov 22, 2024
Copy link
Contributor

@webmaster442 webmaster442 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Szép munka. Pár apróságot találtam

{
static void Main()
{
IExpenseRepository repository = new JsonExpenseRepository();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noice 👍 Specifikált implementáció

IUserInterface ui = new ConsoleUserInterface();

MainMenu(ui, expenseService, repository);
ui.DisplayMessage("További szép napot és minél későbbi viszont látást!");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Viszont kívánom 👍

string dateInput = ui.GetUserInput("Dátum (éééé-hh-nn): ");
if (dateInput == "0") return;

if (DateTime.TryParseExact(dateInput, "yyyy-MM-dd", null, System.Globalization.DateTimeStyles.None, out date))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ezt az if-else ágat el lehetne hagyni egy invertált if feltétellel, nem? Akkor nem kellene az else ág.


if (int.TryParse(categoryInput, out categoryIndex))
{
if (categoryIndex == categories.Count + 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ez az if mergelhető a felette lévővel, nem?

if (amountInput == "0") return;

if (decimal.TryParse(amountInput, out amount) && amount > 0)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Szintén meg lehetne fordítani a feltételt

{
if (!File.Exists(filePath)) return new List<ExpenseRecord>();
var jsonData = File.ReadAllText(filePath);
return JsonSerializer.Deserialize<List<ExpenseRecord>>(jsonData) ?? new List<ExpenseRecord>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ilyenkor van értelme üreset visszaadni? Nem célszerűbb szétszállni a fenébe?

@webmaster442 webmaster442 linked an issue Dec 2, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BAA45H - Költségvezető
2 participants