From 9793f0e6c9b0d0d5ba0433fd1ecc08748e3d0822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D0=B0=D0=BB=D0=B8=D0=BD=D0=B0=20=D0=A4=D0=B5=D0=B4?= =?UTF-8?q?=D0=BE=D1=80=D0=B5=D0=BD=D0=BA=D0=BE?= Date: Fri, 19 Apr 2024 21:23:08 +0400 Subject: [PATCH] =?UTF-8?q?+=D0=B5=D1=85=D0=B5=D0=BA=D1=8C=D1=8E=D1=82?= =?UTF-8?q?=D0=BE=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LawFim/LawFimDataModels/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 LawFim/LawFimDataModels/Models/IExecutorModel.cs create mode 100644 LawFim/LawFirmContracts/BindingModels/ExecutorBindingModel.cs create mode 100644 LawFim/LawFirmContracts/BusinessLogicContracts/IExecutorLogic.cs create mode 100644 LawFim/LawFirmContracts/SearchModels/ExecutorSearchModel.cs create mode 100644 LawFim/LawFirmContracts/StoragesContracts/IExecutorStorage.cs create mode 100644 LawFim/LawFirmContracts/ViewModels/ExecutorViewModel.cs diff --git a/LawFim/LawFimDataModels/Models/IExecutorModel.cs b/LawFim/LawFimDataModels/Models/IExecutorModel.cs new file mode 100644 index 0000000..b1c6289 --- /dev/null +++ b/LawFim/LawFimDataModels/Models/IExecutorModel.cs @@ -0,0 +1,9 @@ +namespace LawFimDataModels.Models +{ + public interface IExecutorModel : IId + { + string FIO { get; } + string Email { get; } + string Password { get; } + } +} diff --git a/LawFim/LawFirmContracts/BindingModels/ExecutorBindingModel.cs b/LawFim/LawFirmContracts/BindingModels/ExecutorBindingModel.cs new file mode 100644 index 0000000..472e534 --- /dev/null +++ b/LawFim/LawFirmContracts/BindingModels/ExecutorBindingModel.cs @@ -0,0 +1,14 @@ +using LawFimDataModels.Models; + +namespace LawFirmContracts.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/LawFim/LawFirmContracts/BusinessLogicContracts/IExecutorLogic.cs b/LawFim/LawFirmContracts/BusinessLogicContracts/IExecutorLogic.cs new file mode 100644 index 0000000..4d0265a --- /dev/null +++ b/LawFim/LawFirmContracts/BusinessLogicContracts/IExecutorLogic.cs @@ -0,0 +1,15 @@ +using LawFirmContracts.BindingModels; +using LawFirmContracts.SearchModels; +using LawFirmContracts.ViewModels; + +namespace LawFirmContracts.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/LawFim/LawFirmContracts/SearchModels/ExecutorSearchModel.cs b/LawFim/LawFirmContracts/SearchModels/ExecutorSearchModel.cs new file mode 100644 index 0000000..d260da7 --- /dev/null +++ b/LawFim/LawFirmContracts/SearchModels/ExecutorSearchModel.cs @@ -0,0 +1,10 @@ +namespace LawFirmContracts.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/LawFim/LawFirmContracts/StoragesContracts/IExecutorStorage.cs b/LawFim/LawFirmContracts/StoragesContracts/IExecutorStorage.cs new file mode 100644 index 0000000..ca2923d --- /dev/null +++ b/LawFim/LawFirmContracts/StoragesContracts/IExecutorStorage.cs @@ -0,0 +1,16 @@ +using LawFirmContracts.BindingModels; +using LawFirmContracts.SearchModels; +using LawFirmContracts.ViewModels; + +namespace LawFirmContracts.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/LawFim/LawFirmContracts/ViewModels/ExecutorViewModel.cs b/LawFim/LawFirmContracts/ViewModels/ExecutorViewModel.cs new file mode 100644 index 0000000..a7f31b3 --- /dev/null +++ b/LawFim/LawFirmContracts/ViewModels/ExecutorViewModel.cs @@ -0,0 +1,16 @@ +using LawFimDataModels.Models; +using System.ComponentModel; + +namespace LawFirmContracts.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; + } +}