Небольшие правки

This commit is contained in:
Володя 2023-04-06 18:54:34 +03:00
parent 60e99edc70
commit 80813a1753
6 changed files with 12 additions and 2 deletions

View File

@ -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; }
}
}

View File

@ -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;

View File

@ -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;

View File

@ -12,7 +12,7 @@ using SchoolAgainStudyDataBaseImplements;
namespace SchoolAgainStudyDataBaseImplements.Migrations
{
[DbContext(typeof(SchoolDataBase))]
[Migration("20230405182217_Initial")]
[Migration("20230406155014_Initial")]
partial class Initial
{
/// <inheritdoc />

View File

@ -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; }