update
This commit is contained in:
parent
07596a597c
commit
fca90f53eb
@ -18,6 +18,8 @@ IServiceCollection services = new ServiceCollection();
|
|||||||
.AddSingleton<IPresenceUseCase, PresenceUseCase>()
|
.AddSingleton<IPresenceUseCase, PresenceUseCase>()
|
||||||
.AddSingleton<IAdminUseCase, AdminUseCase>()
|
.AddSingleton<IAdminUseCase, AdminUseCase>()
|
||||||
.AddSingleton<UserConsoleUI>()
|
.AddSingleton<UserConsoleUI>()
|
||||||
|
.AddSingleton<GroupConsoleUI>()
|
||||||
|
.AddSingleton<PresenceConsoleUI>()
|
||||||
.AddSingleton<AdminConsoleUI>()
|
.AddSingleton<AdminConsoleUI>()
|
||||||
.AddSingleton<MainMenuUI>();
|
.AddSingleton<MainMenuUI>();
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ public class AdminController: ControllerBase{
|
|||||||
{
|
{
|
||||||
if (request == null || string.IsNullOrEmpty(request.GroupName))
|
if (request == null || string.IsNullOrEmpty(request.GroupName))
|
||||||
{
|
{
|
||||||
_logger.LogWarning("Invalid request");
|
_logger.LogWarning("CreateGroup: Invalid request");
|
||||||
return BadRequest("Invalid request");
|
return BadRequest("Invalid request");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,12 +43,12 @@ public class AdminController: ControllerBase{
|
|||||||
[HttpDelete("user")]
|
[HttpDelete("user")]
|
||||||
public ActionResult<bool> DeleteUser(Guid userGuid){
|
public ActionResult<bool> DeleteUser(Guid userGuid){
|
||||||
if (userGuid == Guid.Empty){
|
if (userGuid == Guid.Empty){
|
||||||
_logger.LogWarning("Invalid request");
|
_logger.LogWarning("DeleteUser: userGuid empty");
|
||||||
return BadRequest("Invalid request");
|
return BadRequest("Invalid request");
|
||||||
}
|
}
|
||||||
bool isDeleted = _userUseCase.RemoveUserByGuid(userGuid);
|
bool isDeleted = _userUseCase.RemoveUserByGuid(userGuid);
|
||||||
if (isDeleted == false){
|
if (isDeleted == false){
|
||||||
_logger.LogWarning("User not found");
|
_logger.LogWarning("DeleteUser: User not found");
|
||||||
return NotFound("User not found");
|
return NotFound("User not found");
|
||||||
}
|
}
|
||||||
return Ok(true);
|
return Ok(true);
|
||||||
@ -57,7 +57,7 @@ public class AdminController: ControllerBase{
|
|||||||
[HttpDelete("users")]
|
[HttpDelete("users")]
|
||||||
public ActionResult<bool> DeleteUsers([FromBody] DeleteUsersRequest request){
|
public ActionResult<bool> DeleteUsers([FromBody] DeleteUsersRequest request){
|
||||||
if (request == null){
|
if (request == null){
|
||||||
_logger.LogWarning("Invalid request");
|
_logger.LogWarning("DeleteUsers null request");
|
||||||
return BadRequest("Invalid request");
|
return BadRequest("Invalid request");
|
||||||
}
|
}
|
||||||
foreach (Guid userGuid in request.UsersGuid)
|
foreach (Guid userGuid in request.UsersGuid)
|
||||||
|
@ -23,7 +23,7 @@ public class PresenceController: ControllerBase{
|
|||||||
|
|
||||||
if (!DateOnly.TryParse(date, out var parseDate))
|
if (!DateOnly.TryParse(date, out var parseDate))
|
||||||
{
|
{
|
||||||
_logger.LogWarning("Invalid date format");
|
_logger.LogWarning("GeneratePresence: Invalid date format");
|
||||||
return BadRequest("Invalid date format");
|
return BadRequest("Invalid date format");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,13 +50,13 @@ public class PresenceController: ControllerBase{
|
|||||||
public ActionResult<bool> DeletePresenceByUserGuid(Guid userGuid)
|
public ActionResult<bool> DeletePresenceByUserGuid(Guid userGuid)
|
||||||
{
|
{
|
||||||
if (userGuid == Guid.Empty){
|
if (userGuid == Guid.Empty){
|
||||||
_logger.LogWarning("Invalid Guid");
|
_logger.LogWarning("DeletePresenceByUserGuid: userGuid empty");
|
||||||
return BadRequest("Invalid request");
|
return BadRequest("Invalid request");
|
||||||
}
|
}
|
||||||
|
|
||||||
var isDeleted = _presenceUseCase.DeletePresenceByUser(userGuid);
|
var isDeleted = _presenceUseCase.DeletePresenceByUser(userGuid);
|
||||||
if (isDeleted == false){
|
if (isDeleted == false){
|
||||||
_logger.LogWarning("User not found");
|
_logger.LogWarning("DeletePresenceByUserGuid: User not found");
|
||||||
return NotFound("User not found");
|
return NotFound("User not found");
|
||||||
}
|
}
|
||||||
return Ok(true);
|
return Ok(true);
|
||||||
@ -67,7 +67,7 @@ public class PresenceController: ControllerBase{
|
|||||||
{
|
{
|
||||||
var isDeleted = _presenceUseCase.DeletePresenceByGroup(groupID);
|
var isDeleted = _presenceUseCase.DeletePresenceByGroup(groupID);
|
||||||
if (isDeleted == false){
|
if (isDeleted == false){
|
||||||
_logger.LogWarning("Group not found");
|
_logger.LogWarning("DeletePresenceByGroup: Group not found");
|
||||||
return NotFound("Group not found");
|
return NotFound("Group not found");
|
||||||
}
|
}
|
||||||
return Ok(true);
|
return Ok(true);
|
||||||
@ -79,13 +79,13 @@ public class PresenceController: ControllerBase{
|
|||||||
if (!DateOnly.TryParse(startDate, out var parsedStartDate) ||
|
if (!DateOnly.TryParse(startDate, out var parsedStartDate) ||
|
||||||
!DateOnly.TryParse(endDate, out var parsedEndDate))
|
!DateOnly.TryParse(endDate, out var parsedEndDate))
|
||||||
{
|
{
|
||||||
_logger.LogWarning("Invalid date format");
|
_logger.LogWarning("DeletePresenceByDateRange: Invalid date format");
|
||||||
return BadRequest("Invalid date format");
|
return BadRequest("Invalid date format");
|
||||||
}
|
}
|
||||||
|
|
||||||
var isDeleted = _presenceUseCase.DeletePresenceByDateRange(parsedStartDate, parsedEndDate);
|
var isDeleted = _presenceUseCase.DeletePresenceByDateRange(parsedStartDate, parsedEndDate);
|
||||||
if (isDeleted == false){
|
if (isDeleted == false){
|
||||||
_logger.LogWarning("Presence not found");
|
_logger.LogWarning("DeletePresenceByDateRange: Presence not found");
|
||||||
return NotFound("Presence not found");
|
return NotFound("Presence not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,13 +97,13 @@ public class PresenceController: ControllerBase{
|
|||||||
{
|
{
|
||||||
if (!DateOnly.TryParse(date, out var parseDate))
|
if (!DateOnly.TryParse(date, out var parseDate))
|
||||||
{
|
{
|
||||||
_logger.LogWarning("Invalid date format");
|
_logger.LogWarning("UpdatePresence: Invalid date format");
|
||||||
return BadRequest("Invalid date format");
|
return BadRequest("Invalid date format");
|
||||||
}
|
}
|
||||||
|
|
||||||
var isUpdated = _presenceUseCase.IsAttedance(firstLesson, lastLesson, parseDate, UserGuid);
|
var isUpdated = _presenceUseCase.IsAttedance(firstLesson, lastLesson, parseDate, UserGuid);
|
||||||
if (isUpdated == false){
|
if (isUpdated == false){
|
||||||
_logger.LogWarning("Presence not found");
|
_logger.LogWarning("UpdatePresence: Presence not found");
|
||||||
return NotFound("Presence not found");
|
return NotFound("Presence not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,9 @@ builder.Services.AddDbContext<RemoteDatabaseContext>();
|
|||||||
builder.Services.AddEndpointsApiExplorer();
|
builder.Services.AddEndpointsApiExplorer();
|
||||||
builder.Services.AddSwaggerGen();
|
builder.Services.AddSwaggerGen();
|
||||||
|
|
||||||
builder.Services.ConfigurateGroup();
|
builder.Services.AddGroupServices();
|
||||||
|
builder.Services.AddUserServices();
|
||||||
|
builder.Services.AddPresenceServices();
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
|
@ -3,13 +3,21 @@ using Demo.Domain.UseCase;
|
|||||||
|
|
||||||
public static class ServiceExtencions
|
public static class ServiceExtencions
|
||||||
{
|
{
|
||||||
public static void ConfigurateGroup(this IServiceCollection services)
|
public static void AddGroupServices(this IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddScoped<IGroupRepository, SQLGroupRepositoryImpl>()
|
services.AddScoped<IGroupRepository, SQLGroupRepositoryImpl>()
|
||||||
.AddScoped<IUserRepository, SQLUserRepositoryImpl>()
|
.AddScoped<GroupUseCase>();
|
||||||
.AddScoped<IPresenceRepository, SQLPresenceRepositoryImpl>()
|
}
|
||||||
.AddScoped<GroupUseCase>()
|
|
||||||
.AddScoped<UserUseCase>()
|
public static void AddUserServices(this IServiceCollection services)
|
||||||
|
{
|
||||||
|
services.AddScoped<IUserRepository, SQLUserRepositoryImpl>()
|
||||||
|
.AddScoped<UserUseCase>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void AddPresenceServices(this IServiceCollection services)
|
||||||
|
{
|
||||||
|
services.AddScoped<IPresenceRepository, SQLPresenceRepositoryImpl>()
|
||||||
.AddScoped<PresenceUseCase>();
|
.AddScoped<PresenceUseCase>();
|
||||||
}
|
}
|
||||||
}
|
}
|
88
ui/GroupConsole.cs
Normal file
88
ui/GroupConsole.cs
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Text;
|
||||||
|
using Demo.Domain.Models;
|
||||||
|
using Demo.Domain.UseCase;
|
||||||
|
|
||||||
|
namespace Demo.UI
|
||||||
|
{
|
||||||
|
public class GroupConsoleUI
|
||||||
|
{
|
||||||
|
IGroupUseCase _groupUseCase;
|
||||||
|
IUserUseCase _userUseCase;
|
||||||
|
IPresenceUseCase _presenceUseCase;
|
||||||
|
public GroupConsoleUI(IGroupUseCase groupUseCase, IUserUseCase userUseCase, IPresenceUseCase presenceUseCase){
|
||||||
|
_groupUseCase = groupUseCase;
|
||||||
|
_userUseCase = userUseCase;
|
||||||
|
_presenceUseCase = presenceUseCase;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DisplayAllGroups(){
|
||||||
|
StringBuilder userOutput = new StringBuilder();
|
||||||
|
foreach (var group in _groupUseCase.GetAllGroups())
|
||||||
|
{
|
||||||
|
userOutput.AppendLine($"{group.ID}\t{group.Name}");
|
||||||
|
}
|
||||||
|
Console.WriteLine(userOutput);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DisplayGroupByID(int ID){
|
||||||
|
StringBuilder userOutput = new StringBuilder();
|
||||||
|
var group = _groupUseCase.GetGroupById(ID);
|
||||||
|
{
|
||||||
|
userOutput.AppendLine($"{group.ID}\t{group.Name}");
|
||||||
|
}
|
||||||
|
Console.WriteLine(userOutput);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateNewGroup(string Name){
|
||||||
|
string output = _groupUseCase.CreateGroup(Name) ? "Группа создана" : "Группа не создана";
|
||||||
|
Console.WriteLine(output);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateGroupName(Group group)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Group output = _groupUseCase.UpdateGroup(group);
|
||||||
|
StringBuilder groupOutput = new StringBuilder();
|
||||||
|
groupOutput.AppendLine($"Обновленная группа: {output.ID}\t{output.Name}");
|
||||||
|
Console.WriteLine(groupOutput);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Ошибка при обновлении группы: {ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveGroupByID(int ID){
|
||||||
|
string output = _groupUseCase.RemoveGroupByID(ID) ? "Группа удалена" : "Группа не удалена";
|
||||||
|
Console.WriteLine(output);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DisplayAllBoutGroup(int groupID){
|
||||||
|
var users = _userUseCase.GetUsersByGroupID(groupID);
|
||||||
|
Console.WriteLine($"Группа: {groupID}\tКоличество учеников: {users.Count}");
|
||||||
|
|
||||||
|
var presencesByGroup = _presenceUseCase.GetPresenceByGroup(groupID);
|
||||||
|
var presenceFalseByGroup = _presenceUseCase.GetFalsePresenceByGroup(groupID);
|
||||||
|
var precentePresenceGroup = 100 - Math.Round((double)presenceFalseByGroup.Count / presencesByGroup.Count * 100);
|
||||||
|
Console.WriteLine($"Количество занятий: {presencesByGroup.Count}\tОбщий процент посещаемости: {precentePresenceGroup}");
|
||||||
|
|
||||||
|
foreach(var user in _userUseCase.GetUsersByGroupID(groupID)){
|
||||||
|
var countPresences = _presenceUseCase.GetPresenceByUser(user.Guid);
|
||||||
|
var countFalsePresences = _presenceUseCase.GetFalsePresenceByUser(user.Guid);
|
||||||
|
var precentePresenceUser = 100 - Math.Round((double)countFalsePresences.Count / countPresences.Count * 100);
|
||||||
|
if (precentePresenceUser < 40)
|
||||||
|
{
|
||||||
|
Console.ForegroundColor = ConsoleColor.Red;
|
||||||
|
Console.WriteLine($"FIO: {user.FIO}\tКоличество посещённых занятий: {countPresences.Count - countFalsePresences.Count}\tКоличество пропущенных занятий: {countFalsePresences.Count}\tПроцент посещаемости: {precentePresenceUser}");
|
||||||
|
Console.ResetColor();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine($"FIO: {user.FIO}\tКоличество посещённых занятий: {countPresences.Count - countFalsePresences.Count}\tКоличество пропущенных занятий: {countFalsePresences.Count}\tПроцент посещаемости: {precentePresenceUser}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
45
ui/PresenceConsole.cs
Normal file
45
ui/PresenceConsole.cs
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Text;
|
||||||
|
using Demo.Domain.Models;
|
||||||
|
using Demo.Domain.UseCase;
|
||||||
|
|
||||||
|
namespace Demo.UI
|
||||||
|
{
|
||||||
|
public class PresenceConsoleUI{
|
||||||
|
IPresenceUseCase _presenceUseCase;
|
||||||
|
public PresenceConsoleUI (IPresenceUseCase presenceUseCase){
|
||||||
|
_presenceUseCase = presenceUseCase;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DisplayPresenceByGroup(int groupID){
|
||||||
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
|
foreach(Presence presence in _presenceUseCase.GetPresenceByGroup(groupID)){
|
||||||
|
stringBuilder.AppendLine($"{presence.User.FIO}, {presence.User.Group.Name}, {presence.IsAttedance}, {presence.Date}, {presence.LessonNumber}");
|
||||||
|
}
|
||||||
|
Console.WriteLine(stringBuilder);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DisplayPresenceByGroupByTime(int groupID, DateOnly date){
|
||||||
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
|
foreach(Presence presence in _presenceUseCase.GetPresenceByGroupByTime(groupID, date)){
|
||||||
|
stringBuilder.AppendLine($"{presence.User.FIO}, {presence.User.Group.Name}, {presence.IsAttedance}, {presence.Date}, {presence.LessonNumber}");
|
||||||
|
}
|
||||||
|
Console.WriteLine(stringBuilder);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void GeneratePresence(int firstLesson, int lastLesson, int groupID, DateOnly date){
|
||||||
|
string output = _presenceUseCase.GeneratePresence(firstLesson, lastLesson, groupID, date) ? "Сгенерированно" : "Не сгенерированно";
|
||||||
|
Console.WriteLine(output);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void GeneratePresenceWeek(int firstLesson, int lastLesson, int groupID, DateOnly date){
|
||||||
|
string output = _presenceUseCase.GeneratePresenceWeek(firstLesson, lastLesson, groupID, date) ? "Сгенерированно" : "Не сгенерированно";
|
||||||
|
Console.WriteLine(output);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void IsAttedance(int firstLesson, int lastLesson, DateOnly date, Guid UserGuid){
|
||||||
|
string output = _presenceUseCase.IsAttedance(firstLesson, lastLesson, date, UserGuid) ? "Обновлено" : "Не обновлено";
|
||||||
|
Console.WriteLine(output);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -50,123 +50,4 @@ namespace Demo.UI
|
|||||||
Console.WriteLine(userOutput);
|
Console.WriteLine(userOutput);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GroupConsoleUI
|
|
||||||
{
|
|
||||||
IGroupUseCase _groupUseCase;
|
|
||||||
IUserUseCase _userUseCase;
|
|
||||||
IPresenceUseCase _presenceUseCase;
|
|
||||||
public GroupConsoleUI(IGroupUseCase groupUseCase, IUserUseCase userUseCase, IPresenceUseCase presenceUseCase){
|
|
||||||
_groupUseCase = groupUseCase;
|
|
||||||
_userUseCase = userUseCase;
|
|
||||||
_presenceUseCase = presenceUseCase;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DisplayAllGroups(){
|
|
||||||
StringBuilder userOutput = new StringBuilder();
|
|
||||||
foreach (var group in _groupUseCase.GetAllGroups())
|
|
||||||
{
|
|
||||||
userOutput.AppendLine($"{group.ID}\t{group.Name}");
|
|
||||||
}
|
|
||||||
Console.WriteLine(userOutput);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DisplayGroupByID(int ID){
|
|
||||||
StringBuilder userOutput = new StringBuilder();
|
|
||||||
var group = _groupUseCase.GetGroupById(ID);
|
|
||||||
{
|
|
||||||
userOutput.AppendLine($"{group.ID}\t{group.Name}");
|
|
||||||
}
|
|
||||||
Console.WriteLine(userOutput);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void CreateNewGroup(string Name){
|
|
||||||
string output = _groupUseCase.CreateGroup(Name) ? "Группа создана" : "Группа не создана";
|
|
||||||
Console.WriteLine(output);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void UpdateGroupName(Group group)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Group output = _groupUseCase.UpdateGroup(group);
|
|
||||||
StringBuilder groupOutput = new StringBuilder();
|
|
||||||
groupOutput.AppendLine($"Обновленная группа: {output.ID}\t{output.Name}");
|
|
||||||
Console.WriteLine(groupOutput);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Console.WriteLine($"Ошибка при обновлении группы: {ex.Message}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void RemoveGroupByID(int ID){
|
|
||||||
string output = _groupUseCase.RemoveGroupByID(ID) ? "Группа удалена" : "Группа не удалена";
|
|
||||||
Console.WriteLine(output);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DisplayAllBoutGroup(int groupID){
|
|
||||||
var users = _userUseCase.GetUsersByGroupID(groupID);
|
|
||||||
Console.WriteLine($"Группа: {groupID}\tКоличество учеников: {users.Count}");
|
|
||||||
|
|
||||||
var presencesByGroup = _presenceUseCase.GetPresenceByGroup(groupID);
|
|
||||||
var presenceFalseByGroup = _presenceUseCase.GetFalsePresenceByGroup(groupID);
|
|
||||||
var precentePresenceGroup = 100 - Math.Round((double)presenceFalseByGroup.Count / presencesByGroup.Count * 100);
|
|
||||||
Console.WriteLine($"Количество занятий: {presencesByGroup.Count}\tОбщий процент посещаемости: {precentePresenceGroup}");
|
|
||||||
|
|
||||||
foreach(var user in _userUseCase.GetUsersByGroupID(groupID)){
|
|
||||||
var countPresences = _presenceUseCase.GetPresenceByUser(user.Guid);
|
|
||||||
var countFalsePresences = _presenceUseCase.GetFalsePresenceByUser(user.Guid);
|
|
||||||
var precentePresenceUser = 100 - Math.Round((double)countFalsePresences.Count / countPresences.Count * 100);
|
|
||||||
if (precentePresenceUser < 40)
|
|
||||||
{
|
|
||||||
Console.ForegroundColor = ConsoleColor.Red;
|
|
||||||
Console.WriteLine($"FIO: {user.FIO}\tКоличество посещённых занятий: {countPresences.Count - countFalsePresences.Count}\tКоличество пропущенных занятий: {countFalsePresences.Count}\tПроцент посещаемости: {precentePresenceUser}");
|
|
||||||
Console.ResetColor();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Console.WriteLine($"FIO: {user.FIO}\tКоличество посещённых занятий: {countPresences.Count - countFalsePresences.Count}\tКоличество пропущенных занятий: {countFalsePresences.Count}\tПроцент посещаемости: {precentePresenceUser}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class PresenceConsoleUI{
|
|
||||||
IPresenceUseCase _presenceUseCase;
|
|
||||||
public PresenceConsoleUI (IPresenceUseCase presenceUseCase){
|
|
||||||
_presenceUseCase = presenceUseCase;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DisplayPresenceByGroup(int groupID){
|
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
|
||||||
foreach(Presence presence in _presenceUseCase.GetPresenceByGroup(groupID)){
|
|
||||||
stringBuilder.AppendLine($"{presence.User.FIO}, {presence.User.Group.Name}, {presence.IsAttedance}, {presence.Date}, {presence.LessonNumber}");
|
|
||||||
}
|
|
||||||
Console.WriteLine(stringBuilder);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DisplayPresenceByGroupByTime(int groupID, DateOnly date){
|
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
|
||||||
foreach(Presence presence in _presenceUseCase.GetPresenceByGroupByTime(groupID, date)){
|
|
||||||
stringBuilder.AppendLine($"{presence.User.FIO}, {presence.User.Group.Name}, {presence.IsAttedance}, {presence.Date}, {presence.LessonNumber}");
|
|
||||||
}
|
|
||||||
Console.WriteLine(stringBuilder);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void GeneratePresence(int firstLesson, int lastLesson, int groupID, DateOnly date){
|
|
||||||
string output = _presenceUseCase.GeneratePresence(firstLesson, lastLesson, groupID, date) ? "Сгенерированно" : "Не сгенерированно";
|
|
||||||
Console.WriteLine(output);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void GeneratePresenceWeek(int firstLesson, int lastLesson, int groupID, DateOnly date){
|
|
||||||
string output = _presenceUseCase.GeneratePresenceWeek(firstLesson, lastLesson, groupID, date) ? "Сгенерированно" : "Не сгенерированно";
|
|
||||||
Console.WriteLine(output);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void IsAttedance(int firstLesson, int lastLesson, DateOnly date, Guid UserGuid){
|
|
||||||
string output = _presenceUseCase.IsAttedance(firstLesson, lastLesson, date, UserGuid) ? "Обновлено" : "Не обновлено";
|
|
||||||
Console.WriteLine(output);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user