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; } + } +}