This commit is contained in:
asakky 2024-12-20 00:41:32 +04:00
parent 450f1dc73c
commit 77878a457c
2 changed files with 1 additions and 4 deletions

View File

@ -34,19 +34,16 @@ internal class ChartReport
private List<(string Caption, double Value)> GetData(DateTime dateTime) private List<(string Caption, double Value)> GetData(DateTime dateTime)
{ {
// Количество выдач книг за день
var issueCount = _issueRepository var issueCount = _issueRepository
.ReadIssue() .ReadIssue()
.Where(x => x.IssueDate.Date == dateTime.Date) .Where(x => x.IssueDate.Date == dateTime.Date)
.SelectMany(x => x.BookIssue) .SelectMany(x => x.BookIssue)
.Count(); .Count();
// Количество реставраций книг за день
var restorationCount = _bookRestorationRepository var restorationCount = _bookRestorationRepository
.ReadBookRestorations() .ReadBookRestorations()
.Count(x => x.RestorationDate.Date == dateTime.Date); .Count(x => x.RestorationDate.Date == dateTime.Date);
// Формируем данные для диаграммы
return new List<(string Caption, double Value)> return new List<(string Caption, double Value)>
{ {
("Выдачи", issueCount), ("Выдачи", issueCount),

View File

@ -76,7 +76,7 @@ internal class TableReport
.Select(group => new .Select(group => new
{ {
Librarian = librarian.Name, Librarian = librarian.Name,
Count = group.Count(), // Суммируем количество реставраций за день Count = group.Count(),
Description = "Реставрации", Description = "Реставрации",
Date = group.Key.RestorationDate.ToString("dd.MM.yyyy") Date = group.Key.RestorationDate.ToString("dd.MM.yyyy")
}); });