Raspisanie/Zurnal/UI/UserConsole.cs
2024-11-02 13:40:07 +03:00

31 lines
883 B
C#

using System.Text;
using Zurnal.Domain.UseCase;
namespace Zurnal.UI
{
public class UserConsoleUI
{
UserUseCase _userUseCase;
public UserConsoleUI(UserUseCase userUseCase)
{
_userUseCase = userUseCase;
}
public void RemoveUserByGuid(Guid guidUser)
{
string output = _userUseCase.RemoveUserByGuid(guidUser) ? "Пользователь удален" : "Пользователь не удален";
Console.WriteLine(output);
}
public void DisplayAllUsers()
{
StringBuilder userOutput = new StringBuilder();
foreach (var user in _userUseCase.GetAllUsers())
{
userOutput.AppendLine($"{user.UserGuid}\t{user.FIO}\t{user.Group.GroupName}");
}
Console.WriteLine(userOutput);
}
}
}