Create TravelAgencyCompanyContracts

This commit is contained in:
Алина 2024-04-28 21:24:09 +04:00
parent 3d2a2e315a
commit 32cdfea8b8
35 changed files with 593 additions and 7 deletions

View File

@ -3,9 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34322.80
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TravelAgencyView", "TravelAgencyView\TravelAgencyView.csproj", "{1C65EB1E-2405-44DD-84E3-6BEA3A5A0197}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TravelAgencyView", "TravelAgencyView\TravelAgencyView.csproj", "{1C65EB1E-2405-44DD-84E3-6BEA3A5A0197}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TravelAgencyDataModels", "TravelAgencyDataModels\TravelAgencyDataModels.csproj", "{DF3667E3-B2C0-4303-BE54-D23B19D72667}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TravelAgencyDataModels", "TravelAgencyDataModels\TravelAgencyDataModels.csproj", "{DF3667E3-B2C0-4303-BE54-D23B19D72667}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TravelAgencyCompanyContracts", "TravelAgencyCompanyContracts\TravelAgencyCompanyContracts.csproj", "{EEC43C70-1112-4652-B3DB-58A1515FC3AC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -21,6 +23,10 @@ Global
{DF3667E3-B2C0-4303-BE54-D23B19D72667}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DF3667E3-B2C0-4303-BE54-D23B19D72667}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DF3667E3-B2C0-4303-BE54-D23B19D72667}.Release|Any CPU.Build.0 = Release|Any CPU
{EEC43C70-1112-4652-B3DB-58A1515FC3AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EEC43C70-1112-4652-B3DB-58A1515FC3AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EEC43C70-1112-4652-B3DB-58A1515FC3AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EEC43C70-1112-4652-B3DB-58A1515FC3AC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelAgencyDataModels.Models;
namespace TravelAgencyCompanyContracts.BindingModels
{
public class CustomerBindingModel: ICustomerModel
{
public int Id { get; set; }
public string Fio { get; set; } = string.Empty;
public string PhoneNumber { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelAgencyDataModels.Models;
namespace TravelAgencyCompanyContracts.BindingModels
{
public class HotelBindingModel : IHotelModel
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Address { get; set; } = string.Empty;
public int NumberStars { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelAgencyDataModels.Models;
namespace TravelAgencyCompanyContracts.BindingModels
{
public class MedicalInsuranceBindingModel: IMedicalInsuranceModel
{
public int Id { get; set; }
public string Type { get; set; } = string.Empty;
public int Sum { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TravelAgencyCompanyContracts.BindingModels
{
public class ReportBindingModel
{
public string FileName { get; set; } = string.Empty;
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
}
}

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelAgencyDataModels.Enums;
using TravelAgencyDataModels.Models;
namespace TravelAgencyCompanyContracts.BindingModels
{
public class TourBindingModel:ITourModel
{
public int Id { get; set; }
public int CustomerId { get; set; }
public int HotelId { get; set; }
public int TransportId { get; set; }
public int InsuranceId { get; set; }
public string ToPlace { get; set; } = string.Empty;
public string FromPlace { get; set; } = string.Empty;
public int CountNight { get; set; }
public StructureStatus Status { get; set; } = StructureStatus.Неизвестен;
public DateTime DepartureDate { get; set; } = DateTime.Now;
public DateTime? ArrivalDate { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelAgencyDataModels.Models;
namespace TravelAgencyCompanyContracts.BindingModels
{
public class TransportBindingModel:ITransportModel
{
public int Id { get; set; }
public string Type { get; set; } = string.Empty;
public string Number { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelAgencyCompanyContracts.BindingModels;
using TravelAgencyCompanyContracts.SearchModel;
using TravelAgencyCompanyContracts.ViewModel;
namespace TravelAgencyCompanyContracts.BusinessLogicsContracts
{
public interface ICustomerLogic
{
List<CustomerViewModel>? ReadList(CustomerSearchModel? model);
CustomerViewModel? ReadElement(CustomerSearchModel model);
bool Create(CustomerBindingModel model);
bool Update(CustomerBindingModel model);
bool Delete(CustomerBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelAgencyCompanyContracts.BindingModels;
using TravelAgencyCompanyContracts.SearchModel;
using TravelAgencyCompanyContracts.ViewModel;
namespace TravelAgencyCompanyContracts.BusinessLogicsContracts
{
public interface IHotelLogic
{
List<HotelViewModel>? ReadList(HotelSearchModel? model);
HotelViewModel? ReadElement(HotelSearchModel model);
bool Create(HotelBindingModel model);
bool Update(HotelBindingModel model);
bool Delete(HotelBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelAgencyCompanyContracts.BindingModels;
using TravelAgencyCompanyContracts.SearchModel;
using TravelAgencyCompanyContracts.ViewModel;
namespace TravelAgencyCompanyContracts.BusinessLogicsContracts
{
public interface IMedicalInsuranceLogic
{
List<MedicalInsuranceViewModel>? ReadList(MedicalInsuranceSearchModel? model);
MedicalInsuranceViewModel? ReadElement(MedicalInsuranceSearchModel model);
bool Create(MedicalInsuranceBindingModel model);
bool Update(MedicalInsuranceBindingModel model);
bool Delete(MedicalInsuranceBindingModel model);
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelAgencyCompanyContracts.BindingModels;
namespace TravelAgencyCompanyContracts.BusinessLogicsContracts
{
public interface IReportLogic
{
List<ReportStructureViewModel> GetStructures(ReportBindingModel model);
void SaveStructuresToWordFile(ReportBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelAgencyCompanyContracts.BindingModels;
using TravelAgencyCompanyContracts.SearchModel;
using TravelAgencyCompanyContracts.ViewModel;
namespace TravelAgencyCompanyContracts.BusinessLogicsContracts
{
public interface ITourLogic
{
List<TourViewModel>? ReadList(TourSearchModel? model);
TourViewModel? ReadElement(TourSearchModel model);
bool Create(TourBindingModel model);
bool Update(TourBindingModel model);
bool Delete(TourBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelAgencyCompanyContracts.BindingModels;
using TravelAgencyCompanyContracts.SearchModel;
using TravelAgencyCompanyContracts.ViewModel;
namespace TravelAgencyCompanyContracts.BusinessLogicsContracts
{
public interface ITransportLogic
{
List<TransportViewModel>? ReadList(TransportSearchModel? model);
TransportViewModel? ReadElement(TransportSearchModel model);
bool Create(TransportBindingModel model);
bool Update(TransportBindingModel model);
bool Delete(TransportBindingModel model);
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TravelAgencyCompanyContracts.SearchModel
{
public class CustomerSearchModel
{
public int? Id { get; set; }
public string? Fio { get; set; }
public string? PhoneNumber { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TravelAgencyCompanyContracts.SearchModel
{
public class HotelSearchModel
{
public int? Id { get; set; }
public string? Name { get;set; }
public int? NumberStars { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TravelAgencyCompanyContracts.SearchModel
{
public class MedicalInsuranceSearchModel
{
public int? Id { get; set; }
public string? Type { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TravelAgencyCompanyContracts.SearchModel
{
public class TourSearchModel
{
public int? Id { get; set; }
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TravelAgencyCompanyContracts.SearchModel
{
public class TransportSearchModel
{
public int? Id { get; set; }
public string? Type { get; set; }
}
}

View File

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelAgencyCompanyContracts.BindingModels;
using TravelAgencyCompanyContracts.SearchModel;
using TravelAgencyCompanyContracts.ViewModel;
namespace TravelAgencyCompanyContracts.StoragesContracts
{
public interface ICustomerStorage
{
List<CustomerViewModel> GetFullList();
List<CustomerViewModel> GetFilteredList(CustomerSearchModel model);
CustomerViewModel? GetElement(CustomerSearchModel model);
CustomerViewModel? Insert(CustomerBindingModel model);
CustomerViewModel? Update(CustomerBindingModel model);
CustomerViewModel? Delete(CustomerBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelAgencyCompanyContracts.BindingModels;
using TravelAgencyCompanyContracts.SearchModel;
using TravelAgencyCompanyContracts.ViewModel;
namespace TravelAgencyCompanyContracts.StoragesContracts
{
public interface IHotelStorage
{
List<HotelViewModel> GetFullList();
List<HotelViewModel> GetFilteredList(HotelSearchModel model);
HotelViewModel? GetElement(HotelSearchModel model);
HotelViewModel? Insert(HotelBindingModel model);
HotelViewModel? Update(HotelBindingModel model);
HotelViewModel? Delete(HotelBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelAgencyCompanyContracts.BindingModels;
using TravelAgencyCompanyContracts.SearchModel;
using TravelAgencyCompanyContracts.ViewModel;
namespace TravelAgencyCompanyContracts.StoragesContracts
{
public interface IMedicalInsuranceStorage
{
List<MedicalInsuranceViewModel> GetFullList();
List<MedicalInsuranceViewModel> GetFilteredList(MedicalInsuranceSearchModel model);
MedicalInsuranceViewModel? GetElement(MedicalInsuranceSearchModel model);
MedicalInsuranceViewModel? Insert(MedicalInsuranceBindingModel model);
MedicalInsuranceViewModel? Update(MedicalInsuranceBindingModel model);
MedicalInsuranceViewModel? Delete(MedicalInsuranceBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelAgencyCompanyContracts.BindingModels;
using TravelAgencyCompanyContracts.SearchModel;
using TravelAgencyCompanyContracts.ViewModel;
namespace TravelAgencyCompanyContracts.StoragesContracts
{
public interface ITourStorage
{
List<TourViewModel> GetFullList();
List<TourViewModel> GetFilteredList(TourSearchModel model);
TourViewModel? GetElement(TourSearchModel model);
TourViewModel? Insert(TourBindingModel model);
TourViewModel? Update(TourBindingModel model);
TourViewModel? Delete(TourBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelAgencyCompanyContracts.BindingModels;
using TravelAgencyCompanyContracts.SearchModel;
using TravelAgencyCompanyContracts.ViewModel;
namespace TravelAgencyCompanyContracts.StoragesContracts
{
public interface ITransportStorage
{
List<TransportViewModel> GetFullList();
List<TransportViewModel> GetFilteredList(TransportSearchModel model);
TransportViewModel? GetElement(TransportSearchModel model);
TransportViewModel? Insert(TransportBindingModel model);
TransportViewModel? Update(TransportBindingModel model);
TransportViewModel? Delete(TransportBindingModel model);
}
}

View File

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\TravelAgencyDataModels\TravelAgencyDataModels.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelAgencyDataModels.Models;
namespace TravelAgencyCompanyContracts.ViewModel
{
public class CustomerViewModel:ICustomerModel
{
public int Id { get; set; }
[DisplayName("ФИО")]
public string Fio { get; set; } = string.Empty;
[DisplayName("Номер телефона")]
public string PhoneNumber { get; set; } = string.Empty;
[DisplayName("Электронная почта")]
public string Email { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelAgencyDataModels.Models;
namespace TravelAgencyCompanyContracts.ViewModel
{
public class HotelViewModel:IHotelModel
{
public int Id { get; set; }
[DisplayName("Название отеля")]
public string Name { get; set; } = string.Empty;
[DisplayName("Адрес")]
public string Address { get; set; } = string.Empty;
[DisplayName("Количество звёзд")]
public int NumberStars { get; set; }
}
}

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelAgencyDataModels.Models;
namespace TravelAgencyCompanyContracts.ViewModel
{
public class MedicalInsuranceViewModel:IMedicalInsuranceModel
{
public int Id { get; set; }
[DisplayName("Тип страховки")]
public string Type { get; set; } = string.Empty;
[DisplayName("Стоимость страховки")]
public int Sum { get; set; }
}
}

View File

@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelAgencyDataModels.Enums;
namespace TravelAgencyCompanyContracts.ViewModel
{
public class ReportTourViewModel
{
public int Id { get; set; }
public DateTime DateCreate { get; set; }
public int CustomerId { get; set; }
public int HotelId { get; set; }
public int TransportId { get; set; }
public int InsuranceId { get; set; }
[DisplayName("Пункт отправления")]
public string FromPlace { get; set; } = string.Empty;
[DisplayName("Пункт прибытия")]
public string ToPlace { get; set; } = string.Empty;
[DisplayName("Количество ночей")]
public int CountNight { get; set; }
[DisplayName("Статус")]
public StructureStatus Status { get; set; } = StructureStatus.Неизвестен;
[DisplayName("Дата начала работ")]
public DateTime DepartureDate { get; set; } = DateTime.Now;
[DisplayName("Дата окончания работ")]
public DateTime? ArrivalDate { get; set; }
}
}

View File

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelAgencyDataModels.Enums;
using TravelAgencyDataModels.Models;
namespace TravelAgencyCompanyContracts.ViewModel
{
public class TourViewModel:ITourModel
{
public int Id { get; set; }
public int CustomerId { get; set; }
public int HotelId { get; set; }
public int TransportId { get; set; }
public int InsuranceId { get; set; }
[DisplayName("Пункт отправления")]
public string FromPlace { get; set; } = string.Empty;
[DisplayName("Пункт прибытия")]
public string ToPlace { get; set; } = string.Empty;
[DisplayName("Количество ночей")]
public int CountNight { get; set; }
[DisplayName("Статус")]
public StructureStatus Status { get; set; } = StructureStatus.Неизвестен;
[DisplayName("Дата начала работ")]
public DateTime DepartureDate { get; set; } = DateTime.Now;
[DisplayName("Дата окончания работ")]
public DateTime? ArrivalDate { get; set; }
}
}

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelAgencyDataModels.Models;
namespace TravelAgencyCompanyContracts.ViewModel
{
public class TransportViewModel:ITransportModel
{
public int Id { get; set; }
[DisplayName("Вид транспорта")]
public string Type { get; set; } = string.Empty;
[DisplayName("Номер транспорта")]
public string Number { get; set; } = string.Empty;
}
}

View File

@ -4,7 +4,7 @@
{
string Fio { get; }
string PhoneNumber { get; }
string PassportNumber { get; }
string Email { get; }
}
}

View File

@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace TravelAgencyDataModels.Models
{
public interface IHotel:IId
public interface IHotelModel:IId
{
string Name { get; }
string Address { get; }

View File

@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace TravelAgencyDataModels.Models
{
public interface IMedicalInsurance : IId
public interface IMedicalInsuranceModel : IId
{
string Type { get; }
int Sum { get; }

View File

@ -7,12 +7,14 @@ using TravelAgencyDataModels.Enums;
namespace TravelAgencyDataModels.Models
{
public interface ITour:IId
public interface ITourModel:IId
{
int CustomerId { get; }
int HotelId { get; }
int TransportId { get; }
int InsuranceId { get; }
string FromPlace { get; }
string ToPlace { get; }
int CountNight { get; }
StructureStatus Status { get; }
DateTime DepartureDate { get; }

View File

@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace TravelAgencyDataModels.Models
{
public interface ITransport: IId
public interface ITransportModel: IId
{
string Type { get; }
string Number { get; }