From efabcbc55faef34315665a6f35ae8a3572996415 Mon Sep 17 00:00:00 2001 From: ChaZIR Date: Tue, 30 Apr 2024 20:41:07 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B2=D1=81=D0=B5=20=D0=B5=D1=89=D0=B5=20?= =?UTF-8?q?=D0=BF=D0=BB=D0=B0=D0=BA=D0=B8=20=D0=BF=D0=BB=D0=B0=D0=BA=D0=B8?= =?UTF-8?q?(?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModels/Contractor/ExcursionGroupBindingModel.cs | 1 + .../Contractor/ViewModels/ExcursionGroupViewModel.cs | 1 + .../Models/Contractor/IExcursionGroupModel.cs | 1 + .../Implements/ContractorImplements/ContractorStorage.cs | 2 ++ .../Implements/ContractorImplements/ExcursionGroupStorage.cs | 4 +++- .../Implements/ContractorImplements/ExcursionStorage.cs | 2 ++ .../Implements/ContractorImplements/TourStorage.cs | 4 +++- 7 files changed, 13 insertions(+), 2 deletions(-) diff --git a/TravelCompany/TravelCompanyContracts/BindingModels/Contractor/ExcursionGroupBindingModel.cs b/TravelCompany/TravelCompanyContracts/BindingModels/Contractor/ExcursionGroupBindingModel.cs index e93e528..b1d46ed 100644 --- a/TravelCompany/TravelCompanyContracts/BindingModels/Contractor/ExcursionGroupBindingModel.cs +++ b/TravelCompany/TravelCompanyContracts/BindingModels/Contractor/ExcursionGroupBindingModel.cs @@ -14,5 +14,6 @@ namespace TravelCompanyContracts.BindingModels.Contractor public string ExcursionGroupName { get; set; } = string.Empty; public int PeopleAmount { get; set; } public int ContractorID { get; set; } + public Dictionary ExcursionGroupTours { get; set; } = new(); } } diff --git a/TravelCompany/TravelCompanyContracts/ViewModels/Contractor/ViewModels/ExcursionGroupViewModel.cs b/TravelCompany/TravelCompanyContracts/ViewModels/Contractor/ViewModels/ExcursionGroupViewModel.cs index b7c21ee..fea5c76 100644 --- a/TravelCompany/TravelCompanyContracts/ViewModels/Contractor/ViewModels/ExcursionGroupViewModel.cs +++ b/TravelCompany/TravelCompanyContracts/ViewModels/Contractor/ViewModels/ExcursionGroupViewModel.cs @@ -16,5 +16,6 @@ namespace TravelCompanyContracts.ViewModels.Contractor.ViewModels [DisplayName("Количество людей")] public int PeopleAmount { get; set; } public int ContractorID { get; set; } + public Dictionary ExcursionGroupTours { get; set; } = new(); } } diff --git a/TravelCompany/TravelCompanyDataModels/Models/Contractor/IExcursionGroupModel.cs b/TravelCompany/TravelCompanyDataModels/Models/Contractor/IExcursionGroupModel.cs index 4b4e9e9..e63a8e3 100644 --- a/TravelCompany/TravelCompanyDataModels/Models/Contractor/IExcursionGroupModel.cs +++ b/TravelCompany/TravelCompanyDataModels/Models/Contractor/IExcursionGroupModel.cs @@ -11,5 +11,6 @@ namespace TravelCompanyDataModels.Models.Contractor string ExcursionGroupName { get; } int PeopleAmount { get; } int ContractorID { get; } + Dictionary ExcursionGroupTours { get; } } } diff --git a/TravelCompany/TravelCompanyDatabaseImplement/Implements/ContractorImplements/ContractorStorage.cs b/TravelCompany/TravelCompanyDatabaseImplement/Implements/ContractorImplements/ContractorStorage.cs index 403be31..0bfa624 100644 --- a/TravelCompany/TravelCompanyDatabaseImplement/Implements/ContractorImplements/ContractorStorage.cs +++ b/TravelCompany/TravelCompanyDatabaseImplement/Implements/ContractorImplements/ContractorStorage.cs @@ -4,10 +4,12 @@ using System.Diagnostics.Contracts; using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; using TravelCompanyContracts.BindingModels.Contractor; using TravelCompanyContracts.SearchModels.Contractor; using TravelCompanyContracts.StoragesModels.Contractor; using TravelCompanyContracts.ViewModels.Contractor.ViewModels; +using TravelCompanyDatabaseImplement.Models.ContractorModels; namespace TravelCompanyDatabaseImplement.Implements.ContractorImplements { diff --git a/TravelCompany/TravelCompanyDatabaseImplement/Implements/ContractorImplements/ExcursionGroupStorage.cs b/TravelCompany/TravelCompanyDatabaseImplement/Implements/ContractorImplements/ExcursionGroupStorage.cs index 423dbec..a998f34 100644 --- a/TravelCompany/TravelCompanyDatabaseImplement/Implements/ContractorImplements/ExcursionGroupStorage.cs +++ b/TravelCompany/TravelCompanyDatabaseImplement/Implements/ContractorImplements/ExcursionGroupStorage.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; using TravelCompanyContracts.BindingModels.Contractor; using TravelCompanyContracts.SearchModels.Contractor; using TravelCompanyContracts.StoragesModels.Contractor; using TravelCompanyContracts.ViewModels.Contractor.ViewModels; +using TravelCompanyDatabaseImplement.Models.ContractorModels; namespace TravelCompanyDatabaseImplement.Implements.ContractorImplements { @@ -37,7 +39,7 @@ namespace TravelCompanyDatabaseImplement.Implements.ContractorImplements { return context.ExcursionGroups .Include(x => x.Contractor) - .Where(x => x.UserId.Equals(model.ContractorID)) + .Where(x => x.ContractorID.Equals(model.ContractorID)) .ToList() .Select(x => x.GetViewModel) .ToList(); diff --git a/TravelCompany/TravelCompanyDatabaseImplement/Implements/ContractorImplements/ExcursionStorage.cs b/TravelCompany/TravelCompanyDatabaseImplement/Implements/ContractorImplements/ExcursionStorage.cs index 6ff0928..f9efeb4 100644 --- a/TravelCompany/TravelCompanyDatabaseImplement/Implements/ContractorImplements/ExcursionStorage.cs +++ b/TravelCompany/TravelCompanyDatabaseImplement/Implements/ContractorImplements/ExcursionStorage.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; using TravelCompanyContracts.BindingModels.Contractor; using TravelCompanyContracts.SearchModels.Contractor; using TravelCompanyContracts.StoragesModels.Contractor; using TravelCompanyContracts.ViewModels.Contractor.ViewModels; +using TravelCompanyDatabaseImplement.Models.ContractorModels; namespace TravelCompanyDatabaseImplement.Implements.ContractorImplements { diff --git a/TravelCompany/TravelCompanyDatabaseImplement/Implements/ContractorImplements/TourStorage.cs b/TravelCompany/TravelCompanyDatabaseImplement/Implements/ContractorImplements/TourStorage.cs index ebc1c5c..8ab9bd5 100644 --- a/TravelCompany/TravelCompanyDatabaseImplement/Implements/ContractorImplements/TourStorage.cs +++ b/TravelCompany/TravelCompanyDatabaseImplement/Implements/ContractorImplements/TourStorage.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; using TravelCompanyContracts.BindingModels.Contractor; using TravelCompanyContracts.SearchModels.Contractor; using TravelCompanyContracts.StoragesModels.Contractor; using TravelCompanyContracts.ViewModels.Contractor.ViewModels; +using TravelCompanyDatabaseImplement.Models.ContractorModels; namespace TravelCompanyDatabaseImplement.Implements.ContractorImplements { @@ -36,7 +38,7 @@ namespace TravelCompanyDatabaseImplement.Implements.ContractorImplements { return context.Tours .Include(x => x.Contractor) - .Where(x => x.UserId.Equals(model.ContractorID)) + .Where(x => x.ContractorID.Equals(model.ContractorID)) .Select(x => x.GetViewModel) .ToList(); }