From 3b299edcd7b947e570049a9788c03e8f9d22f9b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?= =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= Date: Sat, 4 Mar 2023 12:30:59 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=81=D1=83=D1=89=D0=BD=D0=BE=D1=81=D1=82=D1=8C?= =?UTF-8?q?=20"=D0=9A=D0=BB=D0=B8=D0=B5=D0=BD=D1=82"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ConfectionaryBusinessLogic/ClientLogic.cs | 12 +++++++++++ .../BindingModels/ClientBindingModel.cs | 17 +++++++++++++++ .../BusinessLogicsContracts/IClientLogic.cs | 15 +++++++++++++ .../SearchModels/ClientSearchModel.cs | 15 +++++++++++++ .../StoragesContract/IClientStorage.cs | 21 +++++++++++++++++++ .../ViewModels/ClientViewModel.cs | 21 +++++++++++++++++++ ConfectioneryDataModels/IClientModel.cs | 15 +++++++++++++ 7 files changed, 116 insertions(+) create mode 100644 ConfectionaryBusinessLogic/ClientLogic.cs create mode 100644 ConfectioneryContracts/BindingModels/ClientBindingModel.cs create mode 100644 ConfectioneryContracts/BusinessLogicsContracts/IClientLogic.cs create mode 100644 ConfectioneryContracts/SearchModels/ClientSearchModel.cs create mode 100644 ConfectioneryContracts/StoragesContract/IClientStorage.cs create mode 100644 ConfectioneryContracts/ViewModels/ClientViewModel.cs create mode 100644 ConfectioneryDataModels/IClientModel.cs diff --git a/ConfectionaryBusinessLogic/ClientLogic.cs b/ConfectionaryBusinessLogic/ClientLogic.cs new file mode 100644 index 0000000..53a0137 --- /dev/null +++ b/ConfectionaryBusinessLogic/ClientLogic.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryBusinessLogic +{ + internal class ClientLogic + { + } +} diff --git a/ConfectioneryContracts/BindingModels/ClientBindingModel.cs b/ConfectioneryContracts/BindingModels/ClientBindingModel.cs new file mode 100644 index 0000000..b27bc98 --- /dev/null +++ b/ConfectioneryContracts/BindingModels/ClientBindingModel.cs @@ -0,0 +1,17 @@ +using ConfectioneryDataModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryContracts.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/ConfectioneryContracts/BusinessLogicsContracts/IClientLogic.cs b/ConfectioneryContracts/BusinessLogicsContracts/IClientLogic.cs new file mode 100644 index 0000000..d5ac6d1 --- /dev/null +++ b/ConfectioneryContracts/BusinessLogicsContracts/IClientLogic.cs @@ -0,0 +1,15 @@ +using ConfectioneryContracts.BindingModels; +using ConfectioneryContracts.SearchModels; +using ConfectioneryContracts.ViewModels; + +namespace ConfectioneryContracts.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/ConfectioneryContracts/SearchModels/ClientSearchModel.cs b/ConfectioneryContracts/SearchModels/ClientSearchModel.cs new file mode 100644 index 0000000..f408cba --- /dev/null +++ b/ConfectioneryContracts/SearchModels/ClientSearchModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryContracts.SearchModels +{ + public class ClientSearchModel + { + public int? Id { get; set; } + + public string? Email { get; set; } + } +} diff --git a/ConfectioneryContracts/StoragesContract/IClientStorage.cs b/ConfectioneryContracts/StoragesContract/IClientStorage.cs new file mode 100644 index 0000000..db285d4 --- /dev/null +++ b/ConfectioneryContracts/StoragesContract/IClientStorage.cs @@ -0,0 +1,21 @@ +using ConfectioneryContracts.BindingModels; +using ConfectioneryContracts.SearchModels; +using ConfectioneryContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryContracts.StoragesContract +{ + 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/ConfectioneryContracts/ViewModels/ClientViewModel.cs b/ConfectioneryContracts/ViewModels/ClientViewModel.cs new file mode 100644 index 0000000..fc3d9e8 --- /dev/null +++ b/ConfectioneryContracts/ViewModels/ClientViewModel.cs @@ -0,0 +1,21 @@ +using ConfectioneryDataModels; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryContracts.ViewModels +{ + public class ClientViewModel : IClientModel + { + 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/ConfectioneryDataModels/IClientModel.cs b/ConfectioneryDataModels/IClientModel.cs new file mode 100644 index 0000000..5dc5995 --- /dev/null +++ b/ConfectioneryDataModels/IClientModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryDataModels +{ + public interface IClientModel : IId + { + string ClientFIO { get; } + string Email { get; } + string Password { get; } + } +}