add grouprepository #1
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Demo.domain.Models
|
||||
{
|
||||
internal class PresenceLocalEntity
|
||||
public class PresenceLocalEntity
|
||||
{
|
||||
public required Guid UserGuid { get; set; }
|
||||
public bool IsAttedance { get; set; } = true;
|
||||
|
@ -10,6 +10,7 @@ namespace Demo.domain.Models
|
||||
{
|
||||
public required string FIO { get; set; }
|
||||
public Guid Guid { get; set; }
|
||||
public Guid Guid2 { get; set; }
|
||||
|
||||
public required int GroupID { get; set; }
|
||||
|
||||
|
@ -27,5 +27,33 @@ namespace Demo.Data.LocalData
|
||||
new UserLocalEnity{Guid=Guid.Parse("efcc1473-c116-4244-b3f7-f2341a5c3003"), FIO = "RandomFio4", GroupID = 2 },
|
||||
new UserLocalEnity{Guid=Guid.Parse("60640fb3-ace2-4cad-81d5-a0a58bc2dbbd"), FIO = "RandomFio5", GroupID = 3 },
|
||||
};
|
||||
|
||||
public static List<PresenceLocalEntity> presences => new List<PresenceLocalEntity> {
|
||||
new PresenceLocalEntity {
|
||||
Date = DateOnly.FromDateTime(DateTime.Now),
|
||||
IsAttedance = true,
|
||||
LessonNumber = 1,
|
||||
UserGuid = Guid.Parse("e6b9964d-ea9f-420a-84b9-af9633bbfab9")},
|
||||
new PresenceLocalEntity {
|
||||
Date = DateOnly.FromDateTime(DateTime.Now),
|
||||
IsAttedance = true,
|
||||
LessonNumber = 2,
|
||||
UserGuid = Guid.Parse("e6b9964d-ea9f-420a-84b9-af9633bbfab9")},
|
||||
new PresenceLocalEntity {
|
||||
Date = DateOnly.FromDateTime(DateTime.Now),
|
||||
IsAttedance = true,
|
||||
LessonNumber = 3,
|
||||
UserGuid = Guid.Parse("e6b9964d-ea9f-420a-84b9-af9633bbfab9") },
|
||||
new PresenceLocalEntity {
|
||||
Date = DateOnly.FromDateTime(DateTime.Now),
|
||||
IsAttedance = true,
|
||||
LessonNumber = 4,
|
||||
UserGuid = Guid.Parse("e6b9964d-ea9f-420a-84b9-af9633bbfab9") },
|
||||
new PresenceLocalEntity {
|
||||
Date = DateOnly.FromDateTime(DateTime.Now),
|
||||
IsAttedance = true,
|
||||
LessonNumber = 4,
|
||||
UserGuid = Guid.Parse("e6b9964d-ea9f-420a-84b9-af9633bbfab9") }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -10,13 +10,8 @@ namespace Demo.Data.Repository
|
||||
{
|
||||
public class UserRepositoryImpl
|
||||
{
|
||||
public UserRepositoryImpl() {
|
||||
|
||||
GetAllUsers = LocalStaticData.users;
|
||||
}
|
||||
public List<UserLocalEnity> GetAllUsers
|
||||
{ get; set; }
|
||||
|
||||
public List<UserLocalEnity> GetAllUsers = new List<UserLocalEnity>();
|
||||
public bool RemoveUserByGuid(Guid userGuid)
|
||||
{
|
||||
UserLocalEnity? userLocal = GetAllUsers
|
||||
|
@ -13,6 +13,12 @@ namespace Demo.Domain.UseCase
|
||||
private readonly UserRepositoryImpl _repositoryUserImpl;
|
||||
private readonly IGroupRepository _repositoryGroupImpl;
|
||||
|
||||
public UserUseCase(IGroupRepository repository) {
|
||||
|
||||
_repositoryGroupImpl = repository;
|
||||
_repositoryUserImpl = new UserRepositoryImpl();
|
||||
}
|
||||
|
||||
public UserUseCase(UserRepositoryImpl repositoryImpl, IGroupRepository repositoryGroupImpl)
|
||||
{
|
||||
_repositoryUserImpl = repositoryImpl;
|
||||
|
@ -1,12 +1 @@
|
||||
|
||||
using Demo.Data.Repository;
|
||||
using Demo.Domain.UseCase;
|
||||
using Demo.UI;
|
||||
|
||||
|
||||
|
||||
GroupRepositoryImpl groupRepositoryImpl = new GroupRepositoryImpl();
|
||||
UserRepositoryImpl userRepositoryImpl = new UserRepositoryImpl();
|
||||
UserUseCase userUseCase = new UserUseCase(userRepositoryImpl, groupRepositoryImpl);
|
||||
|
||||
MainMenuUI mainMenuUI = new MainMenuUI(userUseCase);
|
Loading…
Reference in New Issue
Block a user