Repository navigation
Changes made - #294
Changes made#294jcisco22 wants to merge 13 commits into
Conversation
Draft
Updated README.md for clarity and corrections in text formatting, including changes to section headings, descriptions of functionalities, and validation methods.
🚀 Project Submitted!Thanks for submitting your project! I will review it soon. 📋 Please check the dashboard to make sure the project is marked as Pending. |
|
Hey @jcisco22, I was reviewing your project and I noticed that there's no way to exit the delete and update menus, and if you enter those menus while the database is empty the user can get soft locked in that menu. I noticed that in the update menu you included instructions to type 0 to return to the main menu, but that feature doesn't seem to be working. If you could please fix this I would love to continue reviewing your project! 😄 |
|
Will do |
…eteInput and UpdateInput methods.
…n the user enters 0. Insert now uses ValidateEndTime instead of duplicating the check. Removed recursive menu call from GeTimeInput. Restored dd-MM-yyyy HH:mm format.
|
Return to main menu feature now fixed. |
0lcm
left a comment
There was a problem hiding this comment.
Hey @jcisco22, I left a few comments on your code, mostly regarding some unused variables and statements, and just a couple things for keeping your code clean. If you could look over these comments when you have time and clean the code up a little I'd appreciate it! 🙃
| using Microsoft.Data.Sqlite; | ||
| using Dapper; | ||
| using Spectre.Console; |
There was a problem hiding this comment.
These using statements are never used and can be safely removed from this file
|
|
||
| class Program1 | ||
| { | ||
| static string connectionString = @"Data Source=habit-Tracker.db"; |
There was a problem hiding this comment.
This variable is never used and can be safely removed
| { | ||
| static string connectionString = @"Data Source=habit-Tracker.db"; | ||
|
|
||
| static void Main(string[] args) |
There was a problem hiding this comment.
No arguments are used in this method so the optional string[] args parameter isn't necessary and can be removed
|
|
||
| class CodingController | ||
| { | ||
| // CodingController.cs — database operations |
There was a problem hiding this comment.
This comment is unnecessary and mostly adds clutter to the code. A good rule of thumb for something like this is that the class should be named something to where it's easy to understand the purpose of the class, that way you don't have to add a comment explaining what the class should do
| { | ||
| // CodingController.cs — database operations | ||
|
|
||
| static string connectionString = new ConfigurationBuilder() |
There was a problem hiding this comment.
For a private static string the general naming convention would be to have a '_' in front of the name like _connectionString. It's not a big deal but it helps make your code cleaner and easier to refactor, plus it's usually just a good idea to follow naming conventions
| } | ||
| } | ||
|
|
||
| public static void Update(int ID, DateTime startTime, DateTime endTime, string duration) |
There was a problem hiding this comment.
The parameter int ID doesn't follow camelCase conventions, it would make more sense to name it something like id
| @@ -0,0 +1,15 @@ | |||
| // CodingSession.cs — the model | |||
There was a problem hiding this comment.
This comment isn't necessary and can be removed to keep clutter to a minimum
| @@ -0,0 +1,115 @@ | |||
| using System.Runtime.ConstrainedExecution; | |||
There was a problem hiding this comment.
This using statement isn't necessary and can be safely removed
| DateTime startTime; | ||
| DateTime endTime; |
There was a problem hiding this comment.
Both of these variables are never used after being declared, and can be removed from the code
|
|
||
| return endTime; | ||
| } | ||
| public static int ValidateId(string Input) |
There was a problem hiding this comment.
This parameter doesn't match camelCase conventions, a better name would be something like input


Duration recalculated on update, end time validated after start, README added.