diff --git a/TravelAgency/TravelAgency.sln b/TravelAgency/TravelAgency.sln new file mode 100644 index 0000000..ba8cd38 --- /dev/null +++ b/TravelAgency/TravelAgency.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.3.32929.385 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TravelAgencyDataModels", "TravelAgencyDataModels\TravelAgencyDataModels.csproj", "{9C824913-01A0-456C-AD55-F47471596EAD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TravelAgencyContracts", "TravelAgencyContracts\TravelAgencyContracts.csproj", "{5A5C7696-4047-4BB8-BEC3-9DDB4000394E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9C824913-01A0-456C-AD55-F47471596EAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9C824913-01A0-456C-AD55-F47471596EAD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9C824913-01A0-456C-AD55-F47471596EAD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9C824913-01A0-456C-AD55-F47471596EAD}.Release|Any CPU.Build.0 = Release|Any CPU + {5A5C7696-4047-4BB8-BEC3-9DDB4000394E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5A5C7696-4047-4BB8-BEC3-9DDB4000394E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5A5C7696-4047-4BB8-BEC3-9DDB4000394E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5A5C7696-4047-4BB8-BEC3-9DDB4000394E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {81490F8B-CB51-4068-B047-669976522A07} + EndGlobalSection +EndGlobal diff --git a/TravelAgency/TravelAgencyContracts/BindingModels/ExcursionBindingModel.cs b/TravelAgency/TravelAgencyContracts/BindingModels/ExcursionBindingModel.cs new file mode 100644 index 0000000..b727909 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/BindingModels/ExcursionBindingModel.cs @@ -0,0 +1,19 @@ +using TravelAgencyDataModels.Models; + +namespace TravelAgencyContracts.BindingModels +{ + public class ExcursionBindingModel : IExcursionModel + { + public int Id { get; set; } + + public string ExcursionName { get; set; } = string.Empty; + + public string ExcursionDescription { get; set; } = string.Empty; + + public double Price { get; set; } + + public int UserId { get; set; } + + public Dictionary ExcursionTours { get; set; } = new(); + } +} diff --git a/TravelAgency/TravelAgencyContracts/BindingModels/ExcursionGroupBindingModel.cs b/TravelAgency/TravelAgencyContracts/BindingModels/ExcursionGroupBindingModel.cs new file mode 100644 index 0000000..e1483b4 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/BindingModels/ExcursionGroupBindingModel.cs @@ -0,0 +1,19 @@ +using TravelAgencyDataModels.Models; + +namespace TravelAgencyContracts.BindingModels +{ + public class ExcursionGroupBindingModel : IExcursionGroupModel + { + public int Id { get; set; } + + public string ExcursionGroupName { get; set; } = string.Empty; + + public int ParticipantsAmount { get; set; } + + public int UserId { get; set; } + + public int GuideId { get; set; } + + public Dictionary ExcursionGroupTours { get; set; } = new(); + } +} diff --git a/TravelAgency/TravelAgencyContracts/BindingModels/GuideBindingModel.cs b/TravelAgency/TravelAgencyContracts/BindingModels/GuideBindingModel.cs new file mode 100644 index 0000000..324b4dd --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/BindingModels/GuideBindingModel.cs @@ -0,0 +1,15 @@ +using TravelAgencyDataModels.Models; + +namespace TravelAgencyContracts.BindingModels +{ + public class GuideBindingModel : IGuideModel + { + public int Id { get; set; } + + public string GuideFIO { get; set; } = string.Empty; + + public string Email { get; set; } = string.Empty; + + public string PhoneNumber { get; set; } = string.Empty; + } +} diff --git a/TravelAgency/TravelAgencyContracts/BindingModels/PlaceBindingModel.cs b/TravelAgency/TravelAgencyContracts/BindingModels/PlaceBindingModel.cs new file mode 100644 index 0000000..ddcd0a7 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/BindingModels/PlaceBindingModel.cs @@ -0,0 +1,15 @@ +using TravelAgencyDataModels.Models; + +namespace TravelAgencyContracts.BindingModels +{ + public class PlaceBindingModel : IPlaceModel + { + public int Id { get; set; } + + public string PlaceName { get; set; } = string.Empty; + + public string PlaceAddress { get; set; } = string.Empty; + + public int ExcursionId { get; set; } + } +} diff --git a/TravelAgency/TravelAgencyContracts/BindingModels/TourBindingModel.cs b/TravelAgency/TravelAgencyContracts/BindingModels/TourBindingModel.cs new file mode 100644 index 0000000..f39b6de --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/BindingModels/TourBindingModel.cs @@ -0,0 +1,17 @@ +using TravelAgencyDataModels.Models; + +namespace TravelAgencyContracts.BindingModels +{ + public class TourBindingModel : ITourModel + { + public int Id { get; set; } + + public string TourName { get; set; } = string.Empty; + + public string TourDescription { get; set; } = string.Empty; + + public double Price { get; set; } + + public int UserId { get; set; } + } +} diff --git a/TravelAgency/TravelAgencyContracts/BindingModels/TripBindingModel.cs b/TravelAgency/TravelAgencyContracts/BindingModels/TripBindingModel.cs new file mode 100644 index 0000000..05507a1 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/BindingModels/TripBindingModel.cs @@ -0,0 +1,17 @@ +using TravelAgencyDataModels.Models; + +namespace TravelAgencyContracts.BindingModels +{ + public class TripBindingModel : ITripModel + { + public int Id { get; set; } + + public string TripName { get; set; } = string.Empty; + + public DateTime TripDate { get; set; } + + public int GuideId { get; set; } + + public Dictionary TripPlaces { get; set; } = new(); + } +} diff --git a/TravelAgency/TravelAgencyContracts/BindingModels/UserBindingModel.cs b/TravelAgency/TravelAgencyContracts/BindingModels/UserBindingModel.cs new file mode 100644 index 0000000..e55b6f7 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/BindingModels/UserBindingModel.cs @@ -0,0 +1,19 @@ +using TravelAgencyDataModels.Models; + +namespace TravelAgencyContracts.BindingModels +{ + public class UserBindingModel : IUserModel + { + public int Id { get; set; } + + public string UserFIO { get; set; } = string.Empty; + + public string Email { get; set; } = string.Empty; + + public string PhoneNumber { get; set; } = string.Empty; + + public string Login { get; set; } = string.Empty; + + public string Password { get; set; } = string.Empty; + } +} diff --git a/TravelAgency/TravelAgencyContracts/BusinessLogicsContracts/IExcursionGroupLogic.cs b/TravelAgency/TravelAgencyContracts/BusinessLogicsContracts/IExcursionGroupLogic.cs new file mode 100644 index 0000000..20c309a --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/BusinessLogicsContracts/IExcursionGroupLogic.cs @@ -0,0 +1,19 @@ +using TravelAgencyContracts.BindingModels; +using TravelAgencyContracts.SearchModels; +using TravelAgencyContracts.ViewModels; + +namespace TravelAgencyContracts.BusinessLogicsContracts +{ + public interface IExcursionGroupLogic + { + List? ReadList(ExcursionGroupSearchModel? model); + + ExcursionGroupViewModel? ReadElement(ExcursionGroupSearchModel model); + + bool Create(ExcursionGroupBindingModel model); + + bool Update(ExcursionGroupBindingModel model); + + bool Delete(ExcursionGroupBindingModel model); + } +} diff --git a/TravelAgency/TravelAgencyContracts/BusinessLogicsContracts/IExcursionLogic.cs b/TravelAgency/TravelAgencyContracts/BusinessLogicsContracts/IExcursionLogic.cs new file mode 100644 index 0000000..e40b82f --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/BusinessLogicsContracts/IExcursionLogic.cs @@ -0,0 +1,19 @@ +using TravelAgencyContracts.BindingModels; +using TravelAgencyContracts.SearchModels; +using TravelAgencyContracts.ViewModels; + +namespace TravelAgencyContracts.BusinessLogicsContracts +{ + public interface IExcursionLogic + { + List? ReadList(ExcursionSearchModel? model); + + ExcursionViewModel? ReadElement(ExcursionSearchModel model); + + bool Create(ExcursionBindingModel model); + + bool Update(ExcursionBindingModel model); + + bool Delete(ExcursionBindingModel model); + } +} diff --git a/TravelAgency/TravelAgencyContracts/BusinessLogicsContracts/IGuideLogic.cs b/TravelAgency/TravelAgencyContracts/BusinessLogicsContracts/IGuideLogic.cs new file mode 100644 index 0000000..b02b64c --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/BusinessLogicsContracts/IGuideLogic.cs @@ -0,0 +1,19 @@ +using TravelAgencyContracts.BindingModels; +using TravelAgencyContracts.SearchModels; +using TravelAgencyContracts.ViewModels; + +namespace TravelAgencyContracts.BusinessLogicsContracts +{ + public interface IGuideLogic + { + List? ReadList(GuideSearchModel? model); + + GuideViewModel? ReadElement(GuideSearchModel model); + + bool Create(GuideBindingModel model); + + bool Update(GuideBindingModel model); + + bool Delete(GuideBindingModel model); + } +} diff --git a/TravelAgency/TravelAgencyContracts/BusinessLogicsContracts/IPlaceLogic.cs b/TravelAgency/TravelAgencyContracts/BusinessLogicsContracts/IPlaceLogic.cs new file mode 100644 index 0000000..d9f9ca3 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/BusinessLogicsContracts/IPlaceLogic.cs @@ -0,0 +1,19 @@ +using TravelAgencyContracts.BindingModels; +using TravelAgencyContracts.SearchModels; +using TravelAgencyContracts.ViewModels; + +namespace TravelAgencyContracts.BusinessLogicsContracts +{ + public interface IPlaceLogic + { + List? ReadList(PlaceSearchModel? model); + + PlaceViewModel? ReadElement(PlaceSearchModel model); + + bool Create(PlaceBindingModel model); + + bool Update(PlaceBindingModel model); + + bool Delete(PlaceBindingModel model); + } +} diff --git a/TravelAgency/TravelAgencyContracts/BusinessLogicsContracts/ITourLogic.cs b/TravelAgency/TravelAgencyContracts/BusinessLogicsContracts/ITourLogic.cs new file mode 100644 index 0000000..2bd30e7 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/BusinessLogicsContracts/ITourLogic.cs @@ -0,0 +1,19 @@ +using TravelAgencyContracts.BindingModels; +using TravelAgencyContracts.SearchModels; +using TravelAgencyContracts.ViewModels; + +namespace TravelAgencyContracts.BusinessLogicsContracts +{ + public interface ITourLogic + { + List? ReadList(TourSearchModel? model); + + TourViewModel? ReadElement(TourSearchModel model); + + bool Create(TourBindingModel model); + + bool Update(TourBindingModel model); + + bool Delete(TourBindingModel model); + } +} diff --git a/TravelAgency/TravelAgencyContracts/BusinessLogicsContracts/ITripLogic.cs b/TravelAgency/TravelAgencyContracts/BusinessLogicsContracts/ITripLogic.cs new file mode 100644 index 0000000..eb60c10 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/BusinessLogicsContracts/ITripLogic.cs @@ -0,0 +1,19 @@ +using TravelAgencyContracts.BindingModels; +using TravelAgencyContracts.SearchModels; +using TravelAgencyContracts.ViewModels; + +namespace TravelAgencyContracts.BusinessLogicsContracts +{ + public interface ITripLogic + { + List? ReadList(TripSearchModel? model); + + TripViewModel? ReadElement(TripSearchModel model); + + bool Create(TripBindingModel model); + + bool Update(TripBindingModel model); + + bool Delete(TripBindingModel model); + } +} diff --git a/TravelAgency/TravelAgencyContracts/BusinessLogicsContracts/IUserLogic.cs b/TravelAgency/TravelAgencyContracts/BusinessLogicsContracts/IUserLogic.cs new file mode 100644 index 0000000..6f2533a --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/BusinessLogicsContracts/IUserLogic.cs @@ -0,0 +1,19 @@ +using TravelAgencyContracts.BindingModels; +using TravelAgencyContracts.SearchModels; +using TravelAgencyContracts.ViewModels; + +namespace TravelAgencyContracts.BusinessLogicsContracts +{ + public interface IUserLogic + { + List? ReadList(UserSearchModel? model); + + UserViewModel? ReadElement(UserSearchModel model); + + bool Create(UserBindingModel model); + + bool Update(UserBindingModel model); + + bool Delete(UserBindingModel model); + } +} diff --git a/TravelAgency/TravelAgencyContracts/SearchModels/ExcursionGroupSearchModel.cs b/TravelAgency/TravelAgencyContracts/SearchModels/ExcursionGroupSearchModel.cs new file mode 100644 index 0000000..518ae1a --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/SearchModels/ExcursionGroupSearchModel.cs @@ -0,0 +1,13 @@ +namespace TravelAgencyContracts.SearchModels +{ + public class ExcursionGroupSearchModel + { + public int? Id { get; set; } + + public string? ExcursionGroupName { get; set; } + + public int? UserId { get; set; } + + public int? GuideId { get; set; } + } +} diff --git a/TravelAgency/TravelAgencyContracts/SearchModels/ExcursionSearchModel.cs b/TravelAgency/TravelAgencyContracts/SearchModels/ExcursionSearchModel.cs new file mode 100644 index 0000000..6adf2e1 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/SearchModels/ExcursionSearchModel.cs @@ -0,0 +1,11 @@ +namespace TravelAgencyContracts.SearchModels +{ + public class ExcursionSearchModel + { + public int? Id { get; set; } + + public string? ExcursionName { get; set; } + + public int? UserId { get; set; } + } +} diff --git a/TravelAgency/TravelAgencyContracts/SearchModels/GuideSearchModel.cs b/TravelAgency/TravelAgencyContracts/SearchModels/GuideSearchModel.cs new file mode 100644 index 0000000..cd37870 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/SearchModels/GuideSearchModel.cs @@ -0,0 +1,13 @@ +namespace TravelAgencyContracts.SearchModels +{ + public class GuideSearchModel + { + public int? Id { get; set; } + + public string? GuideFIO { get; set; } + + public string? Email { get; set; } + + public string? PhoneNumber { get; set; } + } +} diff --git a/TravelAgency/TravelAgencyContracts/SearchModels/PlaceSearchModel.cs b/TravelAgency/TravelAgencyContracts/SearchModels/PlaceSearchModel.cs new file mode 100644 index 0000000..26edf74 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/SearchModels/PlaceSearchModel.cs @@ -0,0 +1,13 @@ +namespace TravelAgencyContracts.SearchModels +{ + public class PlaceSearchModel + { + public int? Id { get; set; } + + public string? PlaceName { get; set; } + + public string? PlaceAddress { get; set; } + + public int? ExcursionId { get; set; } + } +} diff --git a/TravelAgency/TravelAgencyContracts/SearchModels/TourSearchModel.cs b/TravelAgency/TravelAgencyContracts/SearchModels/TourSearchModel.cs new file mode 100644 index 0000000..6e7b621 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/SearchModels/TourSearchModel.cs @@ -0,0 +1,11 @@ +namespace TravelAgencyContracts.SearchModels +{ + public class TourSearchModel + { + public int? Id { get; set; } + + public string? TourName { get; set; } + + public int? UserId { get; set; } + } +} diff --git a/TravelAgency/TravelAgencyContracts/SearchModels/TripSearchModel.cs b/TravelAgency/TravelAgencyContracts/SearchModels/TripSearchModel.cs new file mode 100644 index 0000000..2a3b495 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/SearchModels/TripSearchModel.cs @@ -0,0 +1,13 @@ +namespace TravelAgencyContracts.SearchModels +{ + public class TripSearchModel + { + public int? Id { get; set; } + + public string? TripName { get; set; } + + public DateTime? DateTrip { get; set; } + + public int? GuideId { get; set; } + } +} diff --git a/TravelAgency/TravelAgencyContracts/SearchModels/UserSearchModel.cs b/TravelAgency/TravelAgencyContracts/SearchModels/UserSearchModel.cs new file mode 100644 index 0000000..acc2a8d --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/SearchModels/UserSearchModel.cs @@ -0,0 +1,17 @@ +namespace TravelAgencyContracts.SearchModels +{ + public class UserSearchModel + { + public int? Id { get; set; } + + public string? UserFIO { get; set; } + + public string? Email { get; set; } + + public string? PhoneNumber { get; set; } + + public string? Login { get; set; } + + public string? Password { get; set; } + } +} diff --git a/TravelAgency/TravelAgencyContracts/StoragesContracts/IExcursionGroupStorage.cs b/TravelAgency/TravelAgencyContracts/StoragesContracts/IExcursionGroupStorage.cs new file mode 100644 index 0000000..1c58b75 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/StoragesContracts/IExcursionGroupStorage.cs @@ -0,0 +1,21 @@ +using TravelAgencyContracts.BindingModels; +using TravelAgencyContracts.SearchModels; +using TravelAgencyContracts.ViewModels; + +namespace TravelAgencyContracts.StoragesContracts +{ + public interface IExcursionGroupStorage + { + List GetFullList(); + + List GetFilteredList(ExcursionGroupSearchModel model); + + ExcursionGroupViewModel? GetElement(ExcursionGroupSearchModel model); + + ExcursionGroupViewModel? Insert(ExcursionGroupBindingModel model); + + ExcursionGroupViewModel? Update(ExcursionGroupBindingModel model); + + ExcursionGroupViewModel? Delete(ExcursionGroupBindingModel model); + } +} diff --git a/TravelAgency/TravelAgencyContracts/StoragesContracts/IExcursionStorage.cs b/TravelAgency/TravelAgencyContracts/StoragesContracts/IExcursionStorage.cs new file mode 100644 index 0000000..3015861 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/StoragesContracts/IExcursionStorage.cs @@ -0,0 +1,21 @@ +using TravelAgencyContracts.BindingModels; +using TravelAgencyContracts.SearchModels; +using TravelAgencyContracts.ViewModels; + +namespace TravelAgencyContracts.StoragesContracts +{ + public interface IExcursionStorage + { + List GetFullList(); + + List GetFilteredList(ExcursionSearchModel model); + + ExcursionViewModel? GetElement(ExcursionSearchModel model); + + ExcursionViewModel? Insert(ExcursionBindingModel model); + + ExcursionViewModel? Update(ExcursionBindingModel model); + + ExcursionViewModel? Delete(ExcursionBindingModel model); + } +} diff --git a/TravelAgency/TravelAgencyContracts/StoragesContracts/IGuideStorage.cs b/TravelAgency/TravelAgencyContracts/StoragesContracts/IGuideStorage.cs new file mode 100644 index 0000000..2c23d26 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/StoragesContracts/IGuideStorage.cs @@ -0,0 +1,21 @@ +using TravelAgencyContracts.BindingModels; +using TravelAgencyContracts.SearchModels; +using TravelAgencyContracts.ViewModels; + +namespace TravelAgencyContracts.StoragesContracts +{ + public interface IGuideStorage + { + List GetFullList(); + + List GetFilteredList(GuideSearchModel model); + + GuideViewModel? GetElement(GuideSearchModel model); + + GuideViewModel? Insert(GuideBindingModel model); + + GuideViewModel? Update(GuideBindingModel model); + + GuideViewModel? Delete(GuideBindingModel model); + } +} diff --git a/TravelAgency/TravelAgencyContracts/StoragesContracts/IPlaceStorage.cs b/TravelAgency/TravelAgencyContracts/StoragesContracts/IPlaceStorage.cs new file mode 100644 index 0000000..80ab1e0 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/StoragesContracts/IPlaceStorage.cs @@ -0,0 +1,21 @@ +using TravelAgencyContracts.BindingModels; +using TravelAgencyContracts.SearchModels; +using TravelAgencyContracts.ViewModels; + +namespace TravelAgencyContracts.StoragesContracts +{ + public interface IPlaceStorage + { + List GetFullList(); + + List GetFilteredList(PlaceSearchModel model); + + PlaceViewModel? GetElement(PlaceSearchModel model); + + PlaceViewModel? Insert(PlaceBindingModel model); + + PlaceViewModel? Update(PlaceBindingModel model); + + PlaceViewModel? Delete(PlaceBindingModel model); + } +} diff --git a/TravelAgency/TravelAgencyContracts/StoragesContracts/ITourStorage.cs b/TravelAgency/TravelAgencyContracts/StoragesContracts/ITourStorage.cs new file mode 100644 index 0000000..1b418a3 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/StoragesContracts/ITourStorage.cs @@ -0,0 +1,21 @@ +using TravelAgencyContracts.BindingModels; +using TravelAgencyContracts.SearchModels; +using TravelAgencyContracts.ViewModels; + +namespace TravelAgencyContracts.StoragesContracts +{ + public interface ITourStorage + { + List GetFullList(); + + List GetFilteredList(TourSearchModel model); + + TourViewModel? GetElement(TourSearchModel model); + + TourViewModel? Insert(TourBindingModel model); + + TourViewModel? Update(TourBindingModel model); + + TourViewModel? Delete(TourBindingModel model); + } +} diff --git a/TravelAgency/TravelAgencyContracts/StoragesContracts/ITripStorage.cs b/TravelAgency/TravelAgencyContracts/StoragesContracts/ITripStorage.cs new file mode 100644 index 0000000..d982ecd --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/StoragesContracts/ITripStorage.cs @@ -0,0 +1,21 @@ +using TravelAgencyContracts.BindingModels; +using TravelAgencyContracts.SearchModels; +using TravelAgencyContracts.ViewModels; + +namespace TravelAgencyContracts.StoragesContracts +{ + 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/TravelAgency/TravelAgencyContracts/StoragesContracts/IUserStorage.cs b/TravelAgency/TravelAgencyContracts/StoragesContracts/IUserStorage.cs new file mode 100644 index 0000000..886da1e --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/StoragesContracts/IUserStorage.cs @@ -0,0 +1,21 @@ +using TravelAgencyContracts.BindingModels; +using TravelAgencyContracts.SearchModels; +using TravelAgencyContracts.ViewModels; + +namespace TravelAgencyContracts.StoragesContracts +{ + public interface IUserStorage + { + List GetFullList(); + + List GetFilteredList(UserSearchModel model); + + UserViewModel? GetElement(UserSearchModel model); + + UserViewModel? Insert(UserBindingModel model); + + UserViewModel? Update(UserBindingModel model); + + UserViewModel? Delete(UserBindingModel model); + } +} diff --git a/TravelAgency/TravelAgencyContracts/TravelAgencyContracts.csproj b/TravelAgency/TravelAgencyContracts/TravelAgencyContracts.csproj new file mode 100644 index 0000000..f99ef07 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/TravelAgencyContracts.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/TravelAgency/TravelAgencyContracts/ViewModels/ExcursionGroupViewModel.cs b/TravelAgency/TravelAgencyContracts/ViewModels/ExcursionGroupViewModel.cs new file mode 100644 index 0000000..22b16a9 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/ViewModels/ExcursionGroupViewModel.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; +using TravelAgencyDataModels.Models; + +namespace TravelAgencyContracts.ViewModels +{ + public class ExcursionGroupViewModel + { + public int Id { get; set; } + + [DisplayName("Название экскурсии")] + public string ExcursionGroupName { get; set; } = string.Empty; + + [DisplayName("Количество участников")] + public int ParticipantsAmount { get; set; } + + public int UserId { get; set; } + + public int GuideId { get; set; } + + public Dictionary ExcursionGroupTours { get; set; } = new(); + } +} diff --git a/TravelAgency/TravelAgencyContracts/ViewModels/ExcursionViewModel.cs b/TravelAgency/TravelAgencyContracts/ViewModels/ExcursionViewModel.cs new file mode 100644 index 0000000..f1dedb7 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/ViewModels/ExcursionViewModel.cs @@ -0,0 +1,23 @@ +using System.ComponentModel; +using TravelAgencyDataModels.Models; + +namespace TravelAgencyContracts.ViewModels +{ + public class ExcursionViewModel + { + public int Id { get; set; } + + [DisplayName("Название экскурсии")] + public string ExcursionName { get; set; } = string.Empty; + + [DisplayName("Описание экскурсии")] + public string ExcursionDescription { get; set; } = string.Empty; + + [DisplayName("Цена")] + public double Price { get; set; } + + public int UserId { get; set; } + + public Dictionary ExcursionTours { get; set; } = new(); + } +} diff --git a/TravelAgency/TravelAgencyContracts/ViewModels/GuideViewModel.cs b/TravelAgency/TravelAgencyContracts/ViewModels/GuideViewModel.cs new file mode 100644 index 0000000..e65b8e9 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/ViewModels/GuideViewModel.cs @@ -0,0 +1,18 @@ +using System.ComponentModel; + +namespace TravelAgencyContracts.ViewModels +{ + public class GuideViewModel + { + public int Id { get; set; } + + [DisplayName("ФИО гида")] + public string GuideFIO { get; set; } = string.Empty; + + [DisplayName("Эл. почта")] + public string Email { get; set; } = string.Empty; + + [DisplayName("Номер телефона")] + public string PhoneNumber { get; set; } = string.Empty; + } +} diff --git a/TravelAgency/TravelAgencyContracts/ViewModels/PlaceViewModel.cs b/TravelAgency/TravelAgencyContracts/ViewModels/PlaceViewModel.cs new file mode 100644 index 0000000..9c2e0f0 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/ViewModels/PlaceViewModel.cs @@ -0,0 +1,17 @@ +using System.ComponentModel; + +namespace TravelAgencyContracts.ViewModels +{ + public class PlaceViewModel + { + public int Id { get; set; } + + [DisplayName("Название места")] + public string PlaceName { get; set; } = string.Empty; + + [DisplayName("Адрес места")] + public string PlaceAddress { get; set; } = string.Empty; + + public int ExcursionId { get; set; } + } +} diff --git a/TravelAgency/TravelAgencyContracts/ViewModels/TourViewModel.cs b/TravelAgency/TravelAgencyContracts/ViewModels/TourViewModel.cs new file mode 100644 index 0000000..c4d2e5c --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/ViewModels/TourViewModel.cs @@ -0,0 +1,20 @@ +using System.ComponentModel; + +namespace TravelAgencyContracts.ViewModels +{ + public class TourViewModel + { + public int Id { get; set; } + + [DisplayName("Название тура")] + public string TourName { get; set; } = string.Empty; + + [DisplayName("Описание тура")] + public string TourDescription { get; set; } = string.Empty; + + [DisplayName("Цена")] + public double Price { get; set; } + + public int UserId { get; set; } + } +} diff --git a/TravelAgency/TravelAgencyContracts/ViewModels/TripViewModel.cs b/TravelAgency/TravelAgencyContracts/ViewModels/TripViewModel.cs new file mode 100644 index 0000000..e605b44 --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/ViewModels/TripViewModel.cs @@ -0,0 +1,20 @@ +using System.ComponentModel; +using TravelAgencyDataModels.Models; + +namespace TravelAgencyContracts.ViewModels +{ + public class TripViewModel + { + public int Id { get; set; } + + [DisplayName("Название поездки")] + public string TripName { get; set; } = string.Empty; + + [DisplayName("Дата поездки")] + public DateTime TripDate { get; set; } + + public int GuideId { get; set; } + + public Dictionary TripPlaces { get; set; } = new(); + } +} diff --git a/TravelAgency/TravelAgencyContracts/ViewModels/UserViewModel.cs b/TravelAgency/TravelAgencyContracts/ViewModels/UserViewModel.cs new file mode 100644 index 0000000..a9c9ead --- /dev/null +++ b/TravelAgency/TravelAgencyContracts/ViewModels/UserViewModel.cs @@ -0,0 +1,24 @@ +using System.ComponentModel; + +namespace TravelAgencyContracts.ViewModels +{ + public class UserViewModel + { + public int Id { get; set; } + + [DisplayName("ФИО пользователя")] + public string UserFIO { get; set; } = string.Empty; + + [DisplayName("Эл. почта")] + public string Email { get; set; } = string.Empty; + + [DisplayName("Номер телефона")] + public string PhoneNumber { get; set; } = string.Empty; + + [DisplayName("Логин")] + public string Login { get; set; } = string.Empty; + + [DisplayName("Пароль")] + public string Password { get; set; } = string.Empty; + } +} diff --git a/TravelAgency/TravelAgencyDataModels/IId.cs b/TravelAgency/TravelAgencyDataModels/IId.cs new file mode 100644 index 0000000..193fba3 --- /dev/null +++ b/TravelAgency/TravelAgencyDataModels/IId.cs @@ -0,0 +1,7 @@ +namespace TravelAgencyDataModels +{ + public interface IId + { + int Id { get; } + } +} diff --git a/TravelAgency/TravelAgencyDataModels/Models/IExcursionGroupModel.cs b/TravelAgency/TravelAgencyDataModels/Models/IExcursionGroupModel.cs new file mode 100644 index 0000000..10d2996 --- /dev/null +++ b/TravelAgency/TravelAgencyDataModels/Models/IExcursionGroupModel.cs @@ -0,0 +1,15 @@ +namespace TravelAgencyDataModels.Models +{ + public interface IExcursionGroupModel : IId + { + string ExcursionGroupName { get; } + + int ParticipantsAmount { get; } + + int UserId { get; } + + int GuideId { get; } + + Dictionary ExcursionGroupTours { get; } + } +} diff --git a/TravelAgency/TravelAgencyDataModels/Models/IExcursionModel.cs b/TravelAgency/TravelAgencyDataModels/Models/IExcursionModel.cs new file mode 100644 index 0000000..aa71d5d --- /dev/null +++ b/TravelAgency/TravelAgencyDataModels/Models/IExcursionModel.cs @@ -0,0 +1,15 @@ +namespace TravelAgencyDataModels.Models +{ + public interface IExcursionModel : IId + { + string ExcursionName { get; } + + string ExcursionDescription { get; } + + double Price { get; } + + int UserId { get; } + + Dictionary ExcursionTours { get; } + } +} diff --git a/TravelAgency/TravelAgencyDataModels/Models/IGuideModel.cs b/TravelAgency/TravelAgencyDataModels/Models/IGuideModel.cs new file mode 100644 index 0000000..71c74a4 --- /dev/null +++ b/TravelAgency/TravelAgencyDataModels/Models/IGuideModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TravelAgencyDataModels.Models +{ + public interface IGuideModel :IId + { + string GuideFIO { get; } + + string Email { get; } + + string PhoneNumber { get; } + } +} diff --git a/TravelAgency/TravelAgencyDataModels/Models/IPlaceModel.cs b/TravelAgency/TravelAgencyDataModels/Models/IPlaceModel.cs new file mode 100644 index 0000000..8aebeb0 --- /dev/null +++ b/TravelAgency/TravelAgencyDataModels/Models/IPlaceModel.cs @@ -0,0 +1,11 @@ +namespace TravelAgencyDataModels.Models +{ + public interface IPlaceModel : IId + { + string PlaceName { get; } + + string PlaceAddress { get; } + + int ExcursionId { get; } + } +} diff --git a/TravelAgency/TravelAgencyDataModels/Models/ITourModel.cs b/TravelAgency/TravelAgencyDataModels/Models/ITourModel.cs new file mode 100644 index 0000000..4dc8199 --- /dev/null +++ b/TravelAgency/TravelAgencyDataModels/Models/ITourModel.cs @@ -0,0 +1,13 @@ +namespace TravelAgencyDataModels.Models +{ + public interface ITourModel : IId + { + string TourName { get; } + + string TourDescription { get; } + + double Price { get; } + + int UserId { get; } + } +} diff --git a/TravelAgency/TravelAgencyDataModels/Models/ITripModel.cs b/TravelAgency/TravelAgencyDataModels/Models/ITripModel.cs new file mode 100644 index 0000000..ed3bc22 --- /dev/null +++ b/TravelAgency/TravelAgencyDataModels/Models/ITripModel.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TravelAgencyDataModels.Models +{ + public interface ITripModel : IId + { + string TripName { get; } + + DateTime TripDate { get; } + + int GuideId { get; } + + Dictionary TripPlaces { get; } + } +} diff --git a/TravelAgency/TravelAgencyDataModels/Models/IUserModel.cs b/TravelAgency/TravelAgencyDataModels/Models/IUserModel.cs new file mode 100644 index 0000000..8f800de --- /dev/null +++ b/TravelAgency/TravelAgencyDataModels/Models/IUserModel.cs @@ -0,0 +1,15 @@ +namespace TravelAgencyDataModels.Models +{ + public interface IUserModel : IId + { + string UserFIO { get; } + + string Email { get; } + + string PhoneNumber { get; } + + string Login { get; } + + string Password { get; } + } +} diff --git a/TravelAgency/TravelAgencyDataModels/TravelAgencyDataModels.csproj b/TravelAgency/TravelAgencyDataModels/TravelAgencyDataModels.csproj new file mode 100644 index 0000000..132c02c --- /dev/null +++ b/TravelAgency/TravelAgencyDataModels/TravelAgencyDataModels.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + +