Skip to content

Commit

Permalink
bug: Pull correct creation date
Browse files Browse the repository at this point in the history
Was pulling now() rather than time from db
  • Loading branch information
Joe Behrens authored and Joe Behrens committed Sep 19, 2018
1 parent b96df9a commit 9425125
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
8 changes: 8 additions & 0 deletions TimeTracker/ProjectTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,13 @@ public ProjectTask (string projectTitle, string projectNotes, string timeSpent)
ProjectNotes = projectNotes;
TimeSpent = timeSpent;
}

public ProjectTask(string projectTitle, string projectNotes, string timeSpent, string dateOfEntry)
{
ProjectTitle = projectTitle;
ProjectNotes = projectNotes;
TimeSpent = timeSpent;
DateOfEntry = dateOfEntry;
}
}
}
5 changes: 1 addition & 4 deletions TimeTracker/SqLiteDb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ public static string GetPath()
string sql = "CREATE TABLE ProjectTask (ProjectTitle VARCHAR(32), ProjectNotes VARCHAR(250), TimeSpent VARCHAR(32), DateOfEntry VARCHAR(32));";
SQLiteCommand cmd = new SQLiteCommand(sql, dbConnection);
cmd.ExecuteNonQuery();
sql = "INSERT INTO ProjectTask (ProjectTitle, ProjectNotes, TimeSpent, DateOfEntry) VALUES ('Test','Testing testing testing','03:00:00','2019/9/10 04:43 PM');";
cmd = new SQLiteCommand(sql, dbConnection);
cmd.ExecuteNonQuery();
}
}
return databaseFile;
Expand All @@ -46,7 +43,7 @@ public static List<ProjectTask> GetProjectTasks()
SQLiteDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
ProjectTask thisTask = new ProjectTask(reader["ProjectTitle"].ToString(), reader["ProjectNotes"].ToString(), reader["TimeSpent"].ToString());
ProjectTask thisTask = new ProjectTask(reader["ProjectTitle"].ToString(), reader["ProjectNotes"].ToString(), reader["TimeSpent"].ToString(), reader["DateOfEntry"].ToString());
ProjectTasks.Add(thisTask);
}
return ProjectTasks;
Expand Down
2 changes: 1 addition & 1 deletion TimeTracker/TimeTracker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<ProductName>TimeTracker</ProductName>
<PublisherName>Joseph Behrens</PublisherName>
<AutorunEnabled>true</AutorunEnabled>
<ApplicationRevision>6</ApplicationRevision>
<ApplicationRevision>7</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
Expand Down

0 comments on commit 9425125

Please sign in to comment.