updated menu and uiprint
working on menu switch still and rearranged project folders
This commit is contained in:
parent
f67b172f8d
commit
55ab7c6cf2
@ -0,0 +1,39 @@
|
|||||||
|
// Print Statements used throughout the program.
|
||||||
|
|
||||||
|
namespace TeamHobby.HobbyProjectGenerator.DataAccess
|
||||||
|
{
|
||||||
|
public class UiPrint
|
||||||
|
{
|
||||||
|
public void InitialMenu()
|
||||||
|
{
|
||||||
|
// Create intial menu
|
||||||
|
Console.WriteLine("What would you like to access?");
|
||||||
|
int num = 1;
|
||||||
|
Console.WriteLine(num + ".User Management");
|
||||||
|
num += 1;
|
||||||
|
Console.WriteLine(num + ".Logging");
|
||||||
|
}
|
||||||
|
public void UserManagementMenu(string username)
|
||||||
|
{
|
||||||
|
// Menu for all UserManagement options
|
||||||
|
int menu = 0;
|
||||||
|
Console.WriteLine($"Welcome {username} to User Management.\n");
|
||||||
|
Console.WriteLine("What would you like to do?\n");
|
||||||
|
Console.WriteLine(menu + ") To exit User Management.\n");
|
||||||
|
menu += 1;
|
||||||
|
Console.WriteLine(menu + ") Create a new account.\n");
|
||||||
|
menu += 1;
|
||||||
|
Console.WriteLine(menu + ") Edit an account.\n");
|
||||||
|
menu += 1;
|
||||||
|
Console.WriteLine(menu + ") Delete an account.\n");
|
||||||
|
menu += 1;
|
||||||
|
Console.WriteLine(menu + ") Disable an account.\n");
|
||||||
|
menu += 1;
|
||||||
|
Console.WriteLine(menu + ") Enable an account.\n");
|
||||||
|
menu += 1;
|
||||||
|
Console.WriteLine(menu + ") View logs.\n");
|
||||||
|
menu += 1;
|
||||||
|
Console.WriteLine(menu + ") View Archive.\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -5,7 +5,6 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Data.Odbc;
|
using System.Data.Odbc;
|
||||||
using TeamHobby.HobbyProjectGenerator.UserManagement;
|
using TeamHobby.HobbyProjectGenerator.UserManagement;
|
||||||
using TeamHobby.HobbyProjectGenerator.Implementations;
|
|
||||||
using TeamHobby.HobbyProjectGenerator.DataAccess;
|
using TeamHobby.HobbyProjectGenerator.DataAccess;
|
||||||
|
|
||||||
namespace TeamHobby.HobbyProjectGenerator.UserManagement
|
namespace TeamHobby.HobbyProjectGenerator.UserManagement
|
||||||
@ -112,17 +111,29 @@ namespace TeamHobby.HobbyProjectGenerator.UserManagement
|
|||||||
{
|
{
|
||||||
// db.users layout (UserName, Password, RoleID, IsActive, CreatedBy, CreatedDate)
|
// db.users layout (UserName, Password, RoleID, IsActive, CreatedBy, CreatedDate)
|
||||||
// db.roles layout (RoleID(AutoGen), Role, CreatedBy, CreatedDate)
|
// db.roles layout (RoleID(AutoGen), Role, CreatedBy, CreatedDate)
|
||||||
|
// Create UiPrint Object
|
||||||
// Menu for all UserManagement options
|
UiPrint ui = new UiPrint();
|
||||||
int menu = 0;
|
// Print User Management menu
|
||||||
Console.WriteLine($"Welcome {user.username} to User Management.\n");
|
ui.UserManagementMenu(user.username);
|
||||||
Console.WriteLine("What would you like to do?\n");
|
// Create bool object for menu loop
|
||||||
Console.WriteLine((menu + 1) + ". Create a new account.");
|
bool menuLoop = true;
|
||||||
Console.WriteLine((menu + 1) + ". Edit an account.");
|
// Create loop for menu
|
||||||
Console.WriteLine((menu + 1) + ". Delete an account.");
|
while (menuLoop is true) {
|
||||||
Console.WriteLine((menu + 1) + ". Disable an account.");
|
// Get user choice
|
||||||
Console.WriteLine((menu + 1) + ". Enable an account.");
|
int menuChoice = Convert.ToInt32(Console.ReadLine());
|
||||||
|
// Complete the appropriate action
|
||||||
|
switch (menuChoice)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
return "Exiting UserManagement.\n";
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Console.WriteLine("Invalid input.\nPlease enter a valid option.\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -196,13 +207,6 @@ namespace TeamHobby.HobbyProjectGenerator.UserManagement
|
|||||||
|
|
||||||
bool foo = true;
|
bool foo = true;
|
||||||
|
|
||||||
while (foo == true)
|
|
||||||
{
|
|
||||||
// sub menu
|
|
||||||
ui.SystemAccountMenu();
|
|
||||||
//
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\TeamHobby.HobbyProjectGenerator.DataAccess\TeamHobby.HobbyProjectGenerator.DataAccess.csproj" />
|
<ProjectReference Include="..\TeamHobby.HobbyProjectGenerator.DataAccess\TeamHobby.HobbyProjectGenerator.DataAccess.csproj" />
|
||||||
<ProjectReference Include="..\TeamHobby.HobbyProjectGenerator\TeamHobby.HobbyProjectGenerator.csproj" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -1,53 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace TeamHobby.HobbyProjectGenerator.Implementations
|
|
||||||
{
|
|
||||||
public class InMemoryUserService
|
|
||||||
{
|
|
||||||
// Make it readonly so it can't be changed
|
|
||||||
private readonly IList<string> _logstore;
|
|
||||||
|
|
||||||
public InMemoryUserService()
|
|
||||||
{
|
|
||||||
_logstore = new List<string>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public IList<string> GetAllUsers()
|
|
||||||
{
|
|
||||||
return _logstore;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool User(string username)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//DateTime.UtcNow.ToString() + "->" + username; old way of doing it
|
|
||||||
_logstore.Add($"{DateTime.UtcNow}->{username}"); // New way of doing it
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
public bool User(DateTime timestamp, string username)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//DateTime.UtcNow.ToString() + "->" + username; old way of doing it
|
|
||||||
_logstore.Add($"{timestamp.ToUniversalTime()}->{username}"); // New way of doing it
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using TeamHobby.HobbyProjectGenerator.UserManagement;
|
||||||
|
|
||||||
// Print Statements used throughout the program.
|
// Print Statements used throughout the program.
|
||||||
|
|
||||||
@ -21,12 +22,16 @@ namespace TeamHobby.HobbyProjectGenerator
|
|||||||
}
|
}
|
||||||
public void SystemAccountMenu()
|
public void SystemAccountMenu()
|
||||||
{
|
{
|
||||||
// Create intial menu
|
UserAccount user = new UserAccount();
|
||||||
Console.WriteLine("What would you like to do?");
|
// Menu for all UserManagement options
|
||||||
int num = 1;
|
int menu = 0;
|
||||||
Console.WriteLine(num + ".Create a new account.");
|
Console.WriteLine($"Welcome {user.username} to User Management.\n");
|
||||||
num += 1;
|
Console.WriteLine("What would you like to do?\n");
|
||||||
Console.WriteLine(num + ".Access Admin Features");
|
Console.WriteLine((menu + 1) + ". Create a new account.");
|
||||||
|
Console.WriteLine((menu + 1) + ". Edit an account.");
|
||||||
|
Console.WriteLine((menu + 1) + ". Delete an account.");
|
||||||
|
Console.WriteLine((menu + 1) + ". Disable an account.");
|
||||||
|
Console.WriteLine((menu + 1) + ". Enable an account.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,17 +0,0 @@
|
|||||||
namespace TeamHobby.HobbyProjectGenerator
|
|
||||||
{
|
|
||||||
public class User_Authentication
|
|
||||||
{
|
|
||||||
public IList<string> GetAllUsers()
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool User(string username)
|
|
||||||
{
|
|
||||||
//Console.WriteLine("Hello World!");
|
|
||||||
//Console.WriteLine("Testing console");
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace TeamHobby.HobbyProjectGenerator.Implementations
|
|
||||||
{
|
|
||||||
public class User_Manager
|
|
||||||
{
|
|
||||||
public IList<string> GetAllUsers()
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool User(string username)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||||||
# Visual Studio Version 17
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 17.0.31919.166
|
VisualStudioVersion = 17.0.31919.166
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TeamHobby.HobbyProjectGenerator", "TeamHobby.HobbyProjectGenerator.csproj", "{C75B6909-FD9E-4382-94B6-7CA2CE371C9A}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TeamHobby.UserManagement.Tests", "..\TeamHobby.UserManagement.Tests\TeamHobby.UserManagement.Tests.csproj", "{5C5A44B4-EC3C-44F2-8F39-F917F8ED932F}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TeamHobby.UserManagement.Tests", "..\TeamHobby.UserManagement.Tests\TeamHobby.UserManagement.Tests.csproj", "{5C5A44B4-EC3C-44F2-8F39-F917F8ED932F}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TeamHobby.HobbyProjectGenerator.Models", "..\TeamHobby.HobbyProjectGenerator.Models\TeamHobby.HobbyProjectGenerator.Models.csproj", "{75DED6C2-D404-4E71-A58B-0F616DB5C062}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TeamHobby.HobbyProjectGenerator.Models", "..\TeamHobby.HobbyProjectGenerator.Models\TeamHobby.HobbyProjectGenerator.Models.csproj", "{75DED6C2-D404-4E71-A58B-0F616DB5C062}"
|
||||||
@ -25,10 +23,6 @@ Global
|
|||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
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.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.ActiveCfg = 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
|
||||||
|
|||||||
@ -14,8 +14,4 @@
|
|||||||
<PackageReference Include="coverlet.collector" Version="3.1.0" />
|
<PackageReference Include="coverlet.collector" Version="3.1.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\TeamHobby.HobbyProjectGenerator\TeamHobby.HobbyProjectGenerator.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -11,6 +11,14 @@ namespace TeamHobby.HobbyProjectGenerator.Main
|
|||||||
{
|
{
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
// Console customization
|
||||||
|
// Change the look of the console
|
||||||
|
Console.Title = "HobbyProjectGenerator";
|
||||||
|
// Change console text color
|
||||||
|
Console.ForegroundColor = ConsoleColor.Green;
|
||||||
|
// Change terminal height
|
||||||
|
Console.WindowHeight = 40;
|
||||||
|
|
||||||
// Creating the Factory class
|
// Creating the Factory class
|
||||||
string dbType = "sql";
|
string dbType = "sql";
|
||||||
RDSFactory factory = new RDSFactory();
|
RDSFactory factory = new RDSFactory();
|
||||||
|
|||||||
@ -16,7 +16,6 @@
|
|||||||
<ProjectReference Include="..\TeamHobby.HobbyProjectGenerator.DataAccess\TeamHobby.HobbyProjectGenerator.DataAccess.csproj" />
|
<ProjectReference Include="..\TeamHobby.HobbyProjectGenerator.DataAccess\TeamHobby.HobbyProjectGenerator.DataAccess.csproj" />
|
||||||
<ProjectReference Include="..\TeamHobby.HobbyProjectGenerator.Models\TeamHobby.HobbyProjectGenerator.Models.csproj" />
|
<ProjectReference Include="..\TeamHobby.HobbyProjectGenerator.Models\TeamHobby.HobbyProjectGenerator.Models.csproj" />
|
||||||
<ProjectReference Include="..\TeamHobby.HobbyProjectGenerator.UserManagement\TeamHobby.HobbyProjectGenerator.UserManagement.csproj" />
|
<ProjectReference Include="..\TeamHobby.HobbyProjectGenerator.UserManagement\TeamHobby.HobbyProjectGenerator.UserManagement.csproj" />
|
||||||
<ProjectReference Include="..\TeamHobby.HobbyProjectGenerator\TeamHobby.HobbyProjectGenerator.csproj" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user