From 0a54e574bda385469636c3fc8a681d1fcb9181ed Mon Sep 17 00:00:00 2001 From: bekodeg Date: Sun, 28 Apr 2024 19:54:03 +0400 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BA=D0=BE=D0=BD=D1=82=D1=80=D0=B0=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D0=B2=20=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModels/ClientBindingModel.cs | 12 ++++++++++++ .../BusinessLogicsContracts/IClientLogic.cs | 15 +++++++++++++++ .../SearchModels/ClientSearchModel.cs | 9 +++++++++ .../StoragesContracts/IClientStorage.cs | 16 ++++++++++++++++ .../ViewModels/ClientViewModel.cs | 16 ++++++++++++++++ .../SushiBarDataModels/Models/IClientModel.cs | 9 +++++++++ 6 files changed, 77 insertions(+) create mode 100644 SushiBar/SushiBarContracts/BindingModels/ClientBindingModel.cs create mode 100644 SushiBar/SushiBarContracts/BusinessLogicsContracts/IClientLogic.cs create mode 100644 SushiBar/SushiBarContracts/SearchModels/ClientSearchModel.cs create mode 100644 SushiBar/SushiBarContracts/StoragesContracts/IClientStorage.cs create mode 100644 SushiBar/SushiBarContracts/ViewModels/ClientViewModel.cs create mode 100644 SushiBar/SushiBarDataModels/Models/IClientModel.cs diff --git a/SushiBar/SushiBarContracts/BindingModels/ClientBindingModel.cs b/SushiBar/SushiBarContracts/BindingModels/ClientBindingModel.cs new file mode 100644 index 0000000..ee1b8a6 --- /dev/null +++ b/SushiBar/SushiBarContracts/BindingModels/ClientBindingModel.cs @@ -0,0 +1,12 @@ +using SushiBarDataModels.Models; + +namespace SushiBarContracts.BindingModels +{ + public class ClientBindingModel : IClientModel + { + public int Id { get; set; } + public string ClientFIO { get; set; } = string.Empty; + public string Email { get; set; } = string.Empty; + public string Password { get; set; } = string.Empty; + } +} diff --git a/SushiBar/SushiBarContracts/BusinessLogicsContracts/IClientLogic.cs b/SushiBar/SushiBarContracts/BusinessLogicsContracts/IClientLogic.cs new file mode 100644 index 0000000..1bdcd7d --- /dev/null +++ b/SushiBar/SushiBarContracts/BusinessLogicsContracts/IClientLogic.cs @@ -0,0 +1,15 @@ +using SushiBarContracts.BindingModels; +using SushiBarContracts.SearchModels; +using SushiBarContracts.ViewModels; + +namespace SushiBarContracts.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/SushiBar/SushiBarContracts/SearchModels/ClientSearchModel.cs b/SushiBar/SushiBarContracts/SearchModels/ClientSearchModel.cs new file mode 100644 index 0000000..ead7631 --- /dev/null +++ b/SushiBar/SushiBarContracts/SearchModels/ClientSearchModel.cs @@ -0,0 +1,9 @@ +namespace SushiBarContracts.SearchModels +{ + public class ClientSearchModel + { + public int? Id { get; set; } + public string? ClientFIO { get; set; } + public string? Email { get; set; } + } +} diff --git a/SushiBar/SushiBarContracts/StoragesContracts/IClientStorage.cs b/SushiBar/SushiBarContracts/StoragesContracts/IClientStorage.cs new file mode 100644 index 0000000..44958f8 --- /dev/null +++ b/SushiBar/SushiBarContracts/StoragesContracts/IClientStorage.cs @@ -0,0 +1,16 @@ +using SushiBarContracts.BindingModels; +using SushiBarContracts.SearchModels; +using SushiBarContracts.ViewModels; + +namespace SushiBarContracts.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/SushiBar/SushiBarContracts/ViewModels/ClientViewModel.cs b/SushiBar/SushiBarContracts/ViewModels/ClientViewModel.cs new file mode 100644 index 0000000..d4ab405 --- /dev/null +++ b/SushiBar/SushiBarContracts/ViewModels/ClientViewModel.cs @@ -0,0 +1,16 @@ +using System.ComponentModel; + +namespace SushiBarContracts.ViewModels +{ + public class ClientViewModel + { + public int Id { get; set; } + [DisplayName("ФИО клиента")] + public string ClientFIO { get; set; } = string.Empty; + [DisplayName("Логин (эл. почта)")] + public string Email { get; set; } = string.Empty; + [DisplayName("Пароль")] + public string Password { get; set; } = string.Empty; + + } +} diff --git a/SushiBar/SushiBarDataModels/Models/IClientModel.cs b/SushiBar/SushiBarDataModels/Models/IClientModel.cs new file mode 100644 index 0000000..6d25cd2 --- /dev/null +++ b/SushiBar/SushiBarDataModels/Models/IClientModel.cs @@ -0,0 +1,9 @@ +namespace SushiBarDataModels.Models +{ + public interface IClientModel : IId + { + string ClientFIO { get; } + string Email { get; } + string Password { get; } + } +}