diff --git a/TravelCompany/TravelCompanyContracts/SearchModels/Guarantor/PlaceSearchModel.cs b/TravelCompany/TravelCompanyContracts/SearchModels/Guarantor/PlaceSearchModel.cs index 446762e..2d343e5 100644 --- a/TravelCompany/TravelCompanyContracts/SearchModels/Guarantor/PlaceSearchModel.cs +++ b/TravelCompany/TravelCompanyContracts/SearchModels/Guarantor/PlaceSearchModel.cs @@ -11,8 +11,8 @@ namespace TravelCompanyContracts.SearchModels.Guarantor { public int? Id { get; set; } - public string NamePlace { get; set; } = string.Empty; + public string? NamePlace { get; set; } = string.Empty; - public string DescriptionPlace { get; set; } = string.Empty; + public string? DescriptionPlace { get; set; } = string.Empty; } } diff --git a/TravelCompany/TravelCompanyContracts/SearchModels/Guarantor/TripSearchModel.cs b/TravelCompany/TravelCompanyContracts/SearchModels/Guarantor/TripSearchModel.cs index c819c9e..0268ade 100644 --- a/TravelCompany/TravelCompanyContracts/SearchModels/Guarantor/TripSearchModel.cs +++ b/TravelCompany/TravelCompanyContracts/SearchModels/Guarantor/TripSearchModel.cs @@ -6,7 +6,11 @@ using System.Threading.Tasks; namespace TravelCompanyContracts.SearchModels.Guarantor { - internal class TripSearchModel + public class TripSearchModel { + public int? Id { get; set; } + public string? TripName { get; set; } = string.Empty; + public DateTime? TripDate { get; set; } + public int? GuarantorID { get; set; } } } diff --git a/TravelCompany/TravelCompanyContracts/StoragesModels/Guarantor/IGuarantorStorage.cs b/TravelCompany/TravelCompanyContracts/StoragesModels/Guarantor/IGuarantorStorage.cs index 20b3d63..a1e89f8 100644 --- a/TravelCompany/TravelCompanyContracts/StoragesModels/Guarantor/IGuarantorStorage.cs +++ b/TravelCompany/TravelCompanyContracts/StoragesModels/Guarantor/IGuarantorStorage.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using TravelCompanyContracts.BindingModels; +using TravelCompanyContracts.BindingModels.Guarantor; using TravelCompanyContracts.SearchModels.Guarantor; using TravelCompanyContracts.ViewModels.Guarantor.ViewModels; @@ -18,10 +18,10 @@ namespace TravelCompanyContracts.StoragesModels.Guarantor GuarantorViewModel? GetElement(GuarantorSearchModel model); - GuarantorViewModel? Insert(GuarantorSearchModel model); + GuarantorViewModel? Insert(GuarantorBindingModel model); - GuarantorViewModel? Update(GuarantorSearchModel model); + GuarantorViewModel? Update(GuarantorBindingModel model); - GuarantorViewModel? Delete(GuarantorSearchModel model); + GuarantorViewModel? Delete(GuarantorBindingModel model); } } diff --git a/TravelCompany/TravelCompanyContracts/StoragesModels/Guarantor/IGuideStorage.cs b/TravelCompany/TravelCompanyContracts/StoragesModels/Guarantor/IGuideStorage.cs index 711ba77..c961b05 100644 --- a/TravelCompany/TravelCompanyContracts/StoragesModels/Guarantor/IGuideStorage.cs +++ b/TravelCompany/TravelCompanyContracts/StoragesModels/Guarantor/IGuideStorage.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using TravelCompanyContracts.BindingModels; +using TravelCompanyContracts.BindingModels.Guarantor; using TravelCompanyContracts.SearchModels.Guarantor; using TravelCompanyContracts.ViewModels.Guarantor.ViewModels; @@ -18,10 +19,10 @@ namespace TravelCompanyContracts.StoragesModels.Guarantor GuideViewModel? GetElement(GuideSearchModel model); - GuideViewModel? Insert(GuideSearchModel model); + GuideViewModel? Insert(GuideBindingModel model); - GuideViewModel? Update(GuideSearchModel model); + GuideViewModel? Update(GuideBindingModel model); - GuideViewModel? Delete(GuideSearchModel model); + GuideViewModel? Delete(GuideBindingModel model); } } diff --git a/TravelCompany/TravelCompanyContracts/StoragesModels/Guarantor/IPlaceStorage.cs b/TravelCompany/TravelCompanyContracts/StoragesModels/Guarantor/IPlaceStorage.cs index c950519..18894df 100644 --- a/TravelCompany/TravelCompanyContracts/StoragesModels/Guarantor/IPlaceStorage.cs +++ b/TravelCompany/TravelCompanyContracts/StoragesModels/Guarantor/IPlaceStorage.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using TravelCompanyContracts.BindingModels.Guarantor; using TravelCompanyContracts.SearchModels.Guarantor; using TravelCompanyContracts.ViewModels.Guarantor.ViewModels; @@ -17,10 +18,10 @@ namespace TravelCompanyContracts.StoragesModels.Guarantor PlaceViewModel? GetElement(PlaceSearchModel model); - PlaceViewModel? Insert(PlaceSearchModel model); + PlaceViewModel? Insert(PlaceBindingModel model); - PlaceViewModel? Update(PlaceSearchModel model); + PlaceViewModel? Update(PlaceBindingModel model); - PlaceViewModel? Delete(PlaceSearchModel model); + PlaceViewModel? Delete(PlaceBindingModel model); } } diff --git a/TravelCompany/TravelCompanyContracts/StoragesModels/Guarantor/ITripStorage.cs b/TravelCompany/TravelCompanyContracts/StoragesModels/Guarantor/ITripStorage.cs index b83db3f..cd42089 100644 --- a/TravelCompany/TravelCompanyContracts/StoragesModels/Guarantor/ITripStorage.cs +++ b/TravelCompany/TravelCompanyContracts/StoragesModels/Guarantor/ITripStorage.cs @@ -3,10 +3,24 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using TravelCompanyContracts.BindingModels.Guarantor; +using TravelCompanyContracts.SearchModels.Guarantor; +using TravelCompanyContracts.ViewModels.Guarantor.ViewModels; namespace TravelCompanyContracts.StoragesModels.Guarantor { - internal class ITripStorage + public interface ITripStorage { + List GetFullList(); + + List GetFilteredList(TripSearchModel model); + + TripViewModel? GetElement(TripSearchModel model); + + TripViewModel? Insert(TripBindingModel model); + + TripViewModel? Update(TripBindingModel model); + + TripViewModel? Delete(TripBindingModel model); } } diff --git a/TravelCompany/TravelCompanyDatabaseImplement/Implements/GuarantorImplements/GuarantorStorage.cs b/TravelCompany/TravelCompanyDatabaseImplement/Implements/GuarantorImplements/GuarantorStorage.cs index 7f49d29..1b3e1d1 100644 --- a/TravelCompany/TravelCompanyDatabaseImplement/Implements/GuarantorImplements/GuarantorStorage.cs +++ b/TravelCompany/TravelCompanyDatabaseImplement/Implements/GuarantorImplements/GuarantorStorage.cs @@ -3,10 +3,108 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using TravelCompanyContracts.BindingModels.Contractor; +using TravelCompanyContracts.BindingModels.Guarantor; +using TravelCompanyContracts.SearchModels.Contractor; +using TravelCompanyContracts.SearchModels.Guarantor; +using TravelCompanyContracts.StoragesModels.Guarantor; +using TravelCompanyContracts.ViewModels.Contractor.ViewModels; +using TravelCompanyContracts.ViewModels.Guarantor.ViewModels; +using TravelCompanyDatabaseImplement.Models; +using TravelCompanyDatabaseImplement.Models.ContractorModels; namespace TravelCompanyDatabaseImplement.Implements.GuarantorImplements { - internal class GuarantorStorage + public class GuarantorStorage : IGuarantorStorage { + public List GetFullList() + { + using var context = new TravelCompanyDatabase(); + return context.Guarantors + .Select(x => x.GetViewModel) + .ToList(); + } + + public List GetFilteredList(GuarantorSearchModel model) + { + if (string.IsNullOrEmpty(model.Surname)) + { + return new(); + } + using var context = new TravelCompanyDatabase(); + return context.Guarantors + .Where(x => x.Surname.Contains(model.Surname)) + .Select(x => x.GetViewModel) + .ToList(); + } + + public GuarantorViewModel? GetElement(GuarantorSearchModel model) + { + using var context = new TravelCompanyDatabase(); + if (model.Id.HasValue) + { + return context.Guarantors + .FirstOrDefault(x => x.Id.Equals(model.Id)) + ?.GetViewModel; + } + if (!string.IsNullOrEmpty(model.Email) && !string.IsNullOrEmpty(model.Password)) + { + return context.Guarantors + .FirstOrDefault(x => x.Email.Equals(model.Email) && x.Password.Equals(model.Password)) + ?.GetViewModel; + } + if (!string.IsNullOrEmpty(model.Email)) + { + return context.Guarantors + .FirstOrDefault(x => x.Email.Equals(model.Email)) + ?.GetViewModel; + } + if (!string.IsNullOrEmpty(model.MobilePhone)) + { + return context.Guarantors + .FirstOrDefault(x => x.MobilePhone.Equals(model.MobilePhone)) + ?.GetViewModel; + } + return null; + } + + public GuarantorViewModel? Insert(GuarantorBindingModel model) + { + var newGuarantor = Guarantor.Create(model); + if (newGuarantor == null) + { + return null; + } + using var context = new TravelCompanyDatabase(); + context.Guarantors.Add(newGuarantor); + context.SaveChanges(); + return newGuarantor.GetViewModel; + } + + public GuarantorViewModel? Update(GuarantorBindingModel model) + { + using var context = new TravelCompanyDatabase(); + var guarantor = context.Guarantors.FirstOrDefault(x => x.Id == model.Id); + if (guarantor == null) + { + return null; + } + guarantor.Update(model); + context.SaveChanges(); + return guarantor.GetViewModel; + } + + public GuarantorViewModel? Delete(GuarantorBindingModel model) + { + using var context = new TravelCompanyDatabase(); + var element = context.Guarantors.FirstOrDefault(x => x.Id == model.Id); + if (element != null) + { + context.Guarantors.Remove(element); + context.SaveChanges(); + return element.GetViewModel; + } + return null; + } } } diff --git a/TravelCompany/TravelCompanyDatabaseImplement/Models/ContractorModels/Contractor.cs b/TravelCompany/TravelCompanyDatabaseImplement/Models/Contractor.cs similarity index 97% rename from TravelCompany/TravelCompanyDatabaseImplement/Models/ContractorModels/Contractor.cs rename to TravelCompany/TravelCompanyDatabaseImplement/Models/Contractor.cs index 25471e7..968fc94 100644 --- a/TravelCompany/TravelCompanyDatabaseImplement/Models/ContractorModels/Contractor.cs +++ b/TravelCompany/TravelCompanyDatabaseImplement/Models/Contractor.cs @@ -9,7 +9,7 @@ using TravelCompanyContracts.BindingModels.Contractor; using TravelCompanyContracts.ViewModels.Contractor.ViewModels; using TravelCompanyDataModels.Models.Contractor; -namespace TravelCompanyDatabaseImplement.Models.ContractorModels +namespace TravelCompanyDatabaseImplement.Models { public class Contractor : IContractorModel { diff --git a/TravelCompany/TravelCompanyDatabaseImplement/Models/ContractorModels/ExcursionGroup.cs b/TravelCompany/TravelCompanyDatabaseImplement/Models/ContractorModels/ExcursionGroup.cs deleted file mode 100644 index 485d4ca..0000000 --- a/TravelCompany/TravelCompanyDatabaseImplement/Models/ContractorModels/ExcursionGroup.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using TravelCompanyContracts.BindingModels.Contractor; -using TravelCompanyContracts.ViewModels.Contractor.ViewModels; -using TravelCompanyDataModels.Models.Contractor; -using Microsoft.EntityFrameworkCore; -using TravelCompanyDatabaseImplement.Models.GuarantorModels; - -namespace TravelCompanyDatabaseImplement.Models.ContractorModels -{ - public class ExcursionGroup : IExcursionGroupModel - { - public int Id { get; set; } - - [Required] - public string ExcursionGroupName { get; set; } = string.Empty; - - [Required] - public int PeopleAmount { get; set; } - - [Required] - public int ContractorID { get; set; } - - [DeleteBehavior(DeleteBehavior.Restrict)] - public virtual Contractor Contractor { get; set; }} - - private Dictionary? _excursionGroupTours = null; - - [NotMapped] - public Dictionary ExcursionGroupTours - { - get - { - if (_excursionGroupTours == null) - { - _excursionGroupTours = Tours - .ToDictionary(recPC => recPC.TourId, recPC => recPC.Tour as ITourModel); - } - return _excursionGroupTours; - } - } - - [ForeignKey("ExcursionGroupId")] - public virtual List Tours { get; set; } = new(); - - public static ExcursionGroup? Create(TravelCompanyDatabase context, ExcursionGroupBindingModel? model) - { - if (model == null) - { - return null; - } - return new ExcursionGroup() - { - Id = model.Id, - ExcursionGroupName = model.ExcursionGroupName, - PeopleAmount = model.PeopleAmount, - ContractorID = model.ContractorID, - Tours = model.ExcursionGroupTours.Select(x => new ExcursionGroupTour - { - Tour = context.Tours.First(y => y.Id == x.Key) - }).ToList() - }; - } - public void Update(ExcursionGroupBindingModel? model) - { - if (model == null) - { - return; - } - ExcursionGroupName = model.ExcursionGroupName; - PeopleAmount = model.PeopleAmount; - } - - public ExcursionGroupViewModel GetViewModel => new() - { - Id = Id, - ExcursionGroupName = ExcursionGroupName, - PeopleAmount = PeopleAmount, - ContractorID = ContractorID, - ExcursionGroupTours = ExcursionGroupTours - }; - - public void UpdateTours(TravelCompanyDatabase context, ExcursionGroupBindingModel model) - { - var excursionGroupTours = context.ExcursionGroupTours.Where(rec => rec.ExcursionGroupId == model.Id).ToList(); - if (excursionGroupTours != null && excursionGroupTours.Count > 0) - { - context.ExcursionGroupTours.RemoveRange(excursionGroupTours.Where(rec => !model.ExcursionGroupTours.ContainsKey(rec.TourId))); - context.SaveChanges(); - } - var excursionGroup = context.ExcursionGroups.First(x => x.Id == Id); - foreach (var et in model.ExcursionGroupTours) - { - context.ExcursionGroupTours.Add(new ExcursionGroupTour - { - ExcursionGroup = excursionGroup, - Tour = context.Tours.First(x => x.Id == et.Key) - }); - context.SaveChanges(); - } - _excursionGroupTours = null; - } - } -} diff --git a/TravelCompany/TravelCompanyDatabaseImplement/Models/ContractorModels/Excursion.cs b/TravelCompany/TravelCompanyDatabaseImplement/Models/Excursion.cs similarity index 96% rename from TravelCompany/TravelCompanyDatabaseImplement/Models/ContractorModels/Excursion.cs rename to TravelCompany/TravelCompanyDatabaseImplement/Models/Excursion.cs index 1fe9515..5749e3e 100644 --- a/TravelCompany/TravelCompanyDatabaseImplement/Models/ContractorModels/Excursion.cs +++ b/TravelCompany/TravelCompanyDatabaseImplement/Models/Excursion.cs @@ -11,7 +11,7 @@ using TravelCompanyDataModels.Models.Contractor; using Microsoft.EntityFrameworkCore; using TravelCompanyDatabaseImplement.Models.GuarantorModels; -namespace TravelCompanyDatabaseImplement.Models.ContractorModels +namespace TravelCompanyDatabaseImplement.Models { public class Excursion : IExcursionModel { diff --git a/TravelCompany/TravelCompanyDatabaseImplement/Models/ExcursionGroup.cs b/TravelCompany/TravelCompanyDatabaseImplement/Models/ExcursionGroup.cs new file mode 100644 index 0000000..ce1cf20 --- /dev/null +++ b/TravelCompany/TravelCompanyDatabaseImplement/Models/ExcursionGroup.cs @@ -0,0 +1,110 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using TravelCompanyContracts.BindingModels.Contractor; +using TravelCompanyContracts.ViewModels.Contractor.ViewModels; +using TravelCompanyDataModels.Models.Contractor; +using Microsoft.EntityFrameworkCore; +using TravelCompanyDatabaseImplement.Models.GuarantorModels; + +namespace TravelCompanyDatabaseImplement.Models +{ + public class ExcursionGroup : IExcursionGroupModel + { + public int Id { get; set; } + + [Required] + public string ExcursionGroupName { get; set; } = string.Empty; + + [Required] + public int PeopleAmount { get; set; } + + [Required] + public int ContractorID { get; set; } + + [DeleteBehavior(DeleteBehavior.Restrict)] + public virtual Contractor Contractor { get; set; } + } + + private Dictionary? _excursionGroupTours = null; + + [NotMapped] + public Dictionary ExcursionGroupTours + { + get + { + if (_excursionGroupTours == null) + { + _excursionGroupTours = Tours + .ToDictionary(recPC => recPC.TourId, recPC => recPC.Tour as ITourModel); + } + return _excursionGroupTours; + } + } + + [ForeignKey("ExcursionGroupId")] + public virtual List Tours { get; set; } = new(); + + public static ExcursionGroup? Create(TravelCompanyDatabase context, ExcursionGroupBindingModel? model) + { + if (model == null) + { + return null; + } + return new ExcursionGroup() + { + Id = model.Id, + ExcursionGroupName = model.ExcursionGroupName, + PeopleAmount = model.PeopleAmount, + ContractorID = model.ContractorID, + Tours = model.ExcursionGroupTours.Select(x => new ExcursionGroupTour + { + Tour = context.Tours.First(y => y.Id == x.Key) + }).ToList() + }; + } + public void Update(ExcursionGroupBindingModel? model) + { + if (model == null) + { + return; + } + ExcursionGroupName = model.ExcursionGroupName; + PeopleAmount = model.PeopleAmount; + } + + public ExcursionGroupViewModel GetViewModel => new() + { + Id = Id, + ExcursionGroupName = ExcursionGroupName, + PeopleAmount = PeopleAmount, + ContractorID = ContractorID, + ExcursionGroupTours = ExcursionGroupTours + }; + + public void UpdateTours(TravelCompanyDatabase context, ExcursionGroupBindingModel model) + { + var excursionGroupTours = context.ExcursionGroupTours.Where(rec => rec.ExcursionGroupId == model.Id).ToList(); + if (excursionGroupTours != null && excursionGroupTours.Count > 0) + { + context.ExcursionGroupTours.RemoveRange(excursionGroupTours.Where(rec => !model.ExcursionGroupTours.ContainsKey(rec.TourId))); + context.SaveChanges(); + } + var excursionGroup = context.ExcursionGroups.First(x => x.Id == Id); + foreach (var et in model.ExcursionGroupTours) + { + context.ExcursionGroupTours.Add(new ExcursionGroupTour + { + ExcursionGroup = excursionGroup, + Tour = context.Tours.First(x => x.Id == et.Key) + }); + context.SaveChanges(); + } + _excursionGroupTours = null; + } +} +} diff --git a/TravelCompany/TravelCompanyDatabaseImplement/Models/ContractorModels/ExcursionGroupTour.cs b/TravelCompany/TravelCompanyDatabaseImplement/Models/ExcursionGroupTour.cs similarity index 88% rename from TravelCompany/TravelCompanyDatabaseImplement/Models/ContractorModels/ExcursionGroupTour.cs rename to TravelCompany/TravelCompanyDatabaseImplement/Models/ExcursionGroupTour.cs index 5246f43..627038e 100644 --- a/TravelCompany/TravelCompanyDatabaseImplement/Models/ContractorModels/ExcursionGroupTour.cs +++ b/TravelCompany/TravelCompanyDatabaseImplement/Models/ExcursionGroupTour.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; using System.ComponentModel.DataAnnotations; -namespace TravelCompanyDatabaseImplement.Models.ContractorModels +namespace TravelCompanyDatabaseImplement.Models { public class ExcursionGroupTour { diff --git a/TravelCompany/TravelCompanyDatabaseImplement/Models/ContractorModels/ExcursionTour.cs b/TravelCompany/TravelCompanyDatabaseImplement/Models/ExcursionTour.cs similarity index 88% rename from TravelCompany/TravelCompanyDatabaseImplement/Models/ContractorModels/ExcursionTour.cs rename to TravelCompany/TravelCompanyDatabaseImplement/Models/ExcursionTour.cs index 8122d7b..66f3f96 100644 --- a/TravelCompany/TravelCompanyDatabaseImplement/Models/ContractorModels/ExcursionTour.cs +++ b/TravelCompany/TravelCompanyDatabaseImplement/Models/ExcursionTour.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; using System.ComponentModel.DataAnnotations; -namespace TravelCompanyDatabaseImplement.Models.ContractorModels +namespace TravelCompanyDatabaseImplement.Models { public class ExcursionTour { diff --git a/TravelCompany/TravelCompanyDatabaseImplement/Models/GuarantorModels/Guarantor.cs b/TravelCompany/TravelCompanyDatabaseImplement/Models/Guarantor.cs similarity index 97% rename from TravelCompany/TravelCompanyDatabaseImplement/Models/GuarantorModels/Guarantor.cs rename to TravelCompany/TravelCompanyDatabaseImplement/Models/Guarantor.cs index 2bf1f6a..d9a4baf 100644 --- a/TravelCompany/TravelCompanyDatabaseImplement/Models/GuarantorModels/Guarantor.cs +++ b/TravelCompany/TravelCompanyDatabaseImplement/Models/Guarantor.cs @@ -9,7 +9,7 @@ using TravelCompanyContracts.BindingModels.Guarantor; using TravelCompanyContracts.ViewModels.Guarantor.ViewModels; using TravelCompanyDataModels.Models.Guarantor; -namespace TravelCompanyDatabaseImplement.Models.GuarantorModels +namespace TravelCompanyDatabaseImplement.Models { public class Guarantor : IGuarantorModel { diff --git a/TravelCompany/TravelCompanyDatabaseImplement/Models/GuarantorModels/Guide.cs b/TravelCompany/TravelCompanyDatabaseImplement/Models/Guide.cs similarity index 71% rename from TravelCompany/TravelCompanyDatabaseImplement/Models/GuarantorModels/Guide.cs rename to TravelCompany/TravelCompanyDatabaseImplement/Models/Guide.cs index dfb0e4f..725b66e 100644 --- a/TravelCompany/TravelCompanyDatabaseImplement/Models/GuarantorModels/Guide.cs +++ b/TravelCompany/TravelCompanyDatabaseImplement/Models/Guide.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace TravelCompanyDatabaseImplement.Models.GuarantorModels +namespace TravelCompanyDatabaseImplement.Models { internal class Guide { diff --git a/TravelCompany/TravelCompanyDatabaseImplement/Models/GuarantorModels/Place.cs b/TravelCompany/TravelCompanyDatabaseImplement/Models/Place.cs similarity index 71% rename from TravelCompany/TravelCompanyDatabaseImplement/Models/GuarantorModels/Place.cs rename to TravelCompany/TravelCompanyDatabaseImplement/Models/Place.cs index afa15d6..579209a 100644 --- a/TravelCompany/TravelCompanyDatabaseImplement/Models/GuarantorModels/Place.cs +++ b/TravelCompany/TravelCompanyDatabaseImplement/Models/Place.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace TravelCompanyDatabaseImplement.Models.GuarantorModels +namespace TravelCompanyDatabaseImplement.Models { internal class Place { diff --git a/TravelCompany/TravelCompanyDatabaseImplement/Models/ContractorModels/Tour.cs b/TravelCompany/TravelCompanyDatabaseImplement/Models/Tour.cs similarity index 96% rename from TravelCompany/TravelCompanyDatabaseImplement/Models/ContractorModels/Tour.cs rename to TravelCompany/TravelCompanyDatabaseImplement/Models/Tour.cs index b114b31..2be9f2b 100644 --- a/TravelCompany/TravelCompanyDatabaseImplement/Models/ContractorModels/Tour.cs +++ b/TravelCompany/TravelCompanyDatabaseImplement/Models/Tour.cs @@ -10,7 +10,7 @@ using TravelCompanyContracts.ViewModels.Contractor.ViewModels; using TravelCompanyDataModels.Models.Contractor; using Microsoft.EntityFrameworkCore; -namespace TravelCompanyDatabaseImplement.Models.ContractorModels +namespace TravelCompanyDatabaseImplement.Models { public class Tour : ITourModel { diff --git a/TravelCompany/TravelCompanyDatabaseImplement/Models/GuarantorModels/Trip.cs b/TravelCompany/TravelCompanyDatabaseImplement/Models/Trip.cs similarity index 71% rename from TravelCompany/TravelCompanyDatabaseImplement/Models/GuarantorModels/Trip.cs rename to TravelCompany/TravelCompanyDatabaseImplement/Models/Trip.cs index 32f27d8..6fc44c7 100644 --- a/TravelCompany/TravelCompanyDatabaseImplement/Models/GuarantorModels/Trip.cs +++ b/TravelCompany/TravelCompanyDatabaseImplement/Models/Trip.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace TravelCompanyDatabaseImplement.Models.GuarantorModels +namespace TravelCompanyDatabaseImplement.Models { internal class Trip { diff --git a/TravelCompany/TravelCompanyDatabaseImplement/TravelCompanyDatabase.cs b/TravelCompany/TravelCompanyDatabaseImplement/TravelCompanyDatabase.cs index 3b297b2..6f05b5e 100644 --- a/TravelCompany/TravelCompanyDatabaseImplement/TravelCompanyDatabase.cs +++ b/TravelCompany/TravelCompanyDatabaseImplement/TravelCompanyDatabase.cs @@ -3,11 +3,9 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using TravelCompanyDatabaseImplement.Models.ContractorModels; -using TravelCompanyDatabaseImplement.Models.GuarantorModels; using Microsoft.EntityFrameworkCore; using System.Security.Principal; - +using TravelCompanyDatabaseImplement.Models; namespace TravelCompanyDatabaseImplement {