2024-10-18 08:27:50 +00:00
|
|
|
using Posechaemost.Domain.Models;
|
2024-10-17 16:08:02 +00:00
|
|
|
using Posechaemost.Domain.UseCase;
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Text;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
namespace Posechaemost.UI
|
|
|
|
{
|
|
|
|
public class GroupConsoleUI
|
|
|
|
{
|
|
|
|
GroupUseCase _groupUseCase;
|
|
|
|
public GroupConsoleUI(GroupUseCase groupUseCase) {
|
|
|
|
_groupUseCase = groupUseCase;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void DisplayAllGroups()
|
|
|
|
{
|
|
|
|
StringBuilder groupOutput = new StringBuilder();
|
|
|
|
foreach (var group in _groupUseCase.GetAllGroups())
|
|
|
|
{
|
|
|
|
groupOutput.AppendLine($"{group.Id}\t{group.Name}");
|
|
|
|
}
|
|
|
|
Console.WriteLine(groupOutput);
|
|
|
|
}
|
2024-10-18 08:27:50 +00:00
|
|
|
|
|
|
|
public void UpdateGroupName(String name, String name1) {
|
|
|
|
StringBuilder userOutput = new StringBuilder();
|
|
|
|
var group = _groupUseCase.UpdateGroupName(name, name1);
|
|
|
|
userOutput.AppendLine($"{group.Id}\t{group.Name}");
|
|
|
|
Console.WriteLine(userOutput);
|
|
|
|
}
|
2024-10-17 16:08:02 +00:00
|
|
|
}
|
|
|
|
}
|