practos/Demo/UI/MainMenu.cs

42 lines
1.1 KiB
C#
Raw Permalink Normal View History

using Demo.domain.Models;
using Demo.Domain.UseCase;
2024-10-14 12:10:53 +00:00
using System;
using System.Collections.Generic;
using System.ComponentModel;
2024-10-14 12:10:53 +00:00
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Demo.UI
{
public class MainMenuUI
{
2024-10-14 12:10:53 +00:00
UserConsoleUI _userConsoleUI;
public MainMenuUI(UserUseCase userUseCase) {
_userConsoleUI = new UserConsoleUI(userUseCase);
2024-10-16 07:01:04 +00:00
DisplayMenu();
}
2024-10-16 07:01:04 +00:00
private void DisplayMenu() {
while (true)
{
switch (Console.ReadLine())
{
case "1": _userConsoleUI.DisplayAllUsers(); break;
case "2": _userConsoleUI.RemoveUserByGuid(Guid.Parse(Console.ReadLine())); break;
case "3": _userConsoleUI.UpdateUser(Split(Console.ReadLine())); break;
case "4": _userConsoleUI.GetUserByGuid("614c0a23-5bd5-43ae-b48e-d5750afbc282"); break;
2024-10-16 07:01:04 +00:00
default: DisplayMenu();
break;
}
}
2024-10-14 12:10:53 +00:00
}
}
}