123/123/UI/GroupConsole.cs

37 lines
1.1 KiB
C#
Raw Normal View History

2024-10-18 08:32:27 +00:00
using _123.Data.LocalData.Entity;
using _123.Domain.Models;
using _123.Domain.UseCase;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _123.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:32:27 +00:00
public void UpdateGroupName(String name, String name1)
{
StringBuilder groupOutput = new StringBuilder();
var group = _groupUseCase.UpdateGroupName(name,name1);
{
groupOutput.AppendLine($"{group.Name}\t{group.ID}");
}
Console.WriteLine(groupOutput);
}
}
}