diff --git a/Data/Repository/GroupRepositoryImpl.cs b/Data/Repository/GroupRepositoryImpl.cs index ce3812b..cd5ade0 100644 --- a/Data/Repository/GroupRepositoryImpl.cs +++ b/Data/Repository/GroupRepositoryImpl.cs @@ -22,5 +22,12 @@ namespace Posechaemost.Data.Repository return groupLocal; } + public GroupLocalEntity? AddGroup(String name, String id) + { + GroupLocalEntity? groupLocal = GetAllGroups().FirstOrDefault(); + groupLocal.Name = name; + groupLocal.Id = int.Parse(id); + return groupLocal; + } } } \ No newline at end of file diff --git a/Domain/UseCase/GroupUseCase.cs b/Domain/UseCase/GroupUseCase.cs index 0989a5c..8e1f375 100644 --- a/Domain/UseCase/GroupUseCase.cs +++ b/Domain/UseCase/GroupUseCase.cs @@ -28,5 +28,9 @@ namespace Posechaemost.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); + } } } \ No newline at end of file diff --git a/UI/GroupConsole.cs b/UI/GroupConsole.cs index 6cee2d5..645900b 100644 --- a/UI/GroupConsole.cs +++ b/UI/GroupConsole.cs @@ -26,10 +26,18 @@ namespace Posechaemost.UI } public void UpdateGroupName(String name, String name1) { - StringBuilder userOutput = new StringBuilder(); + StringBuilder groupOutput = new StringBuilder(); var group = _groupUseCase.UpdateGroupName(name, name1); - userOutput.AppendLine($"{group.Id}\t{group.Name}"); - Console.WriteLine(userOutput); + groupOutput.AppendLine($"{group.Id}\t{group.Name}"); + Console.WriteLine(groupOutput); + } + + public void AddGroup(String name, String id) + { + StringBuilder groupOutput = new StringBuilder(); + var group = _groupUseCase.AddGroup(name, id); + groupOutput.AppendLine($"{group.Id}\t{group.Name}"); + Console.WriteLine(groupOutput); } } } diff --git a/UI/MainMenu.cs b/UI/MainMenu.cs index abb0c2a..d5b0057 100644 --- a/UI/MainMenu.cs +++ b/UI/MainMenu.cs @@ -34,6 +34,7 @@ namespace Posechaemost.UI case "4": _userConsoleUI.GetUserByGuid(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; diff --git a/bin/Debug/net8.0/Posechaemost.dll b/bin/Debug/net8.0/Posechaemost.dll index 69ba9e8..7712e4a 100644 Binary files a/bin/Debug/net8.0/Posechaemost.dll and b/bin/Debug/net8.0/Posechaemost.dll differ diff --git a/bin/Debug/net8.0/Posechaemost.pdb b/bin/Debug/net8.0/Posechaemost.pdb index cda548f..48814a0 100644 Binary files a/bin/Debug/net8.0/Posechaemost.pdb and b/bin/Debug/net8.0/Posechaemost.pdb differ diff --git a/obj/Debug/net8.0/Posechaemost.AssemblyInfo.cs b/obj/Debug/net8.0/Posechaemost.AssemblyInfo.cs index fcfa405..0b70887 100644 --- a/obj/Debug/net8.0/Posechaemost.AssemblyInfo.cs +++ b/obj/Debug/net8.0/Posechaemost.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Posechaemost")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+2adf9afa836f2195e7d6875eb60914f8f6544ee9")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1305f40f241ce752d3c0a7ec5341b1eafac497d8")] [assembly: System.Reflection.AssemblyProductAttribute("Posechaemost")] [assembly: System.Reflection.AssemblyTitleAttribute("Posechaemost")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/obj/Debug/net8.0/Posechaemost.AssemblyInfoInputs.cache b/obj/Debug/net8.0/Posechaemost.AssemblyInfoInputs.cache index 1085738..a0f7286 100644 --- a/obj/Debug/net8.0/Posechaemost.AssemblyInfoInputs.cache +++ b/obj/Debug/net8.0/Posechaemost.AssemblyInfoInputs.cache @@ -1 +1 @@ -96bf08b88313635c8c7dfa5999c9c749997058383865f8a634f20c197c546273 +7a59f60438c72dd05578b09f953c9ba9d3343469014f076958deeba098123188 diff --git a/obj/Debug/net8.0/Posechaemost.dll b/obj/Debug/net8.0/Posechaemost.dll index 69ba9e8..7712e4a 100644 Binary files a/obj/Debug/net8.0/Posechaemost.dll and b/obj/Debug/net8.0/Posechaemost.dll differ diff --git a/obj/Debug/net8.0/Posechaemost.pdb b/obj/Debug/net8.0/Posechaemost.pdb index cda548f..48814a0 100644 Binary files a/obj/Debug/net8.0/Posechaemost.pdb and b/obj/Debug/net8.0/Posechaemost.pdb differ diff --git a/obj/Debug/net8.0/ref/Posechaemost.dll b/obj/Debug/net8.0/ref/Posechaemost.dll index e941e92..ddd7c01 100644 Binary files a/obj/Debug/net8.0/ref/Posechaemost.dll and b/obj/Debug/net8.0/ref/Posechaemost.dll differ diff --git a/obj/Debug/net8.0/refint/Posechaemost.dll b/obj/Debug/net8.0/refint/Posechaemost.dll index e941e92..ddd7c01 100644 Binary files a/obj/Debug/net8.0/refint/Posechaemost.dll and b/obj/Debug/net8.0/refint/Posechaemost.dll differ