From 80813a1753a519ac6bac3fce7d326e1350d1bdb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BE=D0=BB=D0=BE=D0=B4=D1=8F?= Date: Thu, 6 Apr 2023 18:54:34 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModel/ReportLessonTaskViewModel.cs | 2 ++ .../Implements/DiyStorage.cs | 4 ++++ .../Implements/LessonStorage.cs | 4 ++++ ...Initial.Designer.cs => 20230406155014_Initial.Designer.cs} | 2 +- .../{20230405182217_Initial.cs => 20230406155014_Initial.cs} | 0 SchoolAgainStudy/SchoolAgainStudyDataModels/Models/IDiy.cs | 2 +- 6 files changed, 12 insertions(+), 2 deletions(-) rename SchoolAgainStudy/SchoolAgainStudyDataBaseImplements/Migrations/{20230405182217_Initial.Designer.cs => 20230406155014_Initial.Designer.cs} (99%) rename SchoolAgainStudy/SchoolAgainStudyDataBaseImplements/Migrations/{20230405182217_Initial.cs => 20230406155014_Initial.cs} (100%) diff --git a/SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/ReportLessonTaskViewModel.cs b/SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/ReportLessonTaskViewModel.cs index bd8e407..0746219 100644 --- a/SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/ReportLessonTaskViewModel.cs +++ b/SchoolAgainStudy/SchoolAgainStudyContracts/ViewModel/ReportLessonTaskViewModel.cs @@ -10,6 +10,8 @@ namespace SchoolAgainStudyContracts.ViewModel { public int Id { get; set; } public string TitleLesson { get; set; } = string.Empty; + public DateTime DateEventLesson { get; set; } public string TitleTask { get; set; } = string.Empty; + public DateTime DateIssueTask { get; set; } } } diff --git a/SchoolAgainStudy/SchoolAgainStudyDataBaseImplements/Implements/DiyStorage.cs b/SchoolAgainStudy/SchoolAgainStudyDataBaseImplements/Implements/DiyStorage.cs index 4514054..13b10ac 100644 --- a/SchoolAgainStudy/SchoolAgainStudyDataBaseImplements/Implements/DiyStorage.cs +++ b/SchoolAgainStudy/SchoolAgainStudyDataBaseImplements/Implements/DiyStorage.cs @@ -20,6 +20,7 @@ namespace SchoolAgainStudyDataBaseImplements.Implements return context.Diys .Include(x => x.Interests) .ThenInclude(x => x.Interest) + .Include(x => x.Task) .ToList() .Select(x => x.GetViewModel) .ToList(); @@ -38,6 +39,7 @@ namespace SchoolAgainStudyDataBaseImplements.Implements return context.Diys .Include(x => x.Interests) .ThenInclude(x => x.Interest) + .Include(x => x.Task) .Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo && x.StudentId == model.StudentId) .ToList() .Select(x => x.GetViewModel) @@ -47,6 +49,7 @@ namespace SchoolAgainStudyDataBaseImplements.Implements return context.Diys .Include(x => x.Interests) .ThenInclude(x => x.Interest) + .Include(x => x.Task) .Where(x => x.StudentId == model.StudentId ) .ToList() .Select(x => x.GetViewModel) @@ -65,6 +68,7 @@ namespace SchoolAgainStudyDataBaseImplements.Implements return context.Diys .Include(x => x.Interests) .ThenInclude(x => x.Interest) + .Include(x => x.Task) .FirstOrDefault(x => (!string.IsNullOrEmpty(model.Title) && x.Title == model.Title) || (model.Id.HasValue && x.Id == model.Id)) ?.GetViewModel; diff --git a/SchoolAgainStudy/SchoolAgainStudyDataBaseImplements/Implements/LessonStorage.cs b/SchoolAgainStudy/SchoolAgainStudyDataBaseImplements/Implements/LessonStorage.cs index ff3d6fd..0a9d00f 100644 --- a/SchoolAgainStudy/SchoolAgainStudyDataBaseImplements/Implements/LessonStorage.cs +++ b/SchoolAgainStudy/SchoolAgainStudyDataBaseImplements/Implements/LessonStorage.cs @@ -20,6 +20,7 @@ namespace SchoolAgainStudyDataBaseImplements.Implements return context.Lessons .Include(x => x.Materials) .ThenInclude(x => x.Material) + .Include(x => x.Product) .ToList() .Select(x => x.GetViewModel) .ToList(); @@ -37,6 +38,7 @@ namespace SchoolAgainStudyDataBaseImplements.Implements return context.Lessons .Include(x => x.Materials) .ThenInclude(x => x.Material) + .Include(x => x.Product) .Where(x => x.DateEvent >= model.DateFrom && x.DateEvent <= model.DateTo && x.TeacherId == model.TeacherId) .ToList() .Select(x => x.GetViewModel) @@ -45,6 +47,7 @@ namespace SchoolAgainStudyDataBaseImplements.Implements return context.Lessons .Include(x => x.Materials) .ThenInclude(x => x.Material) + .Include(x => x.Product) .Where(x => x.TeacherId == model.TeacherId) .ToList() .Select(x => x.GetViewModel) @@ -61,6 +64,7 @@ namespace SchoolAgainStudyDataBaseImplements.Implements return context.Lessons .Include(x => x.Materials) .ThenInclude(x => x.Material) + .Include(x => x.Product) .FirstOrDefault(x => (!string.IsNullOrEmpty(model.Title) && x.Title == model.Title) || (model.Id.HasValue && x.Id == model.Id)) ?.GetViewModel; diff --git a/SchoolAgainStudy/SchoolAgainStudyDataBaseImplements/Migrations/20230405182217_Initial.Designer.cs b/SchoolAgainStudy/SchoolAgainStudyDataBaseImplements/Migrations/20230406155014_Initial.Designer.cs similarity index 99% rename from SchoolAgainStudy/SchoolAgainStudyDataBaseImplements/Migrations/20230405182217_Initial.Designer.cs rename to SchoolAgainStudy/SchoolAgainStudyDataBaseImplements/Migrations/20230406155014_Initial.Designer.cs index 15bb3c8..4a26d82 100644 --- a/SchoolAgainStudy/SchoolAgainStudyDataBaseImplements/Migrations/20230405182217_Initial.Designer.cs +++ b/SchoolAgainStudy/SchoolAgainStudyDataBaseImplements/Migrations/20230406155014_Initial.Designer.cs @@ -12,7 +12,7 @@ using SchoolAgainStudyDataBaseImplements; namespace SchoolAgainStudyDataBaseImplements.Migrations { [DbContext(typeof(SchoolDataBase))] - [Migration("20230405182217_Initial")] + [Migration("20230406155014_Initial")] partial class Initial { /// diff --git a/SchoolAgainStudy/SchoolAgainStudyDataBaseImplements/Migrations/20230405182217_Initial.cs b/SchoolAgainStudy/SchoolAgainStudyDataBaseImplements/Migrations/20230406155014_Initial.cs similarity index 100% rename from SchoolAgainStudy/SchoolAgainStudyDataBaseImplements/Migrations/20230405182217_Initial.cs rename to SchoolAgainStudy/SchoolAgainStudyDataBaseImplements/Migrations/20230406155014_Initial.cs diff --git a/SchoolAgainStudy/SchoolAgainStudyDataModels/Models/IDiy.cs b/SchoolAgainStudy/SchoolAgainStudyDataModels/Models/IDiy.cs index 2f935fb..d145a48 100644 --- a/SchoolAgainStudy/SchoolAgainStudyDataModels/Models/IDiy.cs +++ b/SchoolAgainStudy/SchoolAgainStudyDataModels/Models/IDiy.cs @@ -10,7 +10,7 @@ namespace SchoolAgainStudyDataModels.Models { string Title { get; } string Description { get; } - string? TaskName { get; } + string TaskName { get; } DateTime DateCreate { get; } int TaskId { get; } int StudentId { get; }