40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
|
using presence.Data.LocalData.Entity;
|
|||
|
using presence.Domain.Models;
|
|||
|
using presence.Domain.UseCase;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
namespace presence.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);
|
|||
|
}
|
|||
|
public void UpdateGroupName(String name, String name1)
|
|||
|
{
|
|||
|
StringBuilder groupOutput = new StringBuilder();
|
|||
|
var group = _groupUseCase.UpdateGroupName(name,name1);
|
|||
|
}
|
|||
|
public void AddGroup (String name, String id)
|
|||
|
{
|
|||
|
string output = _groupUseCase.AddGroup(name , id) ? "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" : "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|||
|
Console.WriteLine(output);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
}
|