From 05b2a70ea894e034bc90678ef1277a02b264ee7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BE=D1=84=D1=8C=D1=8F=20=D0=AF=D0=BA=D0=BE=D0=B1?= =?UTF-8?q?=D1=87=D1=83=D0=BA?= Date: Wed, 1 May 2024 01:09:31 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D0=BE=D0=BB=D0=BD=D0=B8?= =?UTF-8?q?=D1=82=D0=B5=D0=BB=D1=8C!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LawCompany/LawCompany/Models/IExecutorModel.cs | 9 +++++++++ .../BindingModels/ExecutorBindingModel.cs | 14 ++++++++++++++ .../BusinessLogicContracts/IExecutorLogic.cs | 15 +++++++++++++++ .../SearchModels/ExecutorSearchModel.cs | 10 ++++++++++ .../StoragesContracts/IExecutorStorage.cs | 16 ++++++++++++++++ .../ViewModels/ExecutorViewModel.cs | 16 ++++++++++++++++ 6 files changed, 80 insertions(+) create mode 100644 LawCompany/LawCompany/Models/IExecutorModel.cs create mode 100644 LawCompany/LawCompanyContracts/BindingModels/ExecutorBindingModel.cs create mode 100644 LawCompany/LawCompanyContracts/BusinessLogicContracts/IExecutorLogic.cs create mode 100644 LawCompany/LawCompanyContracts/SearchModels/ExecutorSearchModel.cs create mode 100644 LawCompany/LawCompanyContracts/StoragesContracts/IExecutorStorage.cs create mode 100644 LawCompany/LawCompanyContracts/ViewModels/ExecutorViewModel.cs diff --git a/LawCompany/LawCompany/Models/IExecutorModel.cs b/LawCompany/LawCompany/Models/IExecutorModel.cs new file mode 100644 index 0000000..e4414e5 --- /dev/null +++ b/LawCompany/LawCompany/Models/IExecutorModel.cs @@ -0,0 +1,9 @@ +namespace LawCompanyDataModels.Models +{ + public interface IExecutorModel : IId + { + string FIO { get; } + string Email { get; } + string Password { get; } + } +} diff --git a/LawCompany/LawCompanyContracts/BindingModels/ExecutorBindingModel.cs b/LawCompany/LawCompanyContracts/BindingModels/ExecutorBindingModel.cs new file mode 100644 index 0000000..3292617 --- /dev/null +++ b/LawCompany/LawCompanyContracts/BindingModels/ExecutorBindingModel.cs @@ -0,0 +1,14 @@ +using LawCompanyDataModels.Models; + +namespace LawCompanyContracts.BindingModels +{ + public class ExecutorBindingModel : IExecutorModel + { + public int Id { get; set; } + public string FIO { get; set; } = string.Empty; + + public string Email { get; set; } = string.Empty; + + public string Password { get; set; } = string.Empty; + } +} diff --git a/LawCompany/LawCompanyContracts/BusinessLogicContracts/IExecutorLogic.cs b/LawCompany/LawCompanyContracts/BusinessLogicContracts/IExecutorLogic.cs new file mode 100644 index 0000000..178b96b --- /dev/null +++ b/LawCompany/LawCompanyContracts/BusinessLogicContracts/IExecutorLogic.cs @@ -0,0 +1,15 @@ +using LawCompanyContracts.BindingModels; +using LawCompanyContracts.SearchModels; +using LawCompanyContracts.ViewModels; + +namespace LawCompanyContracts.BusinessLogicContracts +{ + public interface IExecutorLogic + { + List? ReadList(ExecutorSearchModel? model); + ExecutorViewModel? ReadElement(ExecutorSearchModel model); + bool Create(ExecutorBindingModel model); + bool Update(ExecutorBindingModel model); + bool Delete(ExecutorBindingModel model); + } +} diff --git a/LawCompany/LawCompanyContracts/SearchModels/ExecutorSearchModel.cs b/LawCompany/LawCompanyContracts/SearchModels/ExecutorSearchModel.cs new file mode 100644 index 0000000..5363b18 --- /dev/null +++ b/LawCompany/LawCompanyContracts/SearchModels/ExecutorSearchModel.cs @@ -0,0 +1,10 @@ +namespace LawCompanyContracts.SearchModels +{ + public class ExecutorSearchModel + { + public int? Id { get; set; } + public string? FIO { get; set; } + public string? Email { get; set; } + public string? Password { get; set; } + } +} diff --git a/LawCompany/LawCompanyContracts/StoragesContracts/IExecutorStorage.cs b/LawCompany/LawCompanyContracts/StoragesContracts/IExecutorStorage.cs new file mode 100644 index 0000000..22a9924 --- /dev/null +++ b/LawCompany/LawCompanyContracts/StoragesContracts/IExecutorStorage.cs @@ -0,0 +1,16 @@ +using LawCompanyContracts.BindingModels; +using LawCompanyContracts.SearchModels; +using LawCompanyContracts.ViewModels; + +namespace LawCompanyContracts.StoragesContracts +{ + public interface IExecutorStorage + { + List GetFullList(); + List GetFilteredList(ExecutorSearchModel model); + ExecutorViewModel? GetElement(ExecutorSearchModel model); + ExecutorViewModel? Insert(ExecutorBindingModel model); + ExecutorViewModel? Update(ExecutorBindingModel model); + ExecutorViewModel? Delete(ExecutorBindingModel model); + } +} diff --git a/LawCompany/LawCompanyContracts/ViewModels/ExecutorViewModel.cs b/LawCompany/LawCompanyContracts/ViewModels/ExecutorViewModel.cs new file mode 100644 index 0000000..708a47f --- /dev/null +++ b/LawCompany/LawCompanyContracts/ViewModels/ExecutorViewModel.cs @@ -0,0 +1,16 @@ +using LawCompanyDataModels.Models; +using System.ComponentModel; + +namespace LawCompanyContracts.ViewModels +{ + public class ExecutorViewModel : IExecutorModel + { + public int Id { get; set; } + [DisplayName("Имя исполнителя")] + public string FIO { get; set; } = string.Empty; + [DisplayName("E-mail исполнителя")] + public string Email { get; set; } = string.Empty; + [DisplayName("Пароль исполнителя")] + public string Password { get; set; } = string.Empty; + } +}