diff --git a/SushiBarContracts/BindingModel/OrderBindingModel.cs b/SushiBarContracts/BindingModel/OrderBindingModel.cs index a7e09b7..a56374a 100644 --- a/SushiBarContracts/BindingModel/OrderBindingModel.cs +++ b/SushiBarContracts/BindingModel/OrderBindingModel.cs @@ -12,6 +12,8 @@ namespace SushiBarContracts.BindingModel { public int Id { get; set; } public int SushiId { get; set; } + public int ClientId { get; set; } + public string ClientFIO { get; set; } = string.Empty; public int Count { get; set; } public double Sum { get; set; } public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; diff --git a/SushiBarContracts/BusinessLogicsContracts/IClientLogic.cs b/SushiBarContracts/BusinessLogicsContracts/IClientLogic.cs new file mode 100644 index 0000000..cfd380a --- /dev/null +++ b/SushiBarContracts/BusinessLogicsContracts/IClientLogic.cs @@ -0,0 +1,20 @@ +using SushiBarContracts.BindingModel; +using SushiBarContracts.SearchModel; +using SushiBarContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +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/SushiBarContracts/SearchModel/ClientSearchModel.cs b/SushiBarContracts/SearchModel/ClientSearchModel.cs new file mode 100644 index 0000000..1631abf --- /dev/null +++ b/SushiBarContracts/SearchModel/ClientSearchModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SushiBarContracts.SearchModel +{ + public class ClientSearchModel + { + public int? Id { get; set; } + public string? Email { get; set; } + public string? Password { get; set; } + } +} diff --git a/SushiBarContracts/SearchModel/OrderSearchModel.cs b/SushiBarContracts/SearchModel/OrderSearchModel.cs index ea1a7ad..e74631f 100644 --- a/SushiBarContracts/SearchModel/OrderSearchModel.cs +++ b/SushiBarContracts/SearchModel/OrderSearchModel.cs @@ -9,6 +9,7 @@ namespace SushiBarContracts.SearchModel public class OrderSearchModel { public int? Id { get; set; } + public int? ClientId { get; set; } public DateTime? DateFrom { get; set; } public DateTime? DateTo { get; set; } diff --git a/SushiBarContracts/StoragesContracts/IClientStorage.cs b/SushiBarContracts/StoragesContracts/IClientStorage.cs new file mode 100644 index 0000000..307c8d9 --- /dev/null +++ b/SushiBarContracts/StoragesContracts/IClientStorage.cs @@ -0,0 +1,21 @@ +using SushiBarContracts.BindingModel; +using SushiBarContracts.SearchModel; +using SushiBarContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +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/SushiBarContracts/ViewModels/ClientViewModel.cs b/SushiBarContracts/ViewModels/ClientViewModel.cs new file mode 100644 index 0000000..c0968f7 --- /dev/null +++ b/SushiBarContracts/ViewModels/ClientViewModel.cs @@ -0,0 +1,26 @@ +using SushiBarDataModels; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SushiBarContracts.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/SushiBarContracts/ViewModels/OrderViewModel.cs b/SushiBarContracts/ViewModels/OrderViewModel.cs index 0093487..be7514e 100644 --- a/SushiBarContracts/ViewModels/OrderViewModel.cs +++ b/SushiBarContracts/ViewModels/OrderViewModel.cs @@ -10,9 +10,13 @@ namespace SushiBarContracts.ViewModels [DisplayName("Номер")] public int Id { get; set; } public int SushiId { get; set; } + public int ClientId { get; set; } - [DisplayName("Изделие")] + [DisplayName("Имя клиента")] + public string ClientFIO { get; set; } = string.Empty; + + [DisplayName("Суши")] public string SushiName { get; set; } = string.Empty;