presence_sample_v2/console_ui/GroupUI.cs

41 lines
1.4 KiB
C#
Raw Permalink Normal View History

2024-11-22 12:18:04 +00:00
using domain.Request;
using domain.Service;
using domain.UseCase;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace console_ui
{
class GroupUI
{
private readonly IGroupUseCase _groupService;
public GroupUI(IGroupUseCase groupService)
{
_groupService = groupService;
}
public void AddGroup() {
Console.WriteLine("Введите имя группы");
_groupService.AddGroup(new AddGroupRequest { Name = Console.ReadLine() });
}
public void AddGroupWithStudents() {
Console.WriteLine("Введите имя группы");
AddGroupRequest addGroupRequest = new AddGroupRequest { Name = Console.ReadLine()};
List<AddStudentRequest> addStudentRequests = new List<AddStudentRequest>() {
new AddStudentRequest{StudentName = "123" },
new AddStudentRequest{StudentName = "312" },
new AddStudentRequest{StudentName = "222" },
new AddStudentRequest{StudentName = "444" },
};
AddGroupWithStudentsRequest addGroupWithStudents = new AddGroupWithStudentsRequest {
addGroupRequest = addGroupRequest,
AddStudentRequests = addStudentRequests
};
_groupService.AddGroupWithSutdents(addGroupWithStudents);
}
}
}