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; groupLocal.Name = name;
return groupLocal; return groupLocal;
} }
//public GroupLocalEntity AddGroup(String name, String id) public GroupLocalEntity AddGroup(String name, String id)
//{ {
// List<GroupLocalEntity> groups => new List<GroupLocalEntity> 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(""); if (group == null) throw new Exception("");
return new Group { ID = group.ID, Name = name1 }; 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); 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

@ -34,7 +34,8 @@ namespace _123.UI
case "3": _groupConsoleUI.DisplayAllGroups(); break; case "3": _groupConsoleUI.DisplayAllGroups(); break;
case "4": _userConsoleUI.FindUserByGuid(Guid.Parse(Console.ReadLine()));break; case "4": _userConsoleUI.FindUserByGuid(Guid.Parse(Console.ReadLine()));break;
case "5": _userConsoleUI.UpdateUserByGuid(Guid.Parse(Console.ReadLine()),Console.ReadLine(), 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 "6": _groupConsoleUI.UpdateGroupName(Console.ReadLine(),Console.ReadLine()); break;
case "7": _groupConsoleUI.AddGroup(Console.ReadLine(), Console.ReadLine());break;
default: default:
DisplayMenu(); DisplayMenu();
break; break;