presenceNikita/Demo/UI/GroupConsole.cs

42 lines
913 B
C#
Raw Permalink Normal View History

2024-10-18 14:03:25 +00:00
using Demo.Domain.UseCase;
using Demo.domain.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
2024-10-18 14:03:25 +00:00
using System.Xml.Linq;
using System.Text.RegularExpressions;
namespace Demo.UI
{
2024-10-18 14:03:25 +00:00
internal class GroupConsoleUI
{
2024-10-18 14:03:25 +00:00
GroupUseCase _groupUseCase;
public GroupConsoleUI(GroupUseCase groupUseCase)
{
_groupUseCase = groupUseCase;
}
public void AllGroups()
{
foreach (var Group in _groupUseCase.GetAllGroups())
{
Console.WriteLine($"{Group.Id}\t{Group.Name}");
}
}
public void CreateGroup(string NameGroup)
{
_groupUseCase.AddGroup(NameGroup);
}
public void UpdateNameGroup(int id, string name)
{
_groupUseCase.UpdateGroup(id, name);
}
}
}