41 lines
1.4 KiB
C#
41 lines
1.4 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|