Added Add Group
This commit is contained in:
parent
1305f40f24
commit
36a123355e
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Binary file not shown.
Binary file not shown.
@ -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")]
|
||||
|
@ -1 +1 @@
|
||||
96bf08b88313635c8c7dfa5999c9c749997058383865f8a634f20c197c546273
|
||||
7a59f60438c72dd05578b09f953c9ba9d3343469014f076958deeba098123188
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user