diff --git a/data/RemoteData/DAO/Group.cs b/data/RemoteData/DAO/Group.cs index c0a336d..6c79c13 100644 --- a/data/RemoteData/DAO/Group.cs +++ b/data/RemoteData/DAO/Group.cs @@ -8,9 +8,10 @@ namespace Data.RemoteData.DAO { public class GroupDao { - public int Id { get; set; } - public string Name { get; set; } + internal static List Name = new List(); - public virtual IEnumerable Users { get; set; } + public int Id { get; set; } + public required string GroupName { get; set; } + public IEnumerable Users { get; set; } } } diff --git a/data/RemoteData/DAO/Presence.cs b/data/RemoteData/DAO/Presence.cs index 2f7e116..3d09ade 100644 --- a/data/RemoteData/DAO/Presence.cs +++ b/data/RemoteData/DAO/Presence.cs @@ -6,14 +6,13 @@ using System.Threading.Tasks; namespace Data.RemoteData.DAO { - internal class PresenceDao - { + public class PresnceDao +{ + public Guid UserGuid { get; set; } - public bool IsAttedance { get; set; } = true; - public DateOnly Date { get; set; } - - public int LessonNumber { get; set; } - - public virtual UserDao UserDao { get; set; } - } + public bool IsAttendensy { get; set; } = true; + public int LessonNumber { get; set; } + public DateOnly Date { get; set; } + public UserDao userDao { get; set; } +} } diff --git a/data/RemoteData/RemoteDataBaseContext.cs b/data/RemoteData/RemoteDataBaseContext.cs index e9cc580..4977c56 100644 --- a/data/RemoteData/RemoteDataBaseContext.cs +++ b/data/RemoteData/RemoteDataBaseContext.cs @@ -7,7 +7,7 @@ namespace data.RemoteData { internal DbSet Group { get; set; } internal DbSet User { get; set; } - internal DbSet Presence { get; set; } + internal DbSet Presence { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { @@ -18,9 +18,9 @@ namespace data.RemoteData { modelBuilder.Entity().HasKey(group => group.Id); modelBuilder.Entity().HasKey(user => user.Guid); - modelBuilder.Entity().HasKey(presence => new { + modelBuilder.Entity().HasKey(presence => new { presence.UserGuid, - presence.IsAttedance, + presence.IsAttendensy, presence.Date, presence.LessonNumber, }); diff --git a/data/Repository/SQLGroupRepositoryImpl.cs b/data/Repository/SQLGroupRepositoryImpl.cs index 986bf84..a48569c 100644 --- a/data/Repository/SQLGroupRepositoryImpl.cs +++ b/data/Repository/SQLGroupRepositoryImpl.cs @@ -20,7 +20,7 @@ namespace Data.Repository public bool AddGroup(GroupLocalEntity newGroup) { - GroupDao groupDao = new GroupDao { Name = newGroup.Name }; + GroupDao groupDao = new GroupDao { GroupName = newGroup.Name }; var result = _remoteDataBaseContext.Group.Add(groupDao); if (result != null) { _remoteDataBaseContext.SaveChanges(); @@ -32,7 +32,7 @@ namespace Data.Repository { return _remoteDataBaseContext.Group.Select(group => new GroupLocalEntity{ Id = group.Id, - Name = group.Name} + Name = group.GroupName} ).ToList(); } diff --git a/data/bin/Debug/net8.0/data.dll b/data/bin/Debug/net8.0/data.dll index 3ad7dfd..b5e10fc 100644 Binary files a/data/bin/Debug/net8.0/data.dll and b/data/bin/Debug/net8.0/data.dll differ diff --git a/data/bin/Debug/net8.0/data.pdb b/data/bin/Debug/net8.0/data.pdb index aeaf682..f307fd9 100644 Binary files a/data/bin/Debug/net8.0/data.pdb and b/data/bin/Debug/net8.0/data.pdb differ diff --git a/data/obj/Debug/net8.0/data.AssemblyInfo.cs b/data/obj/Debug/net8.0/data.AssemblyInfo.cs index b21bbce..6b5667c 100644 --- a/data/obj/Debug/net8.0/data.AssemblyInfo.cs +++ b/data/obj/Debug/net8.0/data.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("data")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5124d95d3daae0a4fb8c67dff74fc5e25268f700")] [assembly: System.Reflection.AssemblyProductAttribute("data")] [assembly: System.Reflection.AssemblyTitleAttribute("data")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/data/obj/Debug/net8.0/data.AssemblyInfoInputs.cache b/data/obj/Debug/net8.0/data.AssemblyInfoInputs.cache index 26b3a26..f7d7a56 100644 --- a/data/obj/Debug/net8.0/data.AssemblyInfoInputs.cache +++ b/data/obj/Debug/net8.0/data.AssemblyInfoInputs.cache @@ -1 +1 @@ -6741393a5fe1cc20988265f6fd0e8bdd33ee4b9cc7b9e110a41e548fdd825a94 +f79085eebfdd7035c27d101a32916355d93e5f513df432f9a3075f4253aa1b2c diff --git a/data/obj/Debug/net8.0/data.dll b/data/obj/Debug/net8.0/data.dll index 3ad7dfd..b5e10fc 100644 Binary files a/data/obj/Debug/net8.0/data.dll and b/data/obj/Debug/net8.0/data.dll differ diff --git a/data/obj/Debug/net8.0/data.pdb b/data/obj/Debug/net8.0/data.pdb index aeaf682..f307fd9 100644 Binary files a/data/obj/Debug/net8.0/data.pdb and b/data/obj/Debug/net8.0/data.pdb differ diff --git a/data/obj/Debug/net8.0/ref/data.dll b/data/obj/Debug/net8.0/ref/data.dll index 7267c75..b7b478d 100644 Binary files a/data/obj/Debug/net8.0/ref/data.dll and b/data/obj/Debug/net8.0/ref/data.dll differ diff --git a/data/obj/Debug/net8.0/refint/data.dll b/data/obj/Debug/net8.0/refint/data.dll index 7267c75..b7b478d 100644 Binary files a/data/obj/Debug/net8.0/refint/data.dll and b/data/obj/Debug/net8.0/refint/data.dll differ diff --git a/domain/UseCase/UseCasePresence.cs b/domain/UseCase/UseCasePresence.cs new file mode 100644 index 0000000..455518e --- /dev/null +++ b/domain/UseCase/UseCasePresence.cs @@ -0,0 +1,44 @@ +using Data.RemoteData.DAO; +namespace Data.domain.UseCase +{ + internal class UseCasePresence + { + private List attendanceRecords; + + public UseCasePresence(List attendanceRecords) + { + this.attendanceRecords = attendanceRecords; + } + + public List GetAttendanceByGroup(string groupNumber) + { + return attendanceRecords.Where(record => record.userDao.Group.GroupName == groupNumber).ToList(); + } + + public List GetAttendanceByGroupAndDate(string groupNumber, DateOnly date) + { + return attendanceRecords.Where(record => record.userDao.Group.GroupName == groupNumber && record.Date == date).ToList(); + } + + public void MarkUserAsAbsent(string groupNumber, int firstLesson, int lastLesson, DateOnly date) + { + foreach (var lesson in Enumerable.Range(firstLesson, lastLesson - firstLesson + 1)) + { + var record = attendanceRecords.FirstOrDefault(r => r.userDao.Group.GroupName == groupNumber && r.LessonNumber == lesson && r.Date == date); + if (record != null) + { + record.IsAttendensy = false; + } + } + } + + public void MarkUserAsAbsentForWeek(string groupNumber, int firstLesson, int lastLesson, DateOnly startDate) + { + foreach (var day in Enumerable.Range(0, 7)) + { + var date = startDate.AddDays(day); + MarkUserAsAbsent(groupNumber, firstLesson, lastLesson, date); + } + } + } +} \ No newline at end of file diff --git a/domain/bin/Debug/net8.0/data.dll b/domain/bin/Debug/net8.0/data.dll index 3ad7dfd..b5e10fc 100644 Binary files a/domain/bin/Debug/net8.0/data.dll and b/domain/bin/Debug/net8.0/data.dll differ diff --git a/domain/bin/Debug/net8.0/data.pdb b/domain/bin/Debug/net8.0/data.pdb index aeaf682..f307fd9 100644 Binary files a/domain/bin/Debug/net8.0/data.pdb and b/domain/bin/Debug/net8.0/data.pdb differ diff --git a/domain/bin/Debug/net8.0/domain.dll b/domain/bin/Debug/net8.0/domain.dll index 4b92364..01b9861 100644 Binary files a/domain/bin/Debug/net8.0/domain.dll and b/domain/bin/Debug/net8.0/domain.dll differ diff --git a/domain/bin/Debug/net8.0/domain.pdb b/domain/bin/Debug/net8.0/domain.pdb index 84087b8..222daa3 100644 Binary files a/domain/bin/Debug/net8.0/domain.pdb and b/domain/bin/Debug/net8.0/domain.pdb differ diff --git a/domain/obj/Debug/net8.0/domain.AssemblyInfo.cs b/domain/obj/Debug/net8.0/domain.AssemblyInfo.cs index 996ffe7..ab7ec48 100644 --- a/domain/obj/Debug/net8.0/domain.AssemblyInfo.cs +++ b/domain/obj/Debug/net8.0/domain.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("domain")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5124d95d3daae0a4fb8c67dff74fc5e25268f700")] [assembly: System.Reflection.AssemblyProductAttribute("domain")] [assembly: System.Reflection.AssemblyTitleAttribute("domain")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/domain/obj/Debug/net8.0/domain.AssemblyInfoInputs.cache b/domain/obj/Debug/net8.0/domain.AssemblyInfoInputs.cache index 191d5d4..1a37bb1 100644 --- a/domain/obj/Debug/net8.0/domain.AssemblyInfoInputs.cache +++ b/domain/obj/Debug/net8.0/domain.AssemblyInfoInputs.cache @@ -1 +1 @@ -50afef9105125301dd1c05ea9fb1e5f605a3f79c6aca753bbf0156749546e4dd +9c029f0b724d07a712a5d941d1aa11410bfa94baebf4624d9063852c950ebe3f diff --git a/domain/obj/Debug/net8.0/domain.csproj.AssemblyReference.cache b/domain/obj/Debug/net8.0/domain.csproj.AssemblyReference.cache index 82c3725..3152d7d 100644 Binary files a/domain/obj/Debug/net8.0/domain.csproj.AssemblyReference.cache and b/domain/obj/Debug/net8.0/domain.csproj.AssemblyReference.cache differ diff --git a/domain/obj/Debug/net8.0/domain.csproj.CoreCompileInputs.cache b/domain/obj/Debug/net8.0/domain.csproj.CoreCompileInputs.cache index 303d420..e3ddab3 100644 --- a/domain/obj/Debug/net8.0/domain.csproj.CoreCompileInputs.cache +++ b/domain/obj/Debug/net8.0/domain.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -06e54d2e250f99be5b9c0d574f3c9686446bd7b207bc068308acbd6c108463f7 +dde64b0792f50fd0b7b79f917c9fba1b6079d6bb705e8b58d3634905ee7db9c7 diff --git a/domain/obj/Debug/net8.0/domain.dll b/domain/obj/Debug/net8.0/domain.dll index 4b92364..01b9861 100644 Binary files a/domain/obj/Debug/net8.0/domain.dll and b/domain/obj/Debug/net8.0/domain.dll differ diff --git a/domain/obj/Debug/net8.0/domain.pdb b/domain/obj/Debug/net8.0/domain.pdb index 84087b8..222daa3 100644 Binary files a/domain/obj/Debug/net8.0/domain.pdb and b/domain/obj/Debug/net8.0/domain.pdb differ diff --git a/domain/obj/Debug/net8.0/ref/domain.dll b/domain/obj/Debug/net8.0/ref/domain.dll index 885137c..ca4ed68 100644 Binary files a/domain/obj/Debug/net8.0/ref/domain.dll and b/domain/obj/Debug/net8.0/ref/domain.dll differ diff --git a/domain/obj/Debug/net8.0/refint/domain.dll b/domain/obj/Debug/net8.0/refint/domain.dll index 885137c..ca4ed68 100644 Binary files a/domain/obj/Debug/net8.0/refint/domain.dll and b/domain/obj/Debug/net8.0/refint/domain.dll differ diff --git a/ui/bin/Debug/net8.0/data.dll b/ui/bin/Debug/net8.0/data.dll index 3ad7dfd..b5e10fc 100644 Binary files a/ui/bin/Debug/net8.0/data.dll and b/ui/bin/Debug/net8.0/data.dll differ diff --git a/ui/bin/Debug/net8.0/data.pdb b/ui/bin/Debug/net8.0/data.pdb index aeaf682..f307fd9 100644 Binary files a/ui/bin/Debug/net8.0/data.pdb and b/ui/bin/Debug/net8.0/data.pdb differ diff --git a/ui/bin/Debug/net8.0/domain.dll b/ui/bin/Debug/net8.0/domain.dll index 4b92364..01b9861 100644 Binary files a/ui/bin/Debug/net8.0/domain.dll and b/ui/bin/Debug/net8.0/domain.dll differ diff --git a/ui/bin/Debug/net8.0/domain.pdb b/ui/bin/Debug/net8.0/domain.pdb index 84087b8..222daa3 100644 Binary files a/ui/bin/Debug/net8.0/domain.pdb and b/ui/bin/Debug/net8.0/domain.pdb differ diff --git a/ui/bin/Debug/net8.0/ui.dll b/ui/bin/Debug/net8.0/ui.dll index aa7f3c7..072ca01 100644 Binary files a/ui/bin/Debug/net8.0/ui.dll and b/ui/bin/Debug/net8.0/ui.dll differ diff --git a/ui/bin/Debug/net8.0/ui.exe b/ui/bin/Debug/net8.0/ui.exe index 24b119f..94bedc3 100644 Binary files a/ui/bin/Debug/net8.0/ui.exe and b/ui/bin/Debug/net8.0/ui.exe differ diff --git a/ui/bin/Debug/net8.0/ui.pdb b/ui/bin/Debug/net8.0/ui.pdb index 25ff982..a951c9d 100644 Binary files a/ui/bin/Debug/net8.0/ui.pdb and b/ui/bin/Debug/net8.0/ui.pdb differ diff --git a/ui/obj/Debug/net8.0/apphost.exe b/ui/obj/Debug/net8.0/apphost.exe index 24b119f..94bedc3 100644 Binary files a/ui/obj/Debug/net8.0/apphost.exe and b/ui/obj/Debug/net8.0/apphost.exe differ diff --git a/ui/obj/Debug/net8.0/ref/ui.dll b/ui/obj/Debug/net8.0/ref/ui.dll index 57e6a92..9334961 100644 Binary files a/ui/obj/Debug/net8.0/ref/ui.dll and b/ui/obj/Debug/net8.0/ref/ui.dll differ diff --git a/ui/obj/Debug/net8.0/refint/ui.dll b/ui/obj/Debug/net8.0/refint/ui.dll index 57e6a92..9334961 100644 Binary files a/ui/obj/Debug/net8.0/refint/ui.dll and b/ui/obj/Debug/net8.0/refint/ui.dll differ diff --git a/ui/obj/Debug/net8.0/ui.AssemblyInfo.cs b/ui/obj/Debug/net8.0/ui.AssemblyInfo.cs index eca84b8..27b2969 100644 --- a/ui/obj/Debug/net8.0/ui.AssemblyInfo.cs +++ b/ui/obj/Debug/net8.0/ui.AssemblyInfo.cs @@ -13,10 +13,10 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("ui")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5124d95d3daae0a4fb8c67dff74fc5e25268f700")] [assembly: System.Reflection.AssemblyProductAttribute("ui")] [assembly: System.Reflection.AssemblyTitleAttribute("ui")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] -// Generated by the MSBuild WriteCodeFragment class. +// Создано классом WriteCodeFragment MSBuild. diff --git a/ui/obj/Debug/net8.0/ui.AssemblyInfoInputs.cache b/ui/obj/Debug/net8.0/ui.AssemblyInfoInputs.cache index 04da69e..7fdb980 100644 --- a/ui/obj/Debug/net8.0/ui.AssemblyInfoInputs.cache +++ b/ui/obj/Debug/net8.0/ui.AssemblyInfoInputs.cache @@ -1 +1 @@ -20ed1ba88db46bd37bf95cc037aa54d55b6a60c0405520a36b7f26aec1c3e1fe +949b5e9c101aeb5918553be7acfbb6a7908a62a118405d2f2df4707237ffb8cf diff --git a/ui/obj/Debug/net8.0/ui.csproj.AssemblyReference.cache b/ui/obj/Debug/net8.0/ui.csproj.AssemblyReference.cache index 5062822..fa12482 100644 Binary files a/ui/obj/Debug/net8.0/ui.csproj.AssemblyReference.cache and b/ui/obj/Debug/net8.0/ui.csproj.AssemblyReference.cache differ diff --git a/ui/obj/Debug/net8.0/ui.dll b/ui/obj/Debug/net8.0/ui.dll index aa7f3c7..072ca01 100644 Binary files a/ui/obj/Debug/net8.0/ui.dll and b/ui/obj/Debug/net8.0/ui.dll differ diff --git a/ui/obj/Debug/net8.0/ui.pdb b/ui/obj/Debug/net8.0/ui.pdb index 25ff982..a951c9d 100644 Binary files a/ui/obj/Debug/net8.0/ui.pdb and b/ui/obj/Debug/net8.0/ui.pdb differ