From 287b5b7c1dabba26f94bd51deff9c606c0f64f1c Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Wed, 29 Mar 2023 23:22:17 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D1=81=D0=BB=D0=BE=D1=8F=20=D1=81=20=D0=BA=D0=BE=D0=BD?= =?UTF-8?q?=D1=82=D1=80=D0=B0=D0=BA=D1=82=D0=B0=D0=BC=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TransportCompany/TransportCompany.sln | 10 +++- .../BindingModels/CargoBindingModel.cs | 16 ++++++ .../BindingModels/ClientBindingModel.cs | 24 +++++++++ .../BindingModels/TransportBindingModel.cs | 16 ++++++ .../TransportationBindingModel.cs | 16 ++++++ .../BindingModels/TruckingBindingModel.cs | 28 +++++++++++ .../BusinessLogicsContracts/ICargoLogic.cs | 24 +++++++++ .../BusinessLogicsContracts/IClientLogic.cs | 24 +++++++++ .../ITransportLogic.cs | 24 +++++++++ .../ITransportationLogic.cs | 24 +++++++++ .../BusinessLogicsContracts/ITruckingLogic.cs | 24 +++++++++ .../SearchModels/CargoSearchModel.cs | 15 ++++++ .../SearchModels/ClientSearchModel.cs | 23 +++++++++ .../SearchModels/TransportSearchModel.cs | 15 ++++++ .../SearchModels/TransportationSearchModel.cs | 15 ++++++ .../SearchModels/TruckingSearchModel.cs | 19 +++++++ .../StoragesContracts/ICargoStorage.cs | 26 ++++++++++ .../StoragesContracts/IClientStorage.cs | 26 ++++++++++ .../StoragesContracts/ITransportStorage.cs | 26 ++++++++++ .../ITransportationStorage.cs | 26 ++++++++++ .../StoragesContracts/ITruckingStorage.cs | 26 ++++++++++ .../TransportCompanyContracts.csproj | 9 ++++ .../ViewModels/CargoViewModel.cs | 18 +++++++ .../ViewModels/ClientViewModel.cs | 30 +++++++++++ .../ViewModels/TransportViewModel.cs | 18 +++++++ .../ViewModels/TransportationViewModel.cs | 18 +++++++ .../ViewModels/TruckingViewModel.cs | 50 +++++++++++++++++++ .../Models/{ICargo.cs => ICargoModel.cs} | 2 +- .../Models/{IClient.cs => IClientModel.cs} | 2 +- ...rtationType.cs => ITransportationModel.cs} | 2 +- .../{ITrucking.cs => ITruckingModel.cs} | 4 +- 31 files changed, 593 insertions(+), 7 deletions(-) create mode 100644 TransportCompany/TransportCompanyContracts/BindingModels/CargoBindingModel.cs create mode 100644 TransportCompany/TransportCompanyContracts/BindingModels/ClientBindingModel.cs create mode 100644 TransportCompany/TransportCompanyContracts/BindingModels/TransportBindingModel.cs create mode 100644 TransportCompany/TransportCompanyContracts/BindingModels/TransportationBindingModel.cs create mode 100644 TransportCompany/TransportCompanyContracts/BindingModels/TruckingBindingModel.cs create mode 100644 TransportCompany/TransportCompanyContracts/BusinessLogicsContracts/ICargoLogic.cs create mode 100644 TransportCompany/TransportCompanyContracts/BusinessLogicsContracts/IClientLogic.cs create mode 100644 TransportCompany/TransportCompanyContracts/BusinessLogicsContracts/ITransportLogic.cs create mode 100644 TransportCompany/TransportCompanyContracts/BusinessLogicsContracts/ITransportationLogic.cs create mode 100644 TransportCompany/TransportCompanyContracts/BusinessLogicsContracts/ITruckingLogic.cs create mode 100644 TransportCompany/TransportCompanyContracts/SearchModels/CargoSearchModel.cs create mode 100644 TransportCompany/TransportCompanyContracts/SearchModels/ClientSearchModel.cs create mode 100644 TransportCompany/TransportCompanyContracts/SearchModels/TransportSearchModel.cs create mode 100644 TransportCompany/TransportCompanyContracts/SearchModels/TransportationSearchModel.cs create mode 100644 TransportCompany/TransportCompanyContracts/SearchModels/TruckingSearchModel.cs create mode 100644 TransportCompany/TransportCompanyContracts/StoragesContracts/ICargoStorage.cs create mode 100644 TransportCompany/TransportCompanyContracts/StoragesContracts/IClientStorage.cs create mode 100644 TransportCompany/TransportCompanyContracts/StoragesContracts/ITransportStorage.cs create mode 100644 TransportCompany/TransportCompanyContracts/StoragesContracts/ITransportationStorage.cs create mode 100644 TransportCompany/TransportCompanyContracts/StoragesContracts/ITruckingStorage.cs create mode 100644 TransportCompany/TransportCompanyContracts/TransportCompanyContracts.csproj create mode 100644 TransportCompany/TransportCompanyContracts/ViewModels/CargoViewModel.cs create mode 100644 TransportCompany/TransportCompanyContracts/ViewModels/ClientViewModel.cs create mode 100644 TransportCompany/TransportCompanyContracts/ViewModels/TransportViewModel.cs create mode 100644 TransportCompany/TransportCompanyContracts/ViewModels/TransportationViewModel.cs create mode 100644 TransportCompany/TransportCompanyContracts/ViewModels/TruckingViewModel.cs rename TransportCompany/TransportCompanyDataModels/Models/{ICargo.cs => ICargoModel.cs} (86%) rename TransportCompany/TransportCompanyDataModels/Models/{IClient.cs => IClientModel.cs} (90%) rename TransportCompany/TransportCompanyDataModels/Models/{ITransportationType.cs => ITransportationModel.cs} (84%) rename TransportCompany/TransportCompanyDataModels/Models/{ITrucking.cs => ITruckingModel.cs} (82%) diff --git a/TransportCompany/TransportCompany.sln b/TransportCompany/TransportCompany.sln index 56394e2..9ecf1f8 100644 --- a/TransportCompany/TransportCompany.sln +++ b/TransportCompany/TransportCompany.sln @@ -3,9 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.5.33516.290 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TransportCompany", "TransportCompany\TransportCompany.csproj", "{0512F64B-00F5-49BA-9613-7A396C075C0C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TransportCompany", "TransportCompany\TransportCompany.csproj", "{0512F64B-00F5-49BA-9613-7A396C075C0C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TransportCompanyDataModels", "TransportCompanyDataModels\TransportCompanyDataModels.csproj", "{C57B4449-A725-4804-833D-7CE33965F001}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TransportCompanyDataModels", "TransportCompanyDataModels\TransportCompanyDataModels.csproj", "{C57B4449-A725-4804-833D-7CE33965F001}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TransportCompanyContracts", "TransportCompanyContracts\TransportCompanyContracts.csproj", "{8707D719-D7B3-4F64-8BBE-DE9C7014DD13}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -21,6 +23,10 @@ Global {C57B4449-A725-4804-833D-7CE33965F001}.Debug|Any CPU.Build.0 = Debug|Any CPU {C57B4449-A725-4804-833D-7CE33965F001}.Release|Any CPU.ActiveCfg = Release|Any CPU {C57B4449-A725-4804-833D-7CE33965F001}.Release|Any CPU.Build.0 = Release|Any CPU + {8707D719-D7B3-4F64-8BBE-DE9C7014DD13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8707D719-D7B3-4F64-8BBE-DE9C7014DD13}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8707D719-D7B3-4F64-8BBE-DE9C7014DD13}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8707D719-D7B3-4F64-8BBE-DE9C7014DD13}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/TransportCompany/TransportCompanyContracts/BindingModels/CargoBindingModel.cs b/TransportCompany/TransportCompanyContracts/BindingModels/CargoBindingModel.cs new file mode 100644 index 0000000..5de64dd --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/BindingModels/CargoBindingModel.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TransportCompanyDataModels.Models; + +namespace TransportCompanyContracts.BindingModels +{ + public class CargoBindingModel : ICargoModel + { + public int Id { get; set; } + + public string TypeCargo { get; set; } = string.Empty; + } +} diff --git a/TransportCompany/TransportCompanyContracts/BindingModels/ClientBindingModel.cs b/TransportCompany/TransportCompanyContracts/BindingModels/ClientBindingModel.cs new file mode 100644 index 0000000..71a8b1e --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/BindingModels/ClientBindingModel.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TransportCompanyDataModels.Models; + +namespace TransportCompanyContracts.BindingModels +{ + public class ClientBindingModel : IClientModel + { + public int Id { get; set; } + + public string Name { get; set; } = string.Empty; + + public string Surname { get; set; } = string.Empty; + + public string Patronymic { get; set; } = string.Empty; + + public string TelephoneNumber { get; set; } = string.Empty; + + public string Email { get; set; } = string.Empty; + } +} diff --git a/TransportCompany/TransportCompanyContracts/BindingModels/TransportBindingModel.cs b/TransportCompany/TransportCompanyContracts/BindingModels/TransportBindingModel.cs new file mode 100644 index 0000000..7d189f4 --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/BindingModels/TransportBindingModel.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TransportCompanyDataModels.Models; + +namespace TransportCompanyContracts.BindingModels +{ + public class TransportBindingModel : ITransportModel + { + public int Id { get; set; } + + public string Tranport { get; set; } = string.Empty; + } +} diff --git a/TransportCompany/TransportCompanyContracts/BindingModels/TransportationBindingModel.cs b/TransportCompany/TransportCompanyContracts/BindingModels/TransportationBindingModel.cs new file mode 100644 index 0000000..4dd0553 --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/BindingModels/TransportationBindingModel.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TransportCompanyDataModels.Models; + +namespace TransportCompanyContracts.BindingModels +{ + public class TransportationBindingModel : ITransportationModel + { + public int Id {get; set;} + + public string TransportationType { get; set; } = string.Empty; + } +} diff --git a/TransportCompany/TransportCompanyContracts/BindingModels/TruckingBindingModel.cs b/TransportCompany/TransportCompanyContracts/BindingModels/TruckingBindingModel.cs new file mode 100644 index 0000000..e832e0c --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/BindingModels/TruckingBindingModel.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TransportCompanyDataModels.Models; + +namespace TransportCompanyContracts.BindingModels +{ + public class TruckingBindingModel : ITruckingModel + { + public int Id { get; set; } + + public int ClientId { get; set; } + + public int CargoId { get; set; } + + public double Price { get; set; } + + public DateTime DateStart { get; set; } + + public DateTime DateEnd { get; set; } + + public int TransportationId { get; set; } + + public int TransportId { get; set; } + } +} diff --git a/TransportCompany/TransportCompanyContracts/BusinessLogicsContracts/ICargoLogic.cs b/TransportCompany/TransportCompanyContracts/BusinessLogicsContracts/ICargoLogic.cs new file mode 100644 index 0000000..1328559 --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/BusinessLogicsContracts/ICargoLogic.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TransportCompanyContracts.BindingModels; +using TransportCompanyContracts.SearchModels; +using TransportCompanyContracts.ViewModels; + +namespace TransportCompanyContracts.BusinessLogicsContracts +{ + public interface ICargoLogic + { + List? ReadList(CargoSearchModel? model); + + CargoViewModel? ReadElement(CargoSearchModel model); + + bool Create(CargoBindingModel model); + + bool Update(CargoBindingModel model); + + bool Delete(CargoBindingModel model); + } +} diff --git a/TransportCompany/TransportCompanyContracts/BusinessLogicsContracts/IClientLogic.cs b/TransportCompany/TransportCompanyContracts/BusinessLogicsContracts/IClientLogic.cs new file mode 100644 index 0000000..615d83d --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/BusinessLogicsContracts/IClientLogic.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TransportCompanyContracts.BindingModels; +using TransportCompanyContracts.SearchModels; +using TransportCompanyContracts.ViewModels; + +namespace TransportCompanyContracts.BusinessLogicsContracts +{ + public interface IClientLogic + { + List? ReadList(ClientSearchModel? model); + + ClientViewModel? ReadElement(ClientSearchModel model); + + bool Create(ClientBindingModel model); + + bool Update(ClientBindingModel model); + + bool Delete(ClientBindingModel model); + } +} diff --git a/TransportCompany/TransportCompanyContracts/BusinessLogicsContracts/ITransportLogic.cs b/TransportCompany/TransportCompanyContracts/BusinessLogicsContracts/ITransportLogic.cs new file mode 100644 index 0000000..ba6f076 --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/BusinessLogicsContracts/ITransportLogic.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TransportCompanyContracts.BindingModels; +using TransportCompanyContracts.SearchModels; +using TransportCompanyContracts.ViewModels; + +namespace TransportCompanyContracts.BusinessLogicsContracts +{ + public interface ITransportLogic + { + List? ReadList(TransportSearchModel? model); + + TransportViewModel? ReadElement(TransportSearchModel model); + + bool Create(TransportBindingModel model); + + bool Update(TransportBindingModel model); + + bool Delete(TransportBindingModel model); + } +} diff --git a/TransportCompany/TransportCompanyContracts/BusinessLogicsContracts/ITransportationLogic.cs b/TransportCompany/TransportCompanyContracts/BusinessLogicsContracts/ITransportationLogic.cs new file mode 100644 index 0000000..675ae52 --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/BusinessLogicsContracts/ITransportationLogic.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TransportCompanyContracts.BindingModels; +using TransportCompanyContracts.SearchModels; +using TransportCompanyContracts.ViewModels; + +namespace TransportCompanyContracts.BusinessLogicsContracts +{ + public interface ITransportationLogic + { + List? ReadList(TransportationSearchModel? model); + + TransportationViewModel? ReadElement(TransportationSearchModel model); + + bool Create(TransportationBindingModel model); + + bool Update(TransportationBindingModel model); + + bool Delete(TransportationBindingModel model); + } +} diff --git a/TransportCompany/TransportCompanyContracts/BusinessLogicsContracts/ITruckingLogic.cs b/TransportCompany/TransportCompanyContracts/BusinessLogicsContracts/ITruckingLogic.cs new file mode 100644 index 0000000..1d22c31 --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/BusinessLogicsContracts/ITruckingLogic.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TransportCompanyContracts.BindingModels; +using TransportCompanyContracts.SearchModels; +using TransportCompanyContracts.ViewModels; + +namespace TransportCompanyContracts.BusinessLogicsContracts +{ + public interface ITruckingLogic + { + List? ReadList(TruckingSearchModel? model); + + TruckingViewModel? ReadElement(TruckingSearchModel model); + + bool Create(TruckingBindingModel model); + + bool Update(TruckingBindingModel model); + + bool Delete(TruckingBindingModel model); + } +} diff --git a/TransportCompany/TransportCompanyContracts/SearchModels/CargoSearchModel.cs b/TransportCompany/TransportCompanyContracts/SearchModels/CargoSearchModel.cs new file mode 100644 index 0000000..eb616d6 --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/SearchModels/CargoSearchModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TransportCompanyContracts.SearchModels +{ + public class CargoSearchModel + { + public int? Id { get; set; } + + public string? TypeCargo { get; set; } + } +} diff --git a/TransportCompany/TransportCompanyContracts/SearchModels/ClientSearchModel.cs b/TransportCompany/TransportCompanyContracts/SearchModels/ClientSearchModel.cs new file mode 100644 index 0000000..bd75d54 --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/SearchModels/ClientSearchModel.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TransportCompanyContracts.SearchModels +{ + public class ClientSearchModel + { + public int? Id { get; set; } + + public string? Name { get; set; } + + public string? Surname { get; set; } + + public string? Patronymic { get; set; } + + public string? TelephoneNumber { get; set; } + + public string? Email { get;} + } +} diff --git a/TransportCompany/TransportCompanyContracts/SearchModels/TransportSearchModel.cs b/TransportCompany/TransportCompanyContracts/SearchModels/TransportSearchModel.cs new file mode 100644 index 0000000..ad1e720 --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/SearchModels/TransportSearchModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TransportCompanyContracts.SearchModels +{ + public class TransportSearchModel + { + public int? Id { get; set; } + + public string? Tranport { get; set; } + } +} diff --git a/TransportCompany/TransportCompanyContracts/SearchModels/TransportationSearchModel.cs b/TransportCompany/TransportCompanyContracts/SearchModels/TransportationSearchModel.cs new file mode 100644 index 0000000..9acbec7 --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/SearchModels/TransportationSearchModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TransportCompanyContracts.SearchModels +{ + public class TransportationSearchModel + { + public int? Id { get; set; } + + public string? TransportationType { get; set; } + } +} diff --git a/TransportCompany/TransportCompanyContracts/SearchModels/TruckingSearchModel.cs b/TransportCompany/TransportCompanyContracts/SearchModels/TruckingSearchModel.cs new file mode 100644 index 0000000..02cb706 --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/SearchModels/TruckingSearchModel.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TransportCompanyContracts.SearchModels +{ + public class TruckingSearchModel + { + public int? Id { get; set; } + + public int? ClientId { get; set; } + + public DateTime? DateStart { get; set; } + + public DateTime? DateEnd { get; set; } + } +} diff --git a/TransportCompany/TransportCompanyContracts/StoragesContracts/ICargoStorage.cs b/TransportCompany/TransportCompanyContracts/StoragesContracts/ICargoStorage.cs new file mode 100644 index 0000000..a509bdd --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/StoragesContracts/ICargoStorage.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TransportCompanyContracts.BindingModels; +using TransportCompanyContracts.SearchModels; +using TransportCompanyContracts.ViewModels; + +namespace TransportCompanyContracts.StoragesContracts +{ + public interface ICargoStorage + { + List GetFullList(); + + List GetFilteredList(CargoSearchModel model); + + CargoViewModel? GetElement(CargoSearchModel model); + + CargoViewModel? Insert(CargoBindingModel model); + + CargoViewModel? Update(CargoBindingModel model); + + CargoViewModel? Delete(CargoBindingModel model); + } +} diff --git a/TransportCompany/TransportCompanyContracts/StoragesContracts/IClientStorage.cs b/TransportCompany/TransportCompanyContracts/StoragesContracts/IClientStorage.cs new file mode 100644 index 0000000..e147c46 --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/StoragesContracts/IClientStorage.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TransportCompanyContracts.BindingModels; +using TransportCompanyContracts.SearchModels; +using TransportCompanyContracts.ViewModels; + +namespace TransportCompanyContracts.StoragesContracts +{ + public interface IClientStorage + { + List GetFullList(); + + List GetFilteredList(ClientSearchModel model); + + ClientViewModel? GetElement(ClientSearchModel model); + + ClientViewModel? Insert(ClientBindingModel model); + + ClientViewModel? Update(ClientBindingModel model); + + ClientViewModel? Delete(ClientBindingModel model); + } +} diff --git a/TransportCompany/TransportCompanyContracts/StoragesContracts/ITransportStorage.cs b/TransportCompany/TransportCompanyContracts/StoragesContracts/ITransportStorage.cs new file mode 100644 index 0000000..a462551 --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/StoragesContracts/ITransportStorage.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TransportCompanyContracts.BindingModels; +using TransportCompanyContracts.SearchModels; +using TransportCompanyContracts.ViewModels; + +namespace TransportCompanyContracts.StoragesContracts +{ + public interface ITransportStorage + { + List GetFullList(); + + List GetFilteredList(TransportSearchModel model); + + TransportViewModel? GetElement(TransportSearchModel model); + + TransportViewModel? Insert(TransportBindingModel model); + + TransportViewModel? Update(TransportBindingModel model); + + TransportViewModel? Delete(TransportBindingModel model); + } +} diff --git a/TransportCompany/TransportCompanyContracts/StoragesContracts/ITransportationStorage.cs b/TransportCompany/TransportCompanyContracts/StoragesContracts/ITransportationStorage.cs new file mode 100644 index 0000000..a556aa4 --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/StoragesContracts/ITransportationStorage.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TransportCompanyContracts.BindingModels; +using TransportCompanyContracts.SearchModels; +using TransportCompanyContracts.ViewModels; + +namespace TransportCompanyContracts.StoragesContracts +{ + public interface ITransportationStorage + { + List GetFullList(); + + List GetFilteredList(TransportationSearchModel model); + + TransportationViewModel? GetElement(TransportationSearchModel model); + + TransportationViewModel? Insert(TransportationBindingModel model); + + TransportationViewModel? Update(TransportationBindingModel model); + + TransportationViewModel? Delete(TransportationBindingModel model); + } +} diff --git a/TransportCompany/TransportCompanyContracts/StoragesContracts/ITruckingStorage.cs b/TransportCompany/TransportCompanyContracts/StoragesContracts/ITruckingStorage.cs new file mode 100644 index 0000000..37afb54 --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/StoragesContracts/ITruckingStorage.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TransportCompanyContracts.BindingModels; +using TransportCompanyContracts.SearchModels; +using TransportCompanyContracts.ViewModels; + +namespace TransportCompanyContracts.StoragesContracts +{ + public interface ITruckingStorage + { + List GetFullList(); + + List GetFilteredList(TruckingSearchModel model); + + TruckingViewModel? GetElement(TruckingSearchModel model); + + TruckingViewModel? Insert(TruckingBindingModel model); + + TruckingViewModel? Update(TruckingBindingModel model); + + TruckingViewModel? Delete(TruckingBindingModel model); + } +} diff --git a/TransportCompany/TransportCompanyContracts/TransportCompanyContracts.csproj b/TransportCompany/TransportCompanyContracts/TransportCompanyContracts.csproj new file mode 100644 index 0000000..132c02c --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/TransportCompanyContracts.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/TransportCompany/TransportCompanyContracts/ViewModels/CargoViewModel.cs b/TransportCompany/TransportCompanyContracts/ViewModels/CargoViewModel.cs new file mode 100644 index 0000000..571df64 --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/ViewModels/CargoViewModel.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TransportCompanyDataModels.Models; + +namespace TransportCompanyContracts.ViewModels +{ + public class CargoViewModel : ICargoModel + { + public int Id { get; set; } + + [DisplayName("Тип груза")] + public string TypeCargo {get; set; } = string.Empty; + } +} diff --git a/TransportCompany/TransportCompanyContracts/ViewModels/ClientViewModel.cs b/TransportCompany/TransportCompanyContracts/ViewModels/ClientViewModel.cs new file mode 100644 index 0000000..53efa1a --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/ViewModels/ClientViewModel.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TransportCompanyDataModels.Models; + +namespace TransportCompanyContracts.ViewModels +{ + public class ClientViewModel : IClientModel + { + public int Id { get; set; } + + [DisplayName("Имя")] + public string Name { get; set; } = string.Empty; + + [DisplayName("Фамилия")] + public string Surname { get; set; } = string.Empty; + + [DisplayName("Отчество")] + public string Patronymic { get; set; } = string.Empty; + + [DisplayName("Телефон")] + public string TelephoneNumber { get; set; } = string.Empty; + + [DisplayName("Почта")] + public string Email { get; set; } = string.Empty; + } +} diff --git a/TransportCompany/TransportCompanyContracts/ViewModels/TransportViewModel.cs b/TransportCompany/TransportCompanyContracts/ViewModels/TransportViewModel.cs new file mode 100644 index 0000000..9374e02 --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/ViewModels/TransportViewModel.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TransportCompanyDataModels.Models; + +namespace TransportCompanyContracts.ViewModels +{ + public class TransportViewModel : ITransportModel + { + public int Id { get; set; } + + [DisplayName("Вид транспорта")] + public string Tranport { get; set; } = string.Empty; + } +} diff --git a/TransportCompany/TransportCompanyContracts/ViewModels/TransportationViewModel.cs b/TransportCompany/TransportCompanyContracts/ViewModels/TransportationViewModel.cs new file mode 100644 index 0000000..caf5a92 --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/ViewModels/TransportationViewModel.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TransportCompanyDataModels.Models; + +namespace TransportCompanyContracts.ViewModels +{ + public class TransportationViewModel : ITransportationModel + { + public int Id { get; set; } + + [DisplayName("Тип транспортировки")] + public string TransportationType { get; set; } = string.Empty; + } +} diff --git a/TransportCompany/TransportCompanyContracts/ViewModels/TruckingViewModel.cs b/TransportCompany/TransportCompanyContracts/ViewModels/TruckingViewModel.cs new file mode 100644 index 0000000..9fe4e14 --- /dev/null +++ b/TransportCompany/TransportCompanyContracts/ViewModels/TruckingViewModel.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using TransportCompanyDataModels.Models; + +namespace TransportCompanyContracts.ViewModels +{ + public class TruckingViewModel : ITruckingModel + { + public int Id { get; set; } + + public int ClientId { get; set; } + + [DisplayName("Имя")] + public string ClientName { get; set; } = string.Empty; + + [DisplayName("Фамилия")] + public string ClientSurname { get; set; } = string.Empty; + + [DisplayName("Отчество")] + public string ClientPatronymic { get; set; } = string.Empty; + + public int TransportationId { get; set; } + + [DisplayName("Тип перевозки")] + public string TypeTransportation { get; set; } = string.Empty; + + public int TransportId { get; set; } + + [DisplayName("Тип транспорта")] + public string TransportName { get; set; } = string.Empty; + + public int CargoId { get; set; } + + [DisplayName("Объект перевозки")] + public string Cargo { get; set; } = string.Empty; + + [DisplayName("Цена")] + public double Price { get; set; } + + [DisplayName("Дата оформления перевозки")] + public DateTime DateStart { get; set; } + + [DisplayName("Дата завершения перевозки")] + public DateTime DateEnd { get; set; } + } +} diff --git a/TransportCompany/TransportCompanyDataModels/Models/ICargo.cs b/TransportCompany/TransportCompanyDataModels/Models/ICargoModel.cs similarity index 86% rename from TransportCompany/TransportCompanyDataModels/Models/ICargo.cs rename to TransportCompany/TransportCompanyDataModels/Models/ICargoModel.cs index 1e5cbbb..d53d156 100644 --- a/TransportCompany/TransportCompanyDataModels/Models/ICargo.cs +++ b/TransportCompany/TransportCompanyDataModels/Models/ICargoModel.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace TransportCompanyDataModels.Models { - public interface ICargo : IId + public interface ICargoModel : IId { //тип груза string TypeCargo { get; } diff --git a/TransportCompany/TransportCompanyDataModels/Models/IClient.cs b/TransportCompany/TransportCompanyDataModels/Models/IClientModel.cs similarity index 90% rename from TransportCompany/TransportCompanyDataModels/Models/IClient.cs rename to TransportCompany/TransportCompanyDataModels/Models/IClientModel.cs index e6949c8..2c238f8 100644 --- a/TransportCompany/TransportCompanyDataModels/Models/IClient.cs +++ b/TransportCompany/TransportCompanyDataModels/Models/IClientModel.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace TransportCompanyDataModels.Models { - public interface IClient : IId + public interface IClientModel : IId { string Name { get; } diff --git a/TransportCompany/TransportCompanyDataModels/Models/ITransportationType.cs b/TransportCompany/TransportCompanyDataModels/Models/ITransportationModel.cs similarity index 84% rename from TransportCompany/TransportCompanyDataModels/Models/ITransportationType.cs rename to TransportCompany/TransportCompanyDataModels/Models/ITransportationModel.cs index aae77e6..05aea53 100644 --- a/TransportCompany/TransportCompanyDataModels/Models/ITransportationType.cs +++ b/TransportCompany/TransportCompanyDataModels/Models/ITransportationModel.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace TransportCompanyDataModels.Models { - public interface ITransportationType : IId + public interface ITransportationModel : IId { //тип транспортировки string TransportationType { get; } diff --git a/TransportCompany/TransportCompanyDataModels/Models/ITrucking.cs b/TransportCompany/TransportCompanyDataModels/Models/ITruckingModel.cs similarity index 82% rename from TransportCompany/TransportCompanyDataModels/Models/ITrucking.cs rename to TransportCompany/TransportCompanyDataModels/Models/ITruckingModel.cs index 2c0996e..231c370 100644 --- a/TransportCompany/TransportCompanyDataModels/Models/ITrucking.cs +++ b/TransportCompany/TransportCompanyDataModels/Models/ITruckingModel.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace TransportCompanyDataModels.Models { - public interface ITrucking : IId + public interface ITruckingModel : IId { int ClientId { get; } @@ -18,7 +18,7 @@ namespace TransportCompanyDataModels.Models DateTime DateEnd { get; } - int TypeTransportationId { get; } + int TransportationId { get; } int TransportId { get; } }