removed unused
This commit is contained in:
parent
5dacebdffd
commit
ab2096492c
@ -3,12 +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.UserManagement.Tests", "..\TeamHobby.UserManagement.Tests\TeamHobby.UserManagement.Tests.csproj", "{5C5A44B4-EC3C-44F2-8F39-F917F8ED932F}"
|
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{AA48A66C-FA36-4AF9-A782-CEC22838EB8F} = {AA48A66C-FA36-4AF9-A782-CEC22838EB8F}
|
|
||||||
{2E7193B8-86B6-48DA-9671-CD84615A5F5D} = {2E7193B8-86B6-48DA-9671-CD84615A5F5D}
|
|
||||||
EndProjectSection
|
|
||||||
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}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "main", "..\main\main.csproj", "{30C7EBF3-3957-46E5-86C1-C13356841ECA}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "main", "..\main\main.csproj", "{30C7EBF3-3957-46E5-86C1-C13356841ECA}"
|
||||||
@ -30,7 +24,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
|||||||
TeamHobby.HobbyProjectGenerator.csproj = TeamHobby.HobbyProjectGenerator.csproj
|
TeamHobby.HobbyProjectGenerator.csproj = TeamHobby.HobbyProjectGenerator.csproj
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeamHobby.Archiving.xTests", "TeamHobby.Archiving.xTests\TeamHobby.Archiving.xTests.csproj", "{8C039F49-13D3-4AEE-A1C3-A880751852BB}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TeamHobby.Archiving.xTests", "TeamHobby.Archiving.xTests\TeamHobby.Archiving.xTests.csproj", "{8C039F49-13D3-4AEE-A1C3-A880751852BB}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@ -38,9 +32,6 @@ Global
|
|||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{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.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}.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
|
||||||
|
|||||||
@ -1,163 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Data.Odbc;
|
|
||||||
using TeamHobby.HobbyProjectGenerator.DataAccess;
|
|
||||||
using TeamHobby.HobbyProjectGenerator.UserManagement;
|
|
||||||
|
|
||||||
namespace main
|
|
||||||
{
|
|
||||||
public class ExtractBulkOp
|
|
||||||
{
|
|
||||||
public void ExtractBulkOP(string signedUser, IDataSource<string> dbSource)
|
|
||||||
//public static void Main(string[] args)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// Get the current directory.
|
|
||||||
string path = Directory.GetCurrentDirectory();
|
|
||||||
// Open file reader stream
|
|
||||||
using StreamReader fileRead = new(path + "\\BulkOps\\Bulk.txt"); // path + "\\BulkOps\\{input}"
|
|
||||||
// Show location of the file being written
|
|
||||||
Console.WriteLine(path + "\\BulkOps\\Bulk.txt");
|
|
||||||
|
|
||||||
// List choices of operations
|
|
||||||
List<string> ops = new List<string> {"Create Account", "Edit Account",
|
|
||||||
"Delete Account", "Disable Account", "Enable Account"};
|
|
||||||
|
|
||||||
// List to hold file operation and credentials
|
|
||||||
List<string> fileList = new List<string>();
|
|
||||||
string operation = "";
|
|
||||||
string UN = "";
|
|
||||||
string PWD = "";
|
|
||||||
string Role = "";
|
|
||||||
string Email = "";
|
|
||||||
|
|
||||||
// Loop through file rows
|
|
||||||
while (!fileRead.EndOfStream)
|
|
||||||
{
|
|
||||||
// Create variable to hold current line
|
|
||||||
string line = fileRead.ReadLine();
|
|
||||||
|
|
||||||
// Check if line is not empty and contains the separator
|
|
||||||
if (line != null && line.Contains(":"))
|
|
||||||
{
|
|
||||||
// Assign value to hold current line parameter
|
|
||||||
string value = line.Split(':')[1].Trim();
|
|
||||||
|
|
||||||
// Check what operation is being called
|
|
||||||
if (ops.Contains(value))
|
|
||||||
{
|
|
||||||
// Add operation into temp
|
|
||||||
//Console.WriteLine("Found operation");
|
|
||||||
//Console.WriteLine(value);
|
|
||||||
operation = value;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string checkCredential = line.Split(':')[0].Trim();
|
|
||||||
//Console.WriteLine("Found credential");
|
|
||||||
switch (checkCredential)
|
|
||||||
{
|
|
||||||
case "Username":
|
|
||||||
UN = value;
|
|
||||||
break;
|
|
||||||
case "Password":
|
|
||||||
PWD = value;
|
|
||||||
break;
|
|
||||||
case "Role":
|
|
||||||
Role = value;
|
|
||||||
break;
|
|
||||||
case "Email":
|
|
||||||
Email = value;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
switch (operation)
|
|
||||||
{
|
|
||||||
case "Create Account":
|
|
||||||
//Console.WriteLine(operation);
|
|
||||||
if (String.IsNullOrEmpty(Role))
|
|
||||||
{
|
|
||||||
Role = null;
|
|
||||||
// Create UserAccount object
|
|
||||||
UserAccount user = new UserAccount(UN, PWD, Email, DateTime.UtcNow);
|
|
||||||
// Create Account service object
|
|
||||||
AccountService serviceTest = new AccountService();
|
|
||||||
Console.WriteLine($"VALUES ('{user.username}', " +
|
|
||||||
$"'{user.password}','{user.role}', 1," +
|
|
||||||
$"'Jacob', NOW(),'{user.email}');");
|
|
||||||
//Console.WriteLine(serviceTest.CreateUserRecord(user, 'Jacob', dbSource));
|
|
||||||
}
|
|
||||||
else if (String.IsNullOrEmpty(Email))
|
|
||||||
{
|
|
||||||
Email = null;
|
|
||||||
// Create UserAccount object
|
|
||||||
UserAccount user = new UserAccount(UN, PWD, Role);
|
|
||||||
// Create Account service object
|
|
||||||
AccountService serviceTest = new AccountService();
|
|
||||||
Console.WriteLine($"VALUES ('{user.username}', " +
|
|
||||||
$"'{user.password}','{user.role}', 1," +
|
|
||||||
$"'Jacob', NOW(),'{user.email}');");
|
|
||||||
//serviceTest.CreateUserRecord(user, signedUser, dbSource);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Console.WriteLine(UN);
|
|
||||||
// Create UserAccount object
|
|
||||||
UserAccount user = new UserAccount(UN, PWD, DateTime.UtcNow);
|
|
||||||
// Create Account service object
|
|
||||||
AccountService serviceTest = new AccountService();
|
|
||||||
if (user.email == null)
|
|
||||||
{
|
|
||||||
Console.WriteLine("wokring correctly");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Console.WriteLine($"VALUES ('{user.username}', " +
|
|
||||||
$"'{user.password}','{user.role}', 1," +
|
|
||||||
$"'Jacob', NOW(),'{user.email}');");
|
|
||||||
//serviceTest.CreateUserRecord(user, signedUser, dbSource);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "Edit Account":
|
|
||||||
//Console.WriteLine(operation);
|
|
||||||
//Console.WriteLine(operation);
|
|
||||||
|
|
||||||
break;
|
|
||||||
case "Delete Account":
|
|
||||||
//Console.WriteLine(operation);
|
|
||||||
//Console.WriteLine(operation);
|
|
||||||
|
|
||||||
break;
|
|
||||||
case "Disable Account":
|
|
||||||
//Console.WriteLine(operation);
|
|
||||||
//Console.WriteLine(operation);
|
|
||||||
|
|
||||||
break;
|
|
||||||
case "Enable Account":
|
|
||||||
//Console.WriteLine(operation);
|
|
||||||
//Console.WriteLine(operation);
|
|
||||||
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fileRead.Close();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Console.WriteLine("Error reading file");
|
|
||||||
Console.WriteLine(e.Message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user