-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
37 lines (32 loc) · 899 Bytes
/
Program.cs
File metadata and controls
37 lines (32 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using Erp;
using Spectre.Console;
using System.Collections.Specialized;
var exit = false;
while (!exit)
{
AnsiConsole.Clear();
var rule = new Rule("[green]ERP[/]").RuleStyle("grey42");
AnsiConsole.Write(rule);
BaseCommand baseCommand = null;
var command = AnsiConsole.Prompt(new SelectionPrompt<CommandMenu>().Title("[bold lightseagreen]Navigation Menu[/]").AddChoices(new CommandMenu[] { CommandMenu.Items, CommandMenu.Orders, CommandMenu.Exit }));
switch (command)
{
case CommandMenu.Items:
baseCommand = new ItemMenuCommand();
break;
case CommandMenu.Orders:
baseCommand = new OrderMenuCommand();
break;
default:
exit = true;
break;
}
if (baseCommand is not null)
baseCommand.Execute();
}
public enum CommandMenu
{
Items,
Orders,
Exit
}