2024-10-23 08:14:10 +00:00
|
|
|
|
using Zurnal.domain.Models;
|
2024-10-21 11:56:16 +00:00
|
|
|
|
using Zurnal.Date.LocalDate;
|
|
|
|
|
using Zurnal.Date.Repository;
|
2024-11-01 06:57:09 +00:00
|
|
|
|
using Zurnal.Domain.UseCase;
|
2024-11-02 09:07:18 +00:00
|
|
|
|
using Zurnal.RemaDateBase.DateDao;
|
2024-10-21 11:56:16 +00:00
|
|
|
|
|
2024-10-23 08:14:10 +00:00
|
|
|
|
namespace Zurnal.Data.Repository
|
2024-10-21 11:56:16 +00:00
|
|
|
|
{
|
|
|
|
|
public class UserRepositoryImpl : IGroupRepository
|
|
|
|
|
{
|
2024-10-25 09:20:05 +00:00
|
|
|
|
public UserRepositoryImpl() => GetAllUsers = LocalStaticData.users;
|
|
|
|
|
|
2024-10-31 11:37:45 +00:00
|
|
|
|
public List<UserLocalEnity> GetAllUsers { get; set; }
|
2024-10-21 11:56:16 +00:00
|
|
|
|
|
|
|
|
|
public bool RemoveUserByGuid(Guid userGuid)
|
|
|
|
|
{
|
|
|
|
|
UserLocalEnity? userLocal = GetAllUsers
|
2024-10-25 09:20:05 +00:00
|
|
|
|
.Where(x => x.Guid == userGuid)
|
|
|
|
|
.FirstOrDefault();
|
2024-10-21 11:56:16 +00:00
|
|
|
|
if (userLocal == null) return false;
|
|
|
|
|
|
|
|
|
|
return GetAllUsers.Remove(userLocal);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public UserLocalEnity? GetUserByGuid(Guid userGuid) {
|
|
|
|
|
UserLocalEnity? userLocal = GetAllUsers
|
|
|
|
|
.Where(x => x.Guid == userGuid).FirstOrDefault();
|
|
|
|
|
if (userLocal == null) return null;
|
|
|
|
|
|
|
|
|
|
return userLocal;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public UserLocalEnity? UpdateUser(UserLocalEnity userUpdateLocalEnity) {
|
|
|
|
|
UserLocalEnity? userLocal = GetAllUsers
|
|
|
|
|
.Where(x => x.Guid == userUpdateLocalEnity.Guid).FirstOrDefault();
|
|
|
|
|
if (userLocal == null) return null;
|
|
|
|
|
userLocal.FIO = userUpdateLocalEnity.FIO;
|
|
|
|
|
userLocal.GroupID = userUpdateLocalEnity.GroupID;
|
|
|
|
|
return userLocal;
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-31 11:37:45 +00:00
|
|
|
|
public List<UserLocalEnity> GetAllUsersList()
|
2024-10-25 09:20:05 +00:00
|
|
|
|
{
|
2024-10-31 11:37:45 +00:00
|
|
|
|
return GetAllUsers;
|
2024-10-25 09:20:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
2024-10-31 11:37:45 +00:00
|
|
|
|
public List<GroupLocalEntity> GetAllGroups()
|
2024-10-25 09:20:05 +00:00
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-31 11:37:45 +00:00
|
|
|
|
public bool RemoveGroupById(int groupID)
|
2024-10-25 09:20:05 +00:00
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-31 11:37:45 +00:00
|
|
|
|
public bool UpdateGroupById(int groupID, GroupLocalEntity updatedGroup)
|
2024-10-25 09:20:05 +00:00
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-31 11:37:45 +00:00
|
|
|
|
public GroupLocalEntity GetGroupById(int groupID)
|
2024-10-25 09:20:05 +00:00
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-31 11:37:45 +00:00
|
|
|
|
public bool AddGroup(GroupLocalEntity newGroup)
|
2024-10-25 09:20:05 +00:00
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-02 09:07:18 +00:00
|
|
|
|
public IEnumerable<System.Text.RegularExpressions.Group> AllGroups()
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
2024-11-01 06:57:09 +00:00
|
|
|
|
|
2024-11-02 09:07:18 +00:00
|
|
|
|
public bool UpdateGroupById(int groupID, GroupDao updatedGroup)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool AddGroup(GroupDao newGroup)
|
2024-11-01 06:57:09 +00:00
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void AddGroupFromRegex(System.Text.RegularExpressions.Group group)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-02 09:07:18 +00:00
|
|
|
|
GroupDao IGroupRepository.GetGroupById(int id)
|
2024-11-01 06:57:09 +00:00
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-02 09:07:18 +00:00
|
|
|
|
IEnumerable<GroupDao> IGroupRepository.GetAllGroups()
|
2024-11-01 06:57:09 +00:00
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-02 09:07:18 +00:00
|
|
|
|
public void UpdateGroup(GroupDao group)
|
2024-11-01 06:57:09 +00:00
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void DeleteGroup(int id)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
2024-11-02 09:07:18 +00:00
|
|
|
|
|
2024-11-02 09:09:33 +00:00
|
|
|
|
internal UserUseCase.UserLocalEntity? UpdateUser(UserUseCase.UserLocalEntity userLocalEntity)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-02 09:07:18 +00:00
|
|
|
|
public List<GroupLocalEntity> AllGroup => throw new NotImplementedException();
|
|
|
|
|
|
|
|
|
|
List<GroupDao> IGroupRepository.AllGroup => throw new NotImplementedException();
|
2024-10-21 11:56:16 +00:00
|
|
|
|
}
|
|
|
|
|
}
|