ПИбд-21. Басалов А.Д. Лабораторная 3 #3 #3

Closed
Tonby73 wants to merge 14 commits from LabWork_3 into LabWork_2
2 changed files with 2 additions and 2 deletions
Showing only changes of commit 0d6d6dec90 - Show all commits

View File

@ -83,7 +83,7 @@ WHERE Id = @id";
{
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
var querySelect = @"
SELECT t.*, ct.TourId, ct.Cost FROM Tour t
SELECT t.*, ct.TourId, ct.Cost, ct.ClientId FROM Tour t
INNER JOIN ClientTour ct ON ct.TourId = t.Id";
var tour = connection.Query<TempClientTour>(querySelect);
_logger.LogDebug("Получение объектов {json}", JsonConvert.SerializeObject(tour));

View File

@ -52,7 +52,7 @@ internal class TableReport
endDate)
{
var data = _tourRepository.ReadTours().Select(x => new {
ClientId = (int ?)x.ClientTours.Sum(x => x.ClientId),
ClientId = (int ?)x.ClientTours.FirstOrDefault(y => y.TourId > 0).ClientId,
Date = x.DepartureDate,
CountIn = (int?)null,
CountOut = (int?)x.ClientTours.Sum(x => x.Cost)