diff --git a/SushiBar/SushiBarContracts/BindingModels/ClientBindingModel.cs b/SushiBar/SushiBarContracts/BindingModels/ClientBindingModel.cs new file mode 100644 index 0000000..ebbea1d --- /dev/null +++ b/SushiBar/SushiBarContracts/BindingModels/ClientBindingModel.cs @@ -0,0 +1,11 @@ +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; +} \ No newline at end of file diff --git a/SushiBar/SushiBarContracts/BusinessLogicsContracts/IClientLogic.cs b/SushiBar/SushiBarContracts/BusinessLogicsContracts/IClientLogic.cs new file mode 100644 index 0000000..f0d5e35 --- /dev/null +++ b/SushiBar/SushiBarContracts/BusinessLogicsContracts/IClientLogic.cs @@ -0,0 +1,14 @@ +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); +} \ No newline at end of file diff --git a/SushiBar/SushiBarContracts/SearchModels/ClientSearchModel.cs b/SushiBar/SushiBarContracts/SearchModels/ClientSearchModel.cs new file mode 100644 index 0000000..5347584 --- /dev/null +++ b/SushiBar/SushiBarContracts/SearchModels/ClientSearchModel.cs @@ -0,0 +1,8 @@ +namespace SushiBarContracts.SearchModels; + +public class ClientSearchModel +{ + public int? Id { get; set; } + public string? ClientFio { get; set; } + public string? Email { get; set; } +} \ No newline at end of file diff --git a/SushiBar/SushiBarContracts/StoragesContracts/IClientStorage.cs b/SushiBar/SushiBarContracts/StoragesContracts/IClientStorage.cs new file mode 100644 index 0000000..6d06b5a --- /dev/null +++ b/SushiBar/SushiBarContracts/StoragesContracts/IClientStorage.cs @@ -0,0 +1,15 @@ +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); +} \ No newline at end of file diff --git a/SushiBar/SushiBarContracts/ViewModels/ClientViewModel.cs b/SushiBar/SushiBarContracts/ViewModels/ClientViewModel.cs new file mode 100644 index 0000000..cb9e6ea --- /dev/null +++ b/SushiBar/SushiBarContracts/ViewModels/ClientViewModel.cs @@ -0,0 +1,15 @@ +using System.ComponentModel; +using SushiBarDataModels.Models; + +namespace SushiBarContracts.ViewModels; + +public class ClientViewModel : IClientModel +{ + public int Id { get; set; } + [DisplayName("FIO client")] + public string ClientFio { get; set; } = string.Empty; + [DisplayName("Email")] + public string Email { get; set; } = string.Empty; + [DisplayName("Password")] + public string Password { get; set; } = string.Empty; +} \ No newline at end of file diff --git a/SushiBar/SushiBarModels/Models/IClientModel.cs b/SushiBar/SushiBarModels/Models/IClientModel.cs new file mode 100644 index 0000000..b679014 --- /dev/null +++ b/SushiBar/SushiBarModels/Models/IClientModel.cs @@ -0,0 +1,8 @@ +namespace SushiBarDataModels.Models; + +public interface IClientModel : IId +{ + string ClientFio { get; } + string Email { get; } + string Password { get; } +} \ No newline at end of file