Display InitialSetup

This commit is contained in:
Dimitar Byalkov
2021-03-19 01:39:47 +02:00
parent 9a4fa93aad
commit 8506673a91
3 changed files with 42 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
@@ -17,4 +17,9 @@
<ProjectReference Include="..\Models\Data.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Sales\" />
<Folder Include="UserManagment\" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Display.InitialSetup
{
public class InitialSetup
{
public InitialSetup()
{
}
public string[] InitialUserInput()
{
string userName = "", password = "";
try
{
Console.Write("Enter username: ");
userName = Console.ReadLine();
Console.Write("Enter password: ");
password = Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
return new string[] { userName, password };
}
public void InitialRegistration()
{
InitialUserInput();
}
}
}

View File

@@ -10,19 +10,8 @@ namespace Display
{
static void Main(string[] args)
{
try
{
var a = new UserController();
a.UpdateRole(1, "Cashier");
foreach (var item in a.GetAll())
{
Console.WriteLine($"{item.Name} {item.Role.Name}");
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
var a = new InitialSetup.InitialSetup();
a.InitialRegistration();
}
}
}