diff --git a/data/RemoteData/DAO/User.cs b/data/RemoteData/DAO/User.cs index 3ba3e0f..0c86315 100644 --- a/data/RemoteData/DAO/User.cs +++ b/data/RemoteData/DAO/User.cs @@ -6,13 +6,14 @@ using System.Threading.Tasks; namespace Data.RemoteData.DAO { - public class UserDao + + public class UserDao { - public string FIO { get; set; } - public Guid Guid { get; set; } + public required string FIO { get; set; } + public Guid UserGuid { get; set; } + public GroupDao Group { get; set; } + public required int GroupID { get; set; } + public List Presences { get; set; } = new List(); - public virtual GroupDao Group { get; set; } - - } -} +} \ No newline at end of file diff --git a/data/RemoteData/RemoteDataBaseContext.cs b/data/RemoteData/RemoteDataBaseContext.cs index 4977c56..bc2ee5b 100644 --- a/data/RemoteData/RemoteDataBaseContext.cs +++ b/data/RemoteData/RemoteDataBaseContext.cs @@ -17,7 +17,7 @@ namespace data.RemoteData protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity().HasKey(group => group.Id); - modelBuilder.Entity().HasKey(user => user.Guid); + modelBuilder.Entity().HasKey(user => user.UserGuid); modelBuilder.Entity().HasKey(presence => new { presence.UserGuid, presence.IsAttendensy, diff --git a/data/bin/Debug/net8.0/data.dll b/data/bin/Debug/net8.0/data.dll index b5e10fc..16c7b96 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 f307fd9..aecd83a 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 6b5667c..8135380 100644 --- a/data/obj/Debug/net8.0/data.AssemblyInfo.cs +++ b/data/obj/Debug/net8.0/data.AssemblyInfo.cs @@ -13,10 +13,10 @@ 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+5124d95d3daae0a4fb8c67dff74fc5e25268f700")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d14f30b58346596546b30dc44d61ffae0ddb1b9a")] [assembly: System.Reflection.AssemblyProductAttribute("data")] [assembly: System.Reflection.AssemblyTitleAttribute("data")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] -// Generated by the MSBuild WriteCodeFragment class. +// Создано классом WriteCodeFragment MSBuild. diff --git a/data/obj/Debug/net8.0/data.AssemblyInfoInputs.cache b/data/obj/Debug/net8.0/data.AssemblyInfoInputs.cache index f7d7a56..3a4d4d5 100644 --- a/data/obj/Debug/net8.0/data.AssemblyInfoInputs.cache +++ b/data/obj/Debug/net8.0/data.AssemblyInfoInputs.cache @@ -1 +1 @@ -f79085eebfdd7035c27d101a32916355d93e5f513df432f9a3075f4253aa1b2c +da6e5904672a15e9743c288bc5b94fbac57fa66388ba1cb5e535fe3bfb0750aa diff --git a/data/obj/Debug/net8.0/data.dll b/data/obj/Debug/net8.0/data.dll index b5e10fc..16c7b96 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 f307fd9..aecd83a 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 b7b478d..d5e035f 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 b7b478d..d5e035f 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/bin/Debug/net8.0/data.dll b/domain/bin/Debug/net8.0/data.dll index b5e10fc..16c7b96 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 f307fd9..aecd83a 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 01b9861..17432bf 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 222daa3..865bf35 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 ab7ec48..df6a433 100644 --- a/domain/obj/Debug/net8.0/domain.AssemblyInfo.cs +++ b/domain/obj/Debug/net8.0/domain.AssemblyInfo.cs @@ -13,10 +13,10 @@ 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+5124d95d3daae0a4fb8c67dff74fc5e25268f700")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d14f30b58346596546b30dc44d61ffae0ddb1b9a")] [assembly: System.Reflection.AssemblyProductAttribute("domain")] [assembly: System.Reflection.AssemblyTitleAttribute("domain")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] -// Generated by the MSBuild WriteCodeFragment class. +// Создано классом WriteCodeFragment MSBuild. diff --git a/domain/obj/Debug/net8.0/domain.AssemblyInfoInputs.cache b/domain/obj/Debug/net8.0/domain.AssemblyInfoInputs.cache index 1a37bb1..7b645e9 100644 --- a/domain/obj/Debug/net8.0/domain.AssemblyInfoInputs.cache +++ b/domain/obj/Debug/net8.0/domain.AssemblyInfoInputs.cache @@ -1 +1 @@ -9c029f0b724d07a712a5d941d1aa11410bfa94baebf4624d9063852c950ebe3f +15dde5298e0a2aca57d1a2b1eb4e9e31f4cb84ae24a21e988fca6c201a5add95 diff --git a/domain/obj/Debug/net8.0/domain.csproj.AssemblyReference.cache b/domain/obj/Debug/net8.0/domain.csproj.AssemblyReference.cache index 3152d7d..2a93ee0 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.dll b/domain/obj/Debug/net8.0/domain.dll index 01b9861..17432bf 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 222daa3..865bf35 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 ca4ed68..091caed 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 ca4ed68..091caed 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/Apiska.cs b/ui/Apiska.cs index e69de29..b6d66c9 100644 --- a/ui/Apiska.cs +++ b/ui/Apiska.cs @@ -0,0 +1,50 @@ +using Data.RemoteData.DAO; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Zurnal.RemaDateBase.DateDao +{ + public class GroupInfo + { + public int TotalStudents { get; set; } + public int TotalLessons { get; set; } + public double AttendancePercentage { get; set; } + public List StudentAttendances { get; set; } + } + + public class StudentAttendance + { + public string FIO { get; set; } + public int AttendedLessons { get; set; } + public int MissedLessons { get; set; } + public double AttendanceRate { get; set; } + } + + public class GroupService + { + public GroupInfo GetGroupInfo(GroupDao group) + { + var students = group.Users.ToList(); + var totalLessons = students.SelectMany(u => u.Group.Users.SelectMany(p => p.Presences)).Count(); + var totalAttendance = students.Sum(u => u.Presences.Count(p => p.IsAttendensy)); + var attendancePercentage = totalLessons > 0 ? (double)totalAttendance / totalLessons * 100 : 0; + + var studentAttendances = students.Select(u => new StudentAttendance + { + FIO = u.FIO, + AttendedLessons = u.Presences.Count(p => p.IsAttendensy), + MissedLessons = u.Presences.Count(p => !p.IsAttendensy), + AttendanceRate = totalLessons > 0 ? (double)u.Presences.Count(p => p.IsAttendensy) / totalLessons * 100 : 0 + }).ToList(); + + return new GroupInfo + { + TotalStudents = students.Count, + TotalLessons = totalLessons, + AttendancePercentage = attendancePercentage, + StudentAttendances = studentAttendances + }; + } + } +} \ No newline at end of file diff --git a/ui/bin/Debug/net8.0/data.dll b/ui/bin/Debug/net8.0/data.dll index b5e10fc..16c7b96 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 f307fd9..aecd83a 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 01b9861..17432bf 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 222daa3..865bf35 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 072ca01..9d45250 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 94bedc3..3bca033 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 a951c9d..03050e3 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 94bedc3..3bca033 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 9334961..8a6b2c3 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 9334961..8a6b2c3 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 27b2969..3369c79 100644 --- a/ui/obj/Debug/net8.0/ui.AssemblyInfo.cs +++ b/ui/obj/Debug/net8.0/ui.AssemblyInfo.cs @@ -13,7 +13,7 @@ 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+5124d95d3daae0a4fb8c67dff74fc5e25268f700")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d14f30b58346596546b30dc44d61ffae0ddb1b9a")] [assembly: System.Reflection.AssemblyProductAttribute("ui")] [assembly: System.Reflection.AssemblyTitleAttribute("ui")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/ui/obj/Debug/net8.0/ui.AssemblyInfoInputs.cache b/ui/obj/Debug/net8.0/ui.AssemblyInfoInputs.cache index 7fdb980..2af9172 100644 --- a/ui/obj/Debug/net8.0/ui.AssemblyInfoInputs.cache +++ b/ui/obj/Debug/net8.0/ui.AssemblyInfoInputs.cache @@ -1 +1 @@ -949b5e9c101aeb5918553be7acfbb6a7908a62a118405d2f2df4707237ffb8cf +4e7c2fe91495819803332ae21fc74a7aec753055f4a797d99eb398f35ee67a01 diff --git a/ui/obj/Debug/net8.0/ui.csproj.AssemblyReference.cache b/ui/obj/Debug/net8.0/ui.csproj.AssemblyReference.cache index fa12482..e224c8a 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 072ca01..9d45250 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 a951c9d..03050e3 100644 Binary files a/ui/obj/Debug/net8.0/ui.pdb and b/ui/obj/Debug/net8.0/ui.pdb differ