diff --git a/Source Code/TeamHobby.HobbyProjectGenerator/TeamHobby.HobbyProjectGenerator.sln b/Source Code/TeamHobby.HobbyProjectGenerator/TeamHobby.HobbyProjectGenerator.sln index a3fe6d3..e3e8157 100644 --- a/Source Code/TeamHobby.HobbyProjectGenerator/TeamHobby.HobbyProjectGenerator.sln +++ b/Source Code/TeamHobby.HobbyProjectGenerator/TeamHobby.HobbyProjectGenerator.sln @@ -20,19 +20,15 @@ Global EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {C75B6909-FD9E-4382-94B6-7CA2CE371C9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C75B6909-FD9E-4382-94B6-7CA2CE371C9A}.Debug|Any CPU.Build.0 = Debug|Any CPU {C75B6909-FD9E-4382-94B6-7CA2CE371C9A}.Release|Any CPU.ActiveCfg = Release|Any CPU {C75B6909-FD9E-4382-94B6-7CA2CE371C9A}.Release|Any CPU.Build.0 = Release|Any CPU {5C5A44B4-EC3C-44F2-8F39-F917F8ED932F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5C5A44B4-EC3C-44F2-8F39-F917F8ED932F}.Debug|Any CPU.Build.0 = Debug|Any CPU {5C5A44B4-EC3C-44F2-8F39-F917F8ED932F}.Release|Any CPU.ActiveCfg = Release|Any CPU {5C5A44B4-EC3C-44F2-8F39-F917F8ED932F}.Release|Any CPU.Build.0 = Release|Any CPU {DCB0E160-1F6D-406E-8633-489CD564479B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DCB0E160-1F6D-406E-8633-489CD564479B}.Debug|Any CPU.Build.0 = Debug|Any CPU {DCB0E160-1F6D-406E-8633-489CD564479B}.Release|Any CPU.ActiveCfg = Release|Any CPU {DCB0E160-1F6D-406E-8633-489CD564479B}.Release|Any CPU.Build.0 = Release|Any CPU {75DED6C2-D404-4E71-A58B-0F616DB5C062}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {75DED6C2-D404-4E71-A58B-0F616DB5C062}.Debug|Any CPU.Build.0 = Debug|Any CPU {75DED6C2-D404-4E71-A58B-0F616DB5C062}.Release|Any CPU.ActiveCfg = Release|Any CPU {75DED6C2-D404-4E71-A58B-0F616DB5C062}.Release|Any CPU.Build.0 = Release|Any CPU {30C7EBF3-3957-46E5-86C1-C13356841ECA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU diff --git a/Source Code/main/Controller.cs b/Source Code/main/Controller.cs index c2d2936..586ed93 100644 --- a/Source Code/main/Controller.cs +++ b/Source Code/main/Controller.cs @@ -4,66 +4,37 @@ using System; namespace TeamHobby.HobbyProjectGenerator.Main { + public class GetCredentials + { + public string? GetUserName() + { + Console.WriteLine("Please enter a username:"); + string? userName = Console.ReadLine(); + return userName; + } + public string? GetPassword() + { + Console.WriteLine("Please enter a password:"); + string? userPassword = Console.ReadLine(); + return userPassword; + } + } public class Controller { - public bool newAccount() - { - // Get username - Console.WriteLine("Please enter a username:"); - string userName = Console.ReadLine(); - - // Get Password - Console.WriteLine("Please enter a password:"); - string userPassword = Console.ReadLine(); - - // Create bool value for password confirm loop - bool conPsswrd = true; - // Loop until password is confirmed - while (conPsswrd == true) - { - // Confirm Password - Console.WriteLine("Please re-enter the password:"); - string checkPsswd = Console.ReadLine(); - // Check if passwords match - if (userPassword == checkPsswd) - { - // Get Security question for password reset - Console.WriteLine("Please enter a security question.\n" + - "(EX: What is your favorite food?"); - string SecQuest = Console.ReadLine(); - // Get Security question answer - Console.WriteLine("Please enter the answer for your security question:"); - String SecAnswer = Console.ReadLine(); - - // Call user manager method to create the new user - //int userCreateConfirm = new CreateUser(userName,userPassword,SecQuest,SecAnswer); - - // Check if user creation was successful - /* if (userCreateConfirm = 1) - { - - // Confirm to user that the account has been created - Console.WriteLine("Account created succesfully with the username of" + userName); - } - else - { - - }*/ - conPsswrd = false; - } - else - { - Console.WriteLine("Passwords did not match, please try again."); - } - } - return true; - } - static void Main(string[] args) + + public static void Main(string[] args) { + GetCredentials credentials = new GetCredentials(); + string? username = credentials.GetUserName(); + string? password = credentials.GetPassword(); + + + Console.WriteLine(value: $"username is {username}\npassword is {password}"); + /* ExampleDAO z = new ExampleDAO(); z.UserData("Tomato"); Console.Read();*/ - bool MainMenu = true; + /*bool MainMenu = true; // Set up menu loop while (MainMenu == true) @@ -138,7 +109,7 @@ namespace TeamHobby.HobbyProjectGenerator.Main { MainMenu = false; }; - } + }*/ } } diff --git a/Source Code/main/ExampleDAO.cs b/Source Code/main/ExampleDAO.cs index 4e6b14b..64e3b63 100644 --- a/Source Code/main/ExampleDAO.cs +++ b/Source Code/main/ExampleDAO.cs @@ -1,8 +1,4 @@ -using System; -using Microsoft.Data.SqlClient; -using TeamHobby.HobbyProjectGenerator; -using TeamHobby.HobbyProjectGenerator.DAL; -using TeamHobby.HobbyProjectGenerator.Models; +using Microsoft.Data.SqlClient; namespace TeamHobby.HobbyProjectGenerator.Main { diff --git a/Source Code/main/MainMenu.cs b/Source Code/main/MainMenu.cs index 962569e..64a8930 100644 --- a/Source Code/main/MainMenu.cs +++ b/Source Code/main/MainMenu.cs @@ -4,12 +4,12 @@ namespace TeamHobby.HobbyProjectGenerator.Main { public class MainMenu { - static void Main(string[] args) + /*static void Main(string[] args) { /* ExampleDAO z = new ExampleDAO(); z.UserData("Tomato"); Console.Read();*/ - bool menu = true; + /*bool menu = true; // Set up menu loop while (menu == true) @@ -83,7 +83,7 @@ namespace TeamHobby.HobbyProjectGenerator.Main { }*/ - conPsswrd = false; + /* conPsswrd = false; } else { @@ -127,8 +127,8 @@ namespace TeamHobby.HobbyProjectGenerator.Main { menu = false; }; - } + }*/ - } + //} } } diff --git a/Source Code/main/SystemAccountManager.cs b/Source Code/main/SystemAccountManager.cs index 908f1d5..78a9ff3 100644 --- a/Source Code/main/SystemAccountManager.cs +++ b/Source Code/main/SystemAccountManager.cs @@ -8,6 +8,55 @@ namespace main { internal class SystemAccountManager { + /*public NewUserName() + { + + } + public NewPassword() + { + // Create bool value for password confirm loop + bool conPsswrd = true; + // Loop until password is confirmed + while (conPsswrd == true) + { + // Confirm Password + Console.WriteLine("Please re-enter the password:"); + string checkPsswd = Console.ReadLine(); + // Check if passwords match + if (userPassword == checkPsswd) + { + // Get Security question for password reset + Console.WriteLine("Please enter a security question.\n" + + "(EX: What is your favorite food?"); + string SecQuest = Console.ReadLine(); + // Get Security question answer + Console.WriteLine("Please enter the answer for your security question:"); + String SecAnswer = Console.ReadLine(); + + // Call user manager method to create the new user + //int userCreateConfirm = new CreateUser(userName,userPassword,SecQuest,SecAnswer); + + // Check if user creation was successful + /*if (userCreateConfirm = 1) + { + + // Confirm to user that the account has been created + Console.WriteLine("Account created succesfully with the username of" + userName); + } + else + { + + }*/ + /*conPsswrd = false; + } + else + { + Console.WriteLine("Passwords did not match, please try again."); + } + } + return true; + }*/ + public void AccountController() { // Create objects @@ -25,5 +74,6 @@ namespace main } } + } } diff --git a/Source Code/main/UserAccount.cs b/Source Code/main/UserAccount.cs index 271d055..92e0c55 100644 --- a/Source Code/main/UserAccount.cs +++ b/Source Code/main/UserAccount.cs @@ -8,7 +8,7 @@ namespace main { public class UserAccount { - private string username; + /* private string username; private string password; private string role; @@ -20,7 +20,7 @@ namespace main } - public UserAccount() + public void UserAccount() { password = "1234"; role = "Regular"; @@ -29,6 +29,6 @@ namespace main public void newUser() { - } + }*/ } } diff --git a/Source Code/main/main.csproj b/Source Code/main/main.csproj index 74abf5c..3b75bc7 100644 --- a/Source Code/main/main.csproj +++ b/Source Code/main/main.csproj @@ -7,4 +7,8 @@ enable + + + +