Skip to content

Commit

Permalink
made username display when logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
N00rAhmed committed Nov 29, 2023
1 parent dd446a4 commit 45abcbd
Show file tree
Hide file tree
Showing 13 changed files with 67 additions and 6 deletions.
Binary file modified .vs/TASK-APP/v17/.suo
Binary file not shown.
26 changes: 26 additions & 0 deletions TASK-APP/TaskApp.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions TASK-APP/TaskApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ private void LoadData()

conn.Close();
UpdateTaskCountLabel(); // Update the task count label after loading data
selectUsername();

}

Expand Down Expand Up @@ -295,5 +296,39 @@ private void counter_Title_Click(object sender, EventArgs e)
{

}

private void selectUsername()
{
/* string query = "SELECT username from \"User\" where UserID = " + Login.uid;
*/

NpgsqlConnection conn = new NpgsqlConnection(DB.DBLocation);
conn.Open();

string query = "SELECT username FROM \"User\" WHERE UserID = @UserID";
NpgsqlCommand cmd = new NpgsqlCommand(query, conn);
cmd.Parameters.AddWithValue("@UserID", Convert.ToInt64(Login.uid)); // Convert Login.uid to Int64 (long)

NpgsqlDataReader reader = cmd.ExecuteReader();
if (reader.Read())
{
string username = reader["username"].ToString();
usernameLabel.Text = username;
}

conn.Close();

}


private void usernameLabel_Click(object sender, EventArgs e)
{
selectUsername();
}

private void greetingLabel_Click(object sender, EventArgs e)
{

}
}
}
2 changes: 1 addition & 1 deletion TASK-APP/bin/Debug/TASK-APP.application
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>TZzt8iyG7+tJIPJxpFxm9ZF6D0D+1S5xaMJ1xsXooSg=</dsig:DigestValue>
<dsig:DigestValue>v+GK21Xkf4pjJKeWD7OjN5HhXO4o/YglUHMO/e9ve08=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified TASK-APP/bin/Debug/TASK-APP.exe
Binary file not shown.
4 changes: 2 additions & 2 deletions TASK-APP/bin/Debug/TASK-APP.exe.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="TASK-APP.exe" size="9119200">
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="TASK-APP.exe" size="9120224">
<assemblyIdentity name="TASK-APP" version="2.0.0.0" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>xA0mA15xLXvQIRnA/tDT6OKMw76CwBmCF1h86sUaK6k=</dsig:DigestValue>
<dsig:DigestValue>G6KUuraF+eLFnV0RgJfi5M679KodptE3Bq6vYNTM0RY=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified TASK-APP/bin/Debug/TASK-APP.pdb
Binary file not shown.
Binary file modified TASK-APP/bin/Debug/app.publish/TASK-APP.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion TASK-APP/obj/Debug/TASK-APP.application
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>TZzt8iyG7+tJIPJxpFxm9ZF6D0D+1S5xaMJ1xsXooSg=</dsig:DigestValue>
<dsig:DigestValue>v+GK21Xkf4pjJKeWD7OjN5HhXO4o/YglUHMO/e9ve08=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified TASK-APP/obj/Debug/TASK-APP.csproj.GenerateResource.cache
Binary file not shown.
Binary file modified TASK-APP/obj/Debug/TASK-APP.exe
Binary file not shown.
4 changes: 2 additions & 2 deletions TASK-APP/obj/Debug/TASK-APP.exe.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="TASK-APP.exe" size="9119200">
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="TASK-APP.exe" size="9120224">
<assemblyIdentity name="TASK-APP" version="2.0.0.0" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>xA0mA15xLXvQIRnA/tDT6OKMw76CwBmCF1h86sUaK6k=</dsig:DigestValue>
<dsig:DigestValue>G6KUuraF+eLFnV0RgJfi5M679KodptE3Bq6vYNTM0RY=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified TASK-APP/obj/Debug/TASK-APP.pdb
Binary file not shown.

0 comments on commit 45abcbd

Please sign in to comment.