Added get user by guid

This commit is contained in:
Dasha 2024-10-18 09:47:43 +03:00
parent 2043a0253a
commit 2adf9afa83
5 changed files with 19 additions and 4 deletions

View File

@ -44,5 +44,9 @@ namespace Posechaemost.Domain.UseCase
if (group == null) throw new Exception(""); if (group == null) throw new Exception("");
return new User { FIO = user.FIO, Guid = user.Guid, Group = group}; return new User { FIO = user.FIO, Guid = user.Guid, Group = group};
} }
public UserLocalEntity GetUserByGuid(Guid userGuid) {
return _repositoryUserImpl.GetUserByGuid(userGuid);
}
} }
} }

View File

@ -31,6 +31,7 @@ namespace Posechaemost.UI
case "1": _userConsoleUI.DisplayAllUsers(); break; case "1": _userConsoleUI.DisplayAllUsers(); break;
case "2": _userConsoleUI.RemoveUserByGuid(Guid.Parse(Console.ReadLine())); break; case "2": _userConsoleUI.RemoveUserByGuid(Guid.Parse(Console.ReadLine())); break;
case "3": _groupConsoleUI.DisplayAllGroups(); break; case "3": _groupConsoleUI.DisplayAllGroups(); break;
case "4": _userConsoleUI.GetUserByGuid(Guid.Parse(Console.ReadLine())); break;
default: DisplayMenu(); default: DisplayMenu();
break; break;

View File

@ -29,5 +29,15 @@ namespace Posechaemost.UI
} }
Console.WriteLine(userOutput); Console.WriteLine(userOutput);
} }
public void GetUserByGuid(Guid userGuid) {
StringBuilder userOutput = new StringBuilder();
var user = _userUseCase.GetUserByGuid(userGuid);
userOutput.AppendLine($"{user.Guid}\t{user.FIO}\t{user.GroupID}");
Console.WriteLine(userOutput);
} }
}
} }

View File

@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Posechaemost")] [assembly: System.Reflection.AssemblyCompanyAttribute("Posechaemost")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+2043a0253af9ebde32c83e4366bb2ddff439b3bd")]
[assembly: System.Reflection.AssemblyProductAttribute("Posechaemost")] [assembly: System.Reflection.AssemblyProductAttribute("Posechaemost")]
[assembly: System.Reflection.AssemblyTitleAttribute("Posechaemost")] [assembly: System.Reflection.AssemblyTitleAttribute("Posechaemost")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
e9ceada99c48877fad5313fae59738b420d0cb46da13e0667c31a7c6ce5e0a82 23fad0f77cb5c1fcd312e88f594bb29098487a4c55237df8836db88abd48689f