diff --git a/Data/Repository/IPresenceRepository.cs b/Data/Repository/IPresenceRepository.cs index 35d07d1..56dfd50 100644 --- a/Data/Repository/IPresenceRepository.cs +++ b/Data/Repository/IPresenceRepository.cs @@ -9,5 +9,6 @@ namespace Demo.Data.Repository List GetPresenceByGroupDate(); void IsAttedance(int firstLesson, int lastLesson, DateOnly date, Guid UserGuid); List GeneratePresence(List presenceLocalEntities); + List GeneratePresenceWeek(List presenceLocalEntities); } } \ No newline at end of file diff --git a/Data/Repository/PresenceRepositoryImpl.cs b/Data/Repository/PresenceRepositoryImpl.cs index 7ef17e0..e095d34 100644 --- a/Data/Repository/PresenceRepositoryImpl.cs +++ b/Data/Repository/PresenceRepositoryImpl.cs @@ -24,6 +24,11 @@ namespace Demo.Data.Repository return presenceLocalEntities; } + public List GeneratePresenceWeek(List presenceLocalEntities){ + GetAllPresence.AddRange(presenceLocalEntities); + return presenceLocalEntities; + } + public void IsAttedance(int firstLesson, int lastLesson, DateOnly date, Guid UserGuid){ foreach(PresenceLocalEntity presence in GetAllPresence.Where(x => x.LessonNumber >= firstLesson && x.LessonNumber <= lastLesson && x.Date == date)){ if (presence.UserGuid == UserGuid){ diff --git a/Domain/UseCase/IPresenceUseCase.cs b/Domain/UseCase/IPresenceUseCase.cs index 7c298c1..f8c1c66 100644 --- a/Domain/UseCase/IPresenceUseCase.cs +++ b/Domain/UseCase/IPresenceUseCase.cs @@ -8,5 +8,6 @@ namespace Demo.Domain.UseCase List GetPresenceByGroupByTime(int groupID, DateOnly date); bool IsAttedance(int firstLesson, int lastLesson, DateOnly date, Guid UserGuid); bool GeneratePresence(int firstLesson, int lastLesson, int groupID, DateOnly date); + bool GeneratePresenceWeek(int firstLesson, int lastLesson, int groupID, DateOnly date); } } \ No newline at end of file diff --git a/Domain/UseCase/PresenceUseCase.cs b/Domain/UseCase/PresenceUseCase.cs index f832291..cec36d9 100644 --- a/Domain/UseCase/PresenceUseCase.cs +++ b/Domain/UseCase/PresenceUseCase.cs @@ -99,5 +99,12 @@ namespace Demo.Domain.UseCase return true; } + + public bool GeneratePresenceWeek(int firstLesson, int lastLesson, int groupID, DateOnly date){ + for (int i = 0; i < 8; i++){ + GeneratePresence(firstLesson, lastLesson, groupID, date.AddDays(i)); + } + return true; + } } } \ No newline at end of file diff --git a/UI/MainMenu.cs b/UI/MainMenu.cs index 77ede43..e858ee2 100644 --- a/UI/MainMenu.cs +++ b/UI/MainMenu.cs @@ -33,9 +33,10 @@ namespace Demo.UI case "10": Console.WriteLine("писяпопакака"); break; - case "666": _presenceConsoleUI.DisplayPresenceByGroup(Convert.ToInt32(Console.ReadLine())); break; - case "777": _presenceConsoleUI.DisplayPresenceByGroupByTime(Convert.ToInt32(Console.ReadLine()), DateOnly.FromDateTime(Convert.ToDateTime(Console.ReadLine()))); break; - case "888": _presenceConsoleUI.GeneratePresence(Convert.ToInt32(Console.ReadLine()), Convert.ToInt32(Console.ReadLine()), Convert.ToInt32(Console.ReadLine()), DateOnly.FromDateTime(Convert.ToDateTime(Console.ReadLine()))); break; + case "555": _presenceConsoleUI.DisplayPresenceByGroup(Convert.ToInt32(Console.ReadLine())); break; + case "666": _presenceConsoleUI.DisplayPresenceByGroupByTime(Convert.ToInt32(Console.ReadLine()), DateOnly.FromDateTime(Convert.ToDateTime(Console.ReadLine()))); break; + case "777": _presenceConsoleUI.GeneratePresence(Convert.ToInt32(Console.ReadLine()), Convert.ToInt32(Console.ReadLine()), Convert.ToInt32(Console.ReadLine()), DateOnly.FromDateTime(Convert.ToDateTime(Console.ReadLine()))); break; + case "888": _presenceConsoleUI.GeneratePresenceWeek(Convert.ToInt32(Console.ReadLine()), Convert.ToInt32(Console.ReadLine()), Convert.ToInt32(Console.ReadLine()), DateOnly.FromDateTime(Convert.ToDateTime(Console.ReadLine()))); break; case "999": _presenceConsoleUI.IsAttedance(Convert.ToInt32(Console.ReadLine()), Convert.ToInt32(Console.ReadLine()), DateOnly.FromDateTime(Convert.ToDateTime(Console.ReadLine())), Guid.Parse(Console.ReadLine())); break; default: DisplayMenu(); diff --git a/UI/UserConsole.cs b/UI/UserConsole.cs index 54dcc0b..0760af6 100644 --- a/UI/UserConsole.cs +++ b/UI/UserConsole.cs @@ -114,6 +114,11 @@ namespace Demo.UI Console.WriteLine(output); } + public void GeneratePresenceWeek(int firstLesson, int lastLesson, int groupID, DateOnly date){ + string output = _presenceUseCase.GeneratePresenceWeek(firstLesson, lastLesson, groupID, date) ? "Сгенерированно" : "Не сгенерированно"; + Console.WriteLine(output); + } + public void IsAttedance(int firstLesson, int lastLesson, DateOnly date, Guid UserGuid){ string output = _presenceUseCase.IsAttedance(firstLesson, lastLesson, date, UserGuid) ? "Обновлено" : "Не обновлено"; Console.WriteLine(output); diff --git a/bin/Debug/net8.0/Demo.dll b/bin/Debug/net8.0/Demo.dll index fc0015c..fcbfdec 100644 Binary files a/bin/Debug/net8.0/Demo.dll and b/bin/Debug/net8.0/Demo.dll differ diff --git a/bin/Debug/net8.0/Demo.pdb b/bin/Debug/net8.0/Demo.pdb index 64a5206..cc98f6d 100644 Binary files a/bin/Debug/net8.0/Demo.pdb and b/bin/Debug/net8.0/Demo.pdb differ diff --git a/obj/Debug/net8.0/Demo.AssemblyInfo.cs b/obj/Debug/net8.0/Demo.AssemblyInfo.cs index eee0f46..e0f0259 100644 --- a/obj/Debug/net8.0/Demo.AssemblyInfo.cs +++ b/obj/Debug/net8.0/Demo.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Demo")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+fdad32d8d007294c9270715bb64c3c6b73d4aa0e")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8cfc727b8c403baa97f18ee84c21b4211cf565aa")] [assembly: System.Reflection.AssemblyProductAttribute("Demo")] [assembly: System.Reflection.AssemblyTitleAttribute("Demo")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/obj/Debug/net8.0/Demo.AssemblyInfoInputs.cache b/obj/Debug/net8.0/Demo.AssemblyInfoInputs.cache index 1903a9d..a1a46a7 100644 --- a/obj/Debug/net8.0/Demo.AssemblyInfoInputs.cache +++ b/obj/Debug/net8.0/Demo.AssemblyInfoInputs.cache @@ -1 +1 @@ -1f5ed0f5079c7ee0bc0322da92b35ef0b9128733503d321fbe8276d571ff8b7d +d45a67746d856242cba9a02077a6869dc9aa935476034281590d01e4894701f6 diff --git a/obj/Debug/net8.0/Demo.dll b/obj/Debug/net8.0/Demo.dll index fc0015c..fcbfdec 100644 Binary files a/obj/Debug/net8.0/Demo.dll and b/obj/Debug/net8.0/Demo.dll differ diff --git a/obj/Debug/net8.0/Demo.pdb b/obj/Debug/net8.0/Demo.pdb index 64a5206..cc98f6d 100644 Binary files a/obj/Debug/net8.0/Demo.pdb and b/obj/Debug/net8.0/Demo.pdb differ diff --git a/obj/Debug/net8.0/ref/Demo.dll b/obj/Debug/net8.0/ref/Demo.dll index 91cf30f..9bdeede 100644 Binary files a/obj/Debug/net8.0/ref/Demo.dll and b/obj/Debug/net8.0/ref/Demo.dll differ diff --git a/obj/Debug/net8.0/refint/Demo.dll b/obj/Debug/net8.0/refint/Demo.dll index 91cf30f..9bdeede 100644 Binary files a/obj/Debug/net8.0/refint/Demo.dll and b/obj/Debug/net8.0/refint/Demo.dll differ