в слой контрактов добавлены классы клиенты и изменены классы заказов

This commit is contained in:
ekallin 2024-04-06 14:53:34 +03:00
parent 3f2810f136
commit abe669a7c9
7 changed files with 90 additions and 1 deletions

View File

@ -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.Неизвестен;

View File

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

View File

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

View File

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

View File

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