Display fundamentals

This commit is contained in:
Dimitar Byalkov
2021-03-19 09:51:42 +02:00
parent 7507023d11
commit 701be834cf
9 changed files with 160 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
using System; using Business.Business.UserManagment;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
@@ -28,7 +29,23 @@ namespace Display.InitialSetup
} }
public void InitialRegistration() public void InitialRegistration()
{ {
InitialUserInput(); var uc = new UserController();
try
{
if (uc.CheckIfUserEverCreated())
{
}
else
{
uc.RegisterItem(InitialUserInput()[0], InitialUserInput()[1]);
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
} }
} }
} }

View File

@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Display
{
class InputHandler
{
public void CommandLineInterface()
{
ShowAvaliableCommands();
while (true)
{
Console.WriteLine("Select action");
Console.WriteLine("Sales, UserManagment");
string input = "";
try
{
Console.Write("> ");
input = Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
switch (input)
{
case "sales": break;
case "usermanagment": break;
default: break;
}
}
}
public void ShowAvaliableCommands()
{
Console.WriteLine("asad");
Console.WriteLine("asad");
Console.WriteLine("asad");
Console.WriteLine("asad");
Console.WriteLine("asad");
}
public void Sales()
{
try
{
Console.Write("> ");
string input = Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
}
}

View File

@@ -12,6 +12,8 @@ namespace Display
{ {
var a = new InitialSetup.InitialSetup(); var a = new InitialSetup.InitialSetup();
a.InitialRegistration(); a.InitialRegistration();
var ih = new InputHandler();
ih.CommandLineInterface();
} }
} }
} }

View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Display.Sales
{
class Deal
{
}
}

View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Display.Sales
{
class Stock
{
public void
}
}

View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Display
{
class AdminView
{
}
}

View File

@@ -0,0 +1,33 @@
using Models.Models;
using System;
using System.Collections.Generic;
using System.Text;
namespace Display.Views
{
class BaseView
{
public virtual void ShowAvaliableCommands()
{
Console.WriteLine("1. Sales");
}
public void SaleHandle()
{
Deal deal = new Deal();
Product product = new Product();
while (true)
{
SearchItem();
SaleItem();
}
}
private void SearchItem()
{
}
private void SaleItem()
{
}
}
}

View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Display.Views
{
class CashierView
{
}
}

View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Display.Views
{
class ManagerView
{
}
}