Merge pull request #9 from long237/Jacobs-Branch
continued updates to menu
This commit is contained in:
commit
9e098b064f
@ -20,19 +20,15 @@ Global
|
|||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{C75B6909-FD9E-4382-94B6-7CA2CE371C9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{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.ActiveCfg = Release|Any CPU
|
||||||
{C75B6909-FD9E-4382-94B6-7CA2CE371C9A}.Release|Any CPU.Build.0 = 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.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.ActiveCfg = Release|Any CPU
|
||||||
{5C5A44B4-EC3C-44F2-8F39-F917F8ED932F}.Release|Any CPU.Build.0 = 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.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.ActiveCfg = Release|Any CPU
|
||||||
{DCB0E160-1F6D-406E-8633-489CD564479B}.Release|Any CPU.Build.0 = 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.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.ActiveCfg = Release|Any CPU
|
||||||
{75DED6C2-D404-4E71-A58B-0F616DB5C062}.Release|Any CPU.Build.0 = 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
|
{30C7EBF3-3957-46E5-86C1-C13356841ECA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
|||||||
@ -4,66 +4,37 @@ using System;
|
|||||||
|
|
||||||
namespace TeamHobby.HobbyProjectGenerator.Main
|
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 class Controller
|
||||||
{
|
{
|
||||||
public bool newAccount()
|
|
||||||
{
|
public static void Main(string[] args)
|
||||||
// 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)
|
|
||||||
{
|
{
|
||||||
|
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();
|
/* ExampleDAO z = new ExampleDAO();
|
||||||
z.UserData("Tomato");
|
z.UserData("Tomato");
|
||||||
Console.Read();*/
|
Console.Read();*/
|
||||||
bool MainMenu = true;
|
/*bool MainMenu = true;
|
||||||
|
|
||||||
// Set up menu loop
|
// Set up menu loop
|
||||||
while (MainMenu == true)
|
while (MainMenu == true)
|
||||||
@ -138,7 +109,7 @@ namespace TeamHobby.HobbyProjectGenerator.Main
|
|||||||
{
|
{
|
||||||
MainMenu = false;
|
MainMenu = false;
|
||||||
};
|
};
|
||||||
}
|
}*/
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,4 @@
|
|||||||
using System;
|
using Microsoft.Data.SqlClient;
|
||||||
using Microsoft.Data.SqlClient;
|
|
||||||
using TeamHobby.HobbyProjectGenerator;
|
|
||||||
using TeamHobby.HobbyProjectGenerator.DAL;
|
|
||||||
using TeamHobby.HobbyProjectGenerator.Models;
|
|
||||||
|
|
||||||
namespace TeamHobby.HobbyProjectGenerator.Main
|
namespace TeamHobby.HobbyProjectGenerator.Main
|
||||||
{
|
{
|
||||||
|
|||||||
@ -4,12 +4,12 @@ namespace TeamHobby.HobbyProjectGenerator.Main
|
|||||||
{
|
{
|
||||||
public class MainMenu
|
public class MainMenu
|
||||||
{
|
{
|
||||||
static void Main(string[] args)
|
/*static void Main(string[] args)
|
||||||
{
|
{
|
||||||
/* ExampleDAO z = new ExampleDAO();
|
/* ExampleDAO z = new ExampleDAO();
|
||||||
z.UserData("Tomato");
|
z.UserData("Tomato");
|
||||||
Console.Read();*/
|
Console.Read();*/
|
||||||
bool menu = true;
|
/*bool menu = true;
|
||||||
|
|
||||||
// Set up menu loop
|
// Set up menu loop
|
||||||
while (menu == true)
|
while (menu == true)
|
||||||
@ -83,7 +83,7 @@ namespace TeamHobby.HobbyProjectGenerator.Main
|
|||||||
{
|
{
|
||||||
|
|
||||||
}*/
|
}*/
|
||||||
conPsswrd = false;
|
/* conPsswrd = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -127,8 +127,8 @@ namespace TeamHobby.HobbyProjectGenerator.Main
|
|||||||
{
|
{
|
||||||
menu = false;
|
menu = false;
|
||||||
};
|
};
|
||||||
}
|
}*/
|
||||||
|
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,6 +8,55 @@ namespace main
|
|||||||
{
|
{
|
||||||
internal class SystemAccountManager
|
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()
|
public void AccountController()
|
||||||
{
|
{
|
||||||
// Create objects
|
// Create objects
|
||||||
@ -25,5 +74,6 @@ namespace main
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,7 @@ namespace main
|
|||||||
{
|
{
|
||||||
public class UserAccount
|
public class UserAccount
|
||||||
{
|
{
|
||||||
private string username;
|
/* private string username;
|
||||||
private string password;
|
private string password;
|
||||||
private string role;
|
private string role;
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ namespace main
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserAccount()
|
public void UserAccount()
|
||||||
{
|
{
|
||||||
password = "1234";
|
password = "1234";
|
||||||
role = "Regular";
|
role = "Regular";
|
||||||
@ -29,6 +29,6 @@ namespace main
|
|||||||
public void newUser()
|
public void newUser()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,4 +7,8 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.Data.SqlClient" Version="4.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user