-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserInterface.cs
More file actions
32 lines (27 loc) · 871 Bytes
/
Copy pathUserInterface.cs
File metadata and controls
32 lines (27 loc) · 871 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
using Spectre.Console;
namespace TCSA.OOP.LibraryManagementSystem;
internal class UserInterface
{
private BooksController booksController = new BooksController();
internal void MainMenu()
{
while (true)
{
Console.Clear();
var choice = AnsiConsole.Prompt(
new SelectionPrompt<MenuOption>().Title("What do you want to do next?").AddChoices(Enum.GetValues<MenuOption>()));
switch (choice)
{
case MenuOption.ViewBooks:
booksController.ViewBooks();
break;
case MenuOption.AddBook:
booksController.AddBook();
break;
case MenuOption.DeleteBook:
booksController.DeleteBook();
break;
}
}
}
}