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(); }