Add Client models

This commit is contained in:
Viltskaa 2023-03-26 16:43:18 +04:00
parent 55c5aedfd2
commit 5c55c2584c
6 changed files with 71 additions and 0 deletions

View File

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

View File

@ -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);
}

View File

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

View File

@ -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);
}

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

View File

@ -0,0 +1,8 @@
namespace SushiBarDataModels.Models;
public interface IClientModel : IId
{
string ClientFio { get; }
string Email { get; }
string Password { get; }
}