diff --git a/Source Code/TeamHobby.HobbyProjectGenerator.UserManagement/AccountService.cs b/Source Code/TeamHobby.HobbyProjectGenerator.UserManagement/AccountService.cs
new file mode 100644
index 0000000..902cba9
--- /dev/null
+++ b/Source Code/TeamHobby.HobbyProjectGenerator.UserManagement/AccountService.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace TeamHobby.HobbyProjectGenerator.UserManagement
+{
+ internal class AccountService
+ {
+ }
+}
diff --git a/Source Code/main/SystemAccountManager.cs b/Source Code/TeamHobby.HobbyProjectGenerator.UserManagement/SystemAccountManager.cs
similarity index 100%
rename from Source Code/main/SystemAccountManager.cs
rename to Source Code/TeamHobby.HobbyProjectGenerator.UserManagement/SystemAccountManager.cs
diff --git a/Source Code/TeamHobby.HobbyProjectGenerator.UserManagement/TeamHobby.HobbyProjectGenerator.UserManagement.csproj b/Source Code/TeamHobby.HobbyProjectGenerator.UserManagement/TeamHobby.HobbyProjectGenerator.UserManagement.csproj
new file mode 100644
index 0000000..132c02c
--- /dev/null
+++ b/Source Code/TeamHobby.HobbyProjectGenerator.UserManagement/TeamHobby.HobbyProjectGenerator.UserManagement.csproj
@@ -0,0 +1,9 @@
+
+
+
+ net6.0
+ enable
+ enable
+
+
+
diff --git a/Source Code/main/UserAccount.cs b/Source Code/TeamHobby.HobbyProjectGenerator.UserManagement/UserAccount.cs
similarity index 100%
rename from Source Code/main/UserAccount.cs
rename to Source Code/TeamHobby.HobbyProjectGenerator.UserManagement/UserAccount.cs
diff --git a/Source Code/TeamHobby.HobbyProjectGenerator/Contracts/IUserService.cs b/Source Code/TeamHobby.HobbyProjectGenerator/Contracts/IUserService.cs
deleted file mode 100644
index 96fff23..0000000
--- a/Source Code/TeamHobby.HobbyProjectGenerator/Contracts/IUserService.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace TeamHobby.HobbyProjectGenerator
-{
- public interface IUserService
- {
- // Public methods shouldn't be void so it can be tested
- bool User(string username);
- IList GetAllUsers();
- }
-}
diff --git a/Source Code/TeamHobby.HobbyProjectGenerator/TeamHobby.HobbyProjectGenerator.sln b/Source Code/TeamHobby.HobbyProjectGenerator/TeamHobby.HobbyProjectGenerator.sln
index 2e9cc83..3911340 100644
--- a/Source Code/TeamHobby.HobbyProjectGenerator/TeamHobby.HobbyProjectGenerator.sln
+++ b/Source Code/TeamHobby.HobbyProjectGenerator/TeamHobby.HobbyProjectGenerator.sln
@@ -15,7 +15,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TeamHobby.HobbyProjectGener
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TeamHobby.Main", "..\TeamHobby.Main\TeamHobby.Main.csproj", "{ED126EFB-B337-42F9-BE4B-65A5AE90503B}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeamHobby.HobbyProjectGenerator.DataAccess", "..\TeamHobby.HobbyProjectGenerator.DataAccess\TeamHobby.HobbyProjectGenerator.DataAccess.csproj", "{AA48A66C-FA36-4AF9-A782-CEC22838EB8F}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TeamHobby.HobbyProjectGenerator.DataAccess", "..\TeamHobby.HobbyProjectGenerator.DataAccess\TeamHobby.HobbyProjectGenerator.DataAccess.csproj", "{AA48A66C-FA36-4AF9-A782-CEC22838EB8F}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeamHobby.HobbyProjectGenerator.UserManagement", "..\TeamHobby.HobbyProjectGenerator.UserManagement\TeamHobby.HobbyProjectGenerator.UserManagement.csproj", "{2E7193B8-86B6-48DA-9671-CD84615A5F5D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -48,6 +50,10 @@ Global
{AA48A66C-FA36-4AF9-A782-CEC22838EB8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AA48A66C-FA36-4AF9-A782-CEC22838EB8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AA48A66C-FA36-4AF9-A782-CEC22838EB8F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2E7193B8-86B6-48DA-9671-CD84615A5F5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2E7193B8-86B6-48DA-9671-CD84615A5F5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2E7193B8-86B6-48DA-9671-CD84615A5F5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2E7193B8-86B6-48DA-9671-CD84615A5F5D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Source Code/main/Controller.cs b/Source Code/main/Controller.cs
index 1932939..956702e 100644
--- a/Source Code/main/Controller.cs
+++ b/Source Code/main/Controller.cs
@@ -26,14 +26,14 @@ namespace TeamHobby.HobbyProjectGenerator.Main
public static void Main(string[] args)
{
- //GetCredentials credentials = new GetCredentials();
- //string? username = credentials.GetUserName();
- //string? password = credentials.GetPassword();
+ GetCredentials credentials = new GetCredentials();
+ string? username = credentials.GetUserName();
+ string? password = credentials.GetPassword();
- //Console.WriteLine(value: $"username is {username}\npassword is {password}");
+ Console.WriteLine(value: $"username is {username}\npassword is {password}");
- // Creating the Factory class
+ /* // Creating the Factory class
string dbType = "sql";
RelationalDataSourceFactory dbFactory = new RelationalDataSourceFactory();
@@ -65,7 +65,7 @@ namespace TeamHobby.HobbyProjectGenerator.Main
SqlDAO sqlDS = (SqlDAO)datasource;
// Closing the connection
- sqlDS.getConnection().Close();
+ sqlDS.getConnection().Close();*/
// 2.Inserting Data into the database:
//string sqlWrite = "INSERT into log(lvname, catname, userop, logmessage) values " +
diff --git a/Source Code/main/ExampleDAO.cs b/Source Code/main/SqlDAO.cs
similarity index 58%
rename from Source Code/main/ExampleDAO.cs
rename to Source Code/main/SqlDAO.cs
index 64e3b63..8e331a7 100644
--- a/Source Code/main/ExampleDAO.cs
+++ b/Source Code/main/SqlDAO.cs
@@ -1,23 +1,22 @@
using Microsoft.Data.SqlClient;
+using TeamHobby.HobbyProjectGenerator.Models;
-namespace TeamHobby.HobbyProjectGenerator.Main
+namespace TeamHobby.HobbyProjectGenerator.DAL
{
- public class ExampleDAO
+ public class SqlDAO
{
-
- public void UserData(string username)
+ public IList GetUserData(string username)
{
// Sql server connection string, needs to be changed accordingly to connect
- var connString = "server=localhost,3316;user=root;database=users;password=Plop20"; // Using @" " makes the string literal
-
+ var connString = "server=localhost;userid=root;password=Plop20;database=users"; // Using @" " makes the string literal
+
// ADO.NET - ODBC
- using var conn = new SqlConnection(connString);
+ using (var conn = new SqlConnection(connString))
{
// More complex sql commands are done in this method instead
var sql = "Select * from roles";
using (var command = new SqlCommand(sql, conn))
{
- conn.Open();
// Get the results from the query
SqlDataReader r = command.ExecuteReader();
@@ -33,18 +32,18 @@ namespace TeamHobby.HobbyProjectGenerator.Main
{
Console.WriteLine(r.ToString());
}
- conn.Close();
-
+ return null;
}
- // Console.Read();
- /*
- * this is meant for specific basic sql commands
- using (var adapter = new SqlDataAdapter())
- {
- adapter.SelectCommand
- }
- */
- //return null;
+
+ /*// this is meant for specific basic sql commands
+ using (var adapter = new SqlDataAdapter())
+ {
+ adapter.UpdateCommand
+ adapter.DeleteCommand
+ adapter.InsertCommand
+ adapter.SelectCommand
+ }*/
+
}
}
}