diff --git a/Zurnal/Date/Repository/GroupRepositoryImpl.cs b/Zurnal/Date/Repository/GroupRepositoryImpl.cs index e2e6dc6..2a7d407 100644 --- a/Zurnal/Date/Repository/GroupRepositoryImpl.cs +++ b/Zurnal/Date/Repository/GroupRepositoryImpl.cs @@ -1,6 +1,7 @@ using System.Diagnostics; using Zurnal.RemaDateBase.DateDao; using System.Text.RegularExpressions; +using Zurnal.domain.Models; namespace Zurnal.Data.Repository { @@ -76,5 +77,10 @@ public bool UpdateGroupById(int groupId, GroupDao updatedGroup) { return AllGroup.FirstOrDefault(g => g.Id == groupId); } -} + + public List GetAllGroup() + { + throw new NotImplementedException(); + } + } } \ No newline at end of file diff --git a/Zurnal/Date/Repository/PresenceRepositoryIml.cs b/Zurnal/Date/Repository/PresenceRepositoryIml.cs new file mode 100644 index 0000000..5b5d72c --- /dev/null +++ b/Zurnal/Date/Repository/PresenceRepositoryIml.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using Zurnal.RemaDateBase.DateDao; + +[DebuggerDisplay($"{{{nameof(GetDebuggerDisplay)}(),nq}}")] +public class PresenceRepositoryIml : IPresenceRepository +{ + private readonly List _presences = new List(); + + public void AddPresence(PresnceDao presence) + { + _presences.Add(presence); + } + + public PresnceDao GetPresenceById(int id) + { + return _presences.Find(p => p.LessonNumber == id); + } + + public IEnumerable GetAllPresences() + { + return _presences; + } + + public void UpdatePresence(PresnceDao presence) + { + var existingPresence = GetPresenceById(presence.LessonNumber); + if (existingPresence != null) + { + existingPresence.UserGuid = presence.UserGuid; + existingPresence.IsAttendensy = presence.IsAttendensy; + existingPresence.Date = presence.Date; + existingPresence.userDao = presence.userDao; + } + } + + public void DeletePresence(int id) + { + var presence = GetPresenceById(id); + if (presence != null) + { + _presences.Remove(presence); + } + } + + private string GetDebuggerDisplay() + { + return ToString(); + } +} \ No newline at end of file diff --git a/Zurnal/Date/Repository/UserRepositoryImpl.cs b/Zurnal/Date/Repository/UserRepositoryImpl.cs index 4979876..fbfcbb4 100644 --- a/Zurnal/Date/Repository/UserRepositoryImpl.cs +++ b/Zurnal/Date/Repository/UserRepositoryImpl.cs @@ -5,7 +5,7 @@ using Zurnal.RemaDateBase.DateDao; namespace Zurnal.Data.Repository { - public class UserRepositoryImpl : IGroupRepository + public class UserRepositoryImpl : IUserRepository { public UserRepositoryImpl() => GetAllUsers = LocalStaticData.users; @@ -40,9 +40,10 @@ namespace Zurnal.Data.Repository return userLocal; } - public List GetAllUsersList() + public List GetAllUsersList() { return GetAllUsers; } + } } \ No newline at end of file diff --git a/Zurnal/Domain/UseCase/UserUseCase.cs b/Zurnal/Domain/UseCase/UserUseCase.cs index 5f8d644..af94459 100644 --- a/Zurnal/Domain/UseCase/UserUseCase.cs +++ b/Zurnal/Domain/UseCase/UserUseCase.cs @@ -1,13 +1,18 @@ using Zurnal.Data.Repository; +using Zurnal.domain.Models; using Zurnal.RemaDateBase.DateDao; namespace Zurnal.Domain.UseCase { - public class UserUseCase : IGroupRepository + public class UserUseCase : IUserRepository { private readonly UserRepositoryImpl _repositoryUserImpl; internal IGroupRepository RepositoryGroupImpl { get; } + List IUserRepository.GetAllUsers => throw new NotImplementedException(); + + public List AllGroup => throw new NotImplementedException(); + public UserUseCase(UserRepositoryImpl repositoryImpl, GroupRepositoryImpl repositoryGroupImpl) { _repositoryUserImpl = repositoryImpl; @@ -54,8 +59,16 @@ namespace Zurnal.Domain.UseCase return new UserDao { FIO = user.FIO, UserGuid = user.Guid, Group = group, GroupID = group.Id }; } - public List AllGroup => RepositoryGroupImpl.AllGroup.ToList(); - List IGroupRepository.AllGroup => throw new NotImplementedException(); + public UserLocalEnity? GetUserByGuid(Guid userGuid) + { + throw new NotImplementedException(); + } + + public UserLocalEnity? UpdateUser(UserLocalEnity userUpdateLocalEnity) + { + throw new NotImplementedException(); + } + internal class UserLocalEntity { public string FIO { get; set; } diff --git a/Zurnal/RemaDateBase/APIska.cs b/Zurnal/RemaDateBase/APIska.cs new file mode 100644 index 0000000..e69de29 diff --git a/Zurnal/RemaDateBase/Interfase/IUserRepository.cs b/Zurnal/RemaDateBase/Interfase/IUserRepository.cs index 23a7f51..4f3b8e7 100644 --- a/Zurnal/RemaDateBase/Interfase/IUserRepository.cs +++ b/Zurnal/RemaDateBase/Interfase/IUserRepository.cs @@ -1,10 +1,16 @@ +using System; +using System.Collections.Generic; using Zurnal.domain.Models; +using Zurnal.RemaDateBase.DateDao; -public interface IUserRepository +namespace Zurnal.Data.Repository { - void AddUser(User user); - User GetUserById(int id); - IEnumerable GetAllUsers(); - void UpdateUser(User user); - void DeleteUser(int id); + public interface IUserRepository + { + List GetAllUsers { get; } + List AllGroup { get; } + bool RemoveUserByGuid(Guid userGuid); + UserLocalEnity? GetUserByGuid(Guid userGuid); + UserLocalEnity? UpdateUser(UserLocalEnity userUpdateLocalEnity); + } } \ No newline at end of file diff --git a/Zurnal/UI/conver.cs b/Zurnal/UI/conver.cs index 04ee953..9915e2e 100644 --- a/Zurnal/UI/conver.cs +++ b/Zurnal/UI/conver.cs @@ -47,4 +47,4 @@ class Conver excel.SaveAs(excelFile); } } -} +} \ No newline at end of file diff --git a/Zurnal/obj/Debug/net8.0/Zurnal.AssemblyInfo.cs b/Zurnal/obj/Debug/net8.0/Zurnal.AssemblyInfo.cs index daad15f..bf4df2c 100644 --- a/Zurnal/obj/Debug/net8.0/Zurnal.AssemblyInfo.cs +++ b/Zurnal/obj/Debug/net8.0/Zurnal.AssemblyInfo.cs @@ -13,10 +13,10 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Zurnal")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+cefc9b3a85c12cb82d7e543ab8d2eb025849b9ec")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6cd68fd8f848f82dab9dfb3c0fa57e7014aa5697")] [assembly: System.Reflection.AssemblyProductAttribute("Zurnal")] [assembly: System.Reflection.AssemblyTitleAttribute("Zurnal")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] -// Generated by the MSBuild WriteCodeFragment class. +// Создано классом WriteCodeFragment MSBuild. diff --git a/Zurnal/obj/Debug/net8.0/Zurnal.AssemblyInfoInputs.cache b/Zurnal/obj/Debug/net8.0/Zurnal.AssemblyInfoInputs.cache index 806d11a..ffae19f 100644 --- a/Zurnal/obj/Debug/net8.0/Zurnal.AssemblyInfoInputs.cache +++ b/Zurnal/obj/Debug/net8.0/Zurnal.AssemblyInfoInputs.cache @@ -1 +1 @@ -e861d9be05b9445b3ebef44d26117a8c4b30fb141208d42302beba8abc1372c1 +c331eb4bc703cef79f6ccb4af78678a11ffab66ac92df33af549b62ed2206c81 diff --git a/Zurnal/obj/Debug/net8.0/Zurnal.csproj.CoreCompileInputs.cache b/Zurnal/obj/Debug/net8.0/Zurnal.csproj.CoreCompileInputs.cache index b7ae91b..bf3a51e 100644 --- a/Zurnal/obj/Debug/net8.0/Zurnal.csproj.CoreCompileInputs.cache +++ b/Zurnal/obj/Debug/net8.0/Zurnal.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -e818c2582926724344d87f9300781db10e3c61b91dde2011ab5210bca4cb8741 +455f82408edc8de19a04e05dad7dd15bf55e5478b4c07225e67f3aa0f3e97c48