BELLLLLOO(DB/Done)2

This commit is contained in:
Your Name 2024-10-26 00:07:09 +03:00
parent ea99225579
commit 86b4759087
11 changed files with 4 additions and 14 deletions

View File

@ -5,8 +5,6 @@ namespace Demo.Data.Repository
public interface IPresenceRepository public interface IPresenceRepository
{ {
List<PresenceLocalEntity> GetAllPresences(); List<PresenceLocalEntity> GetAllPresences();
List<PresenceLocalEntity>? GetPresenceByGroup();
List<PresenceLocalEntity> GetPresenceByGroupDate();
void IsAttedance(int firstLesson, int lastLesson, DateOnly date, Guid UserGuid); void IsAttedance(int firstLesson, int lastLesson, DateOnly date, Guid UserGuid);
List<PresenceLocalEntity> GeneratePresence(List<PresenceLocalEntity> presenceLocalEntities); List<PresenceLocalEntity> GeneratePresence(List<PresenceLocalEntity> presenceLocalEntities);
} }

View File

@ -19,14 +19,6 @@ namespace Demo.Data.Repository
return _remoteDatabaseContext.PresenceDaos.Select(x => new PresenceLocalEntity{UserGuid = x.UserGuid, Date = x.Date, LessonNumber = x.LessonNumber, IsAttedance = x.IsAttedance}).ToList(); return _remoteDatabaseContext.PresenceDaos.Select(x => new PresenceLocalEntity{UserGuid = x.UserGuid, Date = x.Date, LessonNumber = x.LessonNumber, IsAttedance = x.IsAttedance}).ToList();
} }
public List<PresenceLocalEntity> GetPresenceByGroup(){
return _remoteDatabaseContext.PresenceDaos.Select(x => new PresenceLocalEntity{UserGuid = x.UserGuid, Date = x.Date, LessonNumber = x.LessonNumber, IsAttedance = x.IsAttedance}).ToList();
}
public List<PresenceLocalEntity> GetPresenceByGroupDate(){
return _remoteDatabaseContext.PresenceDaos.Select(x => new PresenceLocalEntity{UserGuid = x.UserGuid, Date = x.Date, LessonNumber = x.LessonNumber, IsAttedance = x.IsAttedance}).ToList();
}
public List<PresenceLocalEntity> GeneratePresence(List<PresenceLocalEntity> presenceLocalEntities) public List<PresenceLocalEntity> GeneratePresence(List<PresenceLocalEntity> presenceLocalEntities)
{ {
var presences = presenceLocalEntities.Select(x => new PresenceDAO var presences = presenceLocalEntities.Select(x => new PresenceDAO

View File

@ -21,7 +21,7 @@ namespace Demo.Domain.UseCase
var usersByGroup = _repositoryUserImpl.GetAllUser() var usersByGroup = _repositoryUserImpl.GetAllUser()
.Where(user => user.GroupID == groupID).ToList(); .Where(user => user.GroupID == groupID).ToList();
var presenceByGroup = _repositoryPresenceImpl.GetPresenceByGroup() var presenceByGroup = _repositoryPresenceImpl.GetAllPresences()
.Where(x => usersByGroup.Any(user => user.Guid == x.UserGuid)) .Where(x => usersByGroup.Any(user => user.Guid == x.UserGuid))
.Select(presence => new Presence{ .Select(presence => new Presence{
User = new User{ User = new User{
@ -44,7 +44,7 @@ namespace Demo.Domain.UseCase
var usersByGroup = _repositoryUserImpl.GetAllUser() var usersByGroup = _repositoryUserImpl.GetAllUser()
.Where(user => user.GroupID == groupID).ToList(); .Where(user => user.GroupID == groupID).ToList();
var presenceByGroup = _repositoryPresenceImpl.GetPresenceByGroup() var presenceByGroup = _repositoryPresenceImpl.GetAllPresences()
.Where(x => usersByGroup.Any(user => user.Guid == x.UserGuid && x.Date == date)) .Where(x => usersByGroup.Any(user => user.Guid == x.UserGuid && x.Date == date))
.Select(presence => new Presence{ .Select(presence => new Presence{
User = new User{ User = new User{

Binary file not shown.

Binary file not shown.

View File

@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Demo")] [assembly: System.Reflection.AssemblyCompanyAttribute("Demo")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+2d00dc5129cceff9be5a6e517f99e6960a617e3c")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+ea99225579b2fe5759998c1d40840070bd9463e0")]
[assembly: System.Reflection.AssemblyProductAttribute("Demo")] [assembly: System.Reflection.AssemblyProductAttribute("Demo")]
[assembly: System.Reflection.AssemblyTitleAttribute("Demo")] [assembly: System.Reflection.AssemblyTitleAttribute("Demo")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
9b323ba14d380bc1418c48d0712d3e9e530672d0b6f95d67907fc8a7fbdacb7a 80d5c4821e3ff98a41b6c458f427344bd492e44a8a96d916098f8470ef998b85

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.