-
Notifications
You must be signed in to change notification settings - Fork 23
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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(); |
There was a problem hiding this comment.
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!"); |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) | ||
{ |
There was a problem hiding this comment.
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>(); |
There was a problem hiding this comment.
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?
No description provided.