This commit is contained in:
Class_Student 2024-10-18 12:30:44 +03:00
parent 7b40532afd
commit b274d8f88d
4 changed files with 24 additions and 5 deletions

View File

@ -21,9 +21,13 @@ namespace _123.Data.ReportsHistory
groupLocal.Name = name;
return groupLocal;
}
//public GroupLocalEntity AddGroup(String name, String id)
//{
// List<GroupLocalEntity> groups => new List<GroupLocalEntity>
//}
public GroupLocalEntity AddGroup(String name, String id)
{
GroupLocalEntity? groupLocal = GetAllGroups().FirstOrDefault();
groupLocal.Name = name;
groupLocal.ID = int.Parse(id);
return groupLocal;
}
}
}

View File

@ -27,6 +27,10 @@ namespace _123.Domain.UseCase
if (group == null) throw new Exception("");
return new Group { ID = group.ID, Name = name1 };
}
public GroupLocalEntity AddGroup(String name, string id)
{
return _repositoryGroupImpl.AddGroup(name, id);
}
}
}

View File

@ -33,5 +33,15 @@ namespace _123.UI
}
Console.WriteLine(groupOutput);
}
public void AddGroup (String name, String id)
{
StringBuilder groupOutput = new StringBuilder();
var group = _groupUseCase.AddGroup(name,id);
{
groupOutput.AppendLine($"{group.Name}\t{group.ID}");
}
Console.WriteLine(groupOutput);
}
}
}

View File

@ -35,6 +35,7 @@ namespace _123.UI
case "4": _userConsoleUI.FindUserByGuid(Guid.Parse(Console.ReadLine()));break;
case "5": _userConsoleUI.UpdateUserByGuid(Guid.Parse(Console.ReadLine()),Console.ReadLine(), Console.ReadLine()); break;
case "6": _groupConsoleUI.UpdateGroupName(Console.ReadLine(),Console.ReadLine()); break;
case "7": _groupConsoleUI.AddGroup(Console.ReadLine(), Console.ReadLine());break;
default:
DisplayMenu();
break;