From 22dec950e51aebdb78b39b862de0d80ca87bae7c Mon Sep 17 00:00:00 2001 From: Azim06 Date: Wed, 25 Dec 2024 12:43:16 +0400 Subject: [PATCH] 213 --- ProjectHotel/ProjectHotel/Entities/PlacingAthlete.cs | 6 +++--- .../Implementations/PlacingAthleteRepository.cs | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ProjectHotel/ProjectHotel/Entities/PlacingAthlete.cs b/ProjectHotel/ProjectHotel/Entities/PlacingAthlete.cs index b2b155b..d26a2a8 100644 --- a/ProjectHotel/ProjectHotel/Entities/PlacingAthlete.cs +++ b/ProjectHotel/ProjectHotel/Entities/PlacingAthlete.cs @@ -19,9 +19,9 @@ public class PlacingAthlete public string RoomName { get; private set; } = string.Empty; [DisplayName("Дата заселения")] public DateTime PlacingDate { get; private set; } - [DisplayName("Корма")] - public string athlete => AthletePlacingAthlete != null ? - string.Join(", ", AthletePlacingAthlete.Select(x => $"{x.AthleteName} {x.Count}")) : string.Empty; + [DisplayName("Спортсмены")] + public string Athlete => AthletePlacingAthletes != null ? + string.Join(", ", AthletePlacingAthletes.Select(x => $"{x.AthleteName} {x.LengthOfStay}")) : string.Empty; [Browsable(false)] public IEnumerable AthletePlacingAthletes diff --git a/ProjectHotel/ProjectHotel/Repositories/Implementations/PlacingAthleteRepository.cs b/ProjectHotel/ProjectHotel/Repositories/Implementations/PlacingAthleteRepository.cs index 21c8e23..f6426ba 100644 --- a/ProjectHotel/ProjectHotel/Repositories/Implementations/PlacingAthleteRepository.cs +++ b/ProjectHotel/ProjectHotel/Repositories/Implementations/PlacingAthleteRepository.cs @@ -100,11 +100,11 @@ internal class PlacingAthleteRepository : IPlacingAthleteRepository using var connection = new NpgsqlConnection(_connectionString.ConnectionString); - var querySelect = @"SELECT pa.*, apa.*, r.Name AS RoomName - FROM PlacingAthlete pa - INNER JOIN AthletePlacingAthlete apa ON apa.PlacingAthleteId = pa.Id - LEFT JOIN Rooms r ON r.Id = pa.RoomId - {builder.Build()};"; + var querySelect = $@"SELECT pa.*, apa.*, r.Name AS RoomName + FROM PlacingAthlete pa + INNER JOIN AthletePlacingAthlete apa ON apa.PlacingAthleteId = pa.Id + LEFT JOIN Rooms r ON r.Id = pa.RoomId + {builder.Build()}"; //var placingAthletes = connection.Query(querySelect); var placingAthletesDict = new Dictionary>();