Add Client models
This commit is contained in:
parent
55c5aedfd2
commit
5c55c2584c
@ -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;
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
using SushiBarContracts.BindingModels;
|
||||||
|
using SushiBarContracts.SearchModels;
|
||||||
|
using SushiBarContracts.ViewModels;
|
||||||
|
|
||||||
|
namespace SushiBarContracts.BusinessLogicsContracts;
|
||||||
|
|
||||||
|
public interface IClientLogic
|
||||||
|
{
|
||||||
|
List<ClientViewModel>? ReadList(ClientSearchModel? model);
|
||||||
|
ClientViewModel? ReadElement(ClientSearchModel model);
|
||||||
|
bool Create(ClientBindingModel model);
|
||||||
|
bool Update(ClientBindingModel model);
|
||||||
|
bool Delete(ClientBindingModel model);
|
||||||
|
}
|
@ -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; }
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
using SushiBarContracts.BindingModels;
|
||||||
|
using SushiBarContracts.SearchModels;
|
||||||
|
using SushiBarContracts.ViewModels;
|
||||||
|
|
||||||
|
namespace SushiBarContracts.StoragesContracts;
|
||||||
|
|
||||||
|
public interface IClientStorage
|
||||||
|
{
|
||||||
|
List<ClientViewModel> GetFullList();
|
||||||
|
List<ClientViewModel> GetFilteredList(ClientSearchModel model);
|
||||||
|
ClientViewModel? GetElement(ClientSearchModel model);
|
||||||
|
ClientViewModel? Insert(ClientBindingModel model);
|
||||||
|
ClientViewModel? Update(ClientBindingModel model);
|
||||||
|
ClientViewModel? Delete(ClientBindingModel model);
|
||||||
|
}
|
15
SushiBar/SushiBarContracts/ViewModels/ClientViewModel.cs
Normal file
15
SushiBar/SushiBarContracts/ViewModels/ClientViewModel.cs
Normal file
@ -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;
|
||||||
|
}
|
8
SushiBar/SushiBarModels/Models/IClientModel.cs
Normal file
8
SushiBar/SushiBarModels/Models/IClientModel.cs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
namespace SushiBarDataModels.Models;
|
||||||
|
|
||||||
|
public interface IClientModel : IId
|
||||||
|
{
|
||||||
|
string ClientFio { get; }
|
||||||
|
string Email { get; }
|
||||||
|
string Password { get; }
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user