Compare commits
4 Commits
a794921f82
...
9d25188cf5
Author | SHA1 | Date | |
---|---|---|---|
9d25188cf5 | |||
c85123f1e3 | |||
27d772da25 | |||
c096206b55 |
@ -6,4 +6,16 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.8" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ComputerShopContracts\ComputerShopContracts.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="BusinessLogics\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
27
ComputerShopContracts/BindingModels/OrderBindingModel.cs
Normal file
27
ComputerShopContracts/BindingModels/OrderBindingModel.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using ComputerShopDataModels.Enums;
|
||||
using ComputerShopDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopContracts.BindingModels
|
||||
{
|
||||
public class OrderBindingModel : IOrderModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public int UserId { get; set; }
|
||||
|
||||
public Dictionary<int, IRequestModel> OrderRequests { get; set; } = new();
|
||||
|
||||
public Dictionary<int, IShipmentModel> OrderShipments { get; set; } = new();
|
||||
|
||||
public DateTime DateCreate { get; set; } = DateTime.Now;
|
||||
|
||||
public OrderStatus Status { get; set; } = OrderStatus.Неизвестен;
|
||||
|
||||
public double Sum { get; set; }
|
||||
}
|
||||
}
|
23
ComputerShopContracts/BindingModels/RequestBindingModel.cs
Normal file
23
ComputerShopContracts/BindingModels/RequestBindingModel.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using ComputerShopDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopContracts.BindingModels
|
||||
{
|
||||
public class RequestBindingModel : IRequestModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public int UserId { get; set; }
|
||||
|
||||
public DateTime DateMake { get; set; } = DateTime.Now;
|
||||
|
||||
//!!!МБ НЕ НАДО string.Empty
|
||||
public string ClientFIO { get; set; } = string.Empty;
|
||||
|
||||
//!!!ДОБАВИТЬ СТАТУС, ЕСЛИ БУДЕТ В ОБЫЧНОЙ МОДЕЛИ
|
||||
}
|
||||
}
|
21
ComputerShopContracts/BindingModels/ShipmentBindingModel.cs
Normal file
21
ComputerShopContracts/BindingModels/ShipmentBindingModel.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using ComputerShopDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopContracts.BindingModels
|
||||
{
|
||||
public class ShipmentBindingModel : IShipmentModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public int UserId { get; set; }
|
||||
|
||||
//!!!МБ НЕ НАДО string.Empty
|
||||
public string ProviderName { get; set; } = string.Empty;
|
||||
|
||||
public DateTime DateShipment { get; set; } = DateTime.Now;
|
||||
}
|
||||
}
|
20
ComputerShopContracts/BindingModels/UserBindingModel.cs
Normal file
20
ComputerShopContracts/BindingModels/UserBindingModel.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using ComputerShopDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopContracts.BindingModels
|
||||
{
|
||||
public class UserBindingModel : IUserModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
//!!!МБ НЕ НАДО string.Empty
|
||||
public string Login { get; set; } = string.Empty;
|
||||
//!!!МБ НЕ НАДО string.Empty
|
||||
public string Password { get; set; } = string.Empty;
|
||||
//!!!МБ НЕ НАДО string.Empty
|
||||
public string Email { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
22
ComputerShopContracts/BusinessLogicContracts/IOrderLogic.cs
Normal file
22
ComputerShopContracts/BusinessLogicContracts/IOrderLogic.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using ComputerShopContracts.BindingModels;
|
||||
using ComputerShopContracts.SearchModels;
|
||||
using ComputerShopContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopContracts.BusinessLogicContracts
|
||||
{
|
||||
//!!!ПРОВЕРИТЬ, ЧТО НЕ НУЖНЫ ДРУГИЕ МЕТОДЫ
|
||||
public interface IOrderLogic
|
||||
{
|
||||
List<OrderViewModel>? ReadList(OrderSearchModel? model);
|
||||
OrderViewModel? ReadElement(OrderSearchModel model);
|
||||
bool CreateOrder(OrderBindingModel model);
|
||||
bool TakeOrderInWork(OrderBindingModel model);
|
||||
bool FinishOrder(OrderBindingModel model);
|
||||
bool DeliveryOrder(OrderBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
using ComputerShopContracts.BindingModels;
|
||||
using ComputerShopContracts.SearchModels;
|
||||
using ComputerShopContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopContracts.BusinessLogicContracts
|
||||
{
|
||||
//!!!ПРОВЕРИТЬ, ЧТО НЕ НУЖНЫ ДРУГИЕ МЕТОДЫ
|
||||
public interface IRequestLogic
|
||||
{
|
||||
List<RequestViewModel>? ReadList(RequestSearchModel? model);
|
||||
RequestViewModel? ReadElement(RequestSearchModel model);
|
||||
bool Create(RequestBindingModel model);
|
||||
bool Update(RequestBindingModel model);
|
||||
bool Delete(RequestBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
using ComputerShopContracts.BindingModels;
|
||||
using ComputerShopContracts.SearchModels;
|
||||
using ComputerShopContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopContracts.BusinessLogicContracts
|
||||
{
|
||||
//!!!ПРОВЕРИТЬ, ЧТО НЕ НУЖНЫ ДРУГИЕ МЕТОДЫ
|
||||
public interface IShipmentLogic
|
||||
{
|
||||
List<ShipmentViewModel>? ReadList(ShipmentSearchModel? model);
|
||||
ShipmentViewModel? ReadElement(ShipmentSearchModel model);
|
||||
bool Create(ShipmentBindingModel model);
|
||||
bool Update(ShipmentBindingModel model);
|
||||
bool Delete(ShipmentBindingModel model);
|
||||
}
|
||||
}
|
20
ComputerShopContracts/BusinessLogicContracts/IUserLogic.cs
Normal file
20
ComputerShopContracts/BusinessLogicContracts/IUserLogic.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using ComputerShopContracts.BindingModels;
|
||||
using ComputerShopContracts.SearchModels;
|
||||
using ComputerShopContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopContracts.BusinessLogicContracts
|
||||
{
|
||||
public interface IUserLogic
|
||||
{
|
||||
List<UserViewModel>? ReadList(UserSearchModel? model);
|
||||
UserViewModel? ReadElement(UserSearchModel model);
|
||||
bool Create(UserBindingModel model);
|
||||
bool Update(UserBindingModel model);
|
||||
bool Delete(UserBindingModel model);
|
||||
}
|
||||
}
|
@ -6,4 +6,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ComputerShopDataModels\ComputerShopDataModels.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
24
ComputerShopContracts/SearchModels/OrderSearchModel.cs
Normal file
24
ComputerShopContracts/SearchModels/OrderSearchModel.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using ComputerShopDataModels.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopContracts.SearchModels
|
||||
{
|
||||
public class OrderSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public int? UserId { get; set; }
|
||||
|
||||
//!!!МБ НАДО ДОБАВИТЬ ПОИСК ПО ЗАЯВКАМ/ПАРТИЯМ ТОВАРОВ
|
||||
|
||||
public DateTime? DateFrom { get; set; }
|
||||
public DateTime? DateTo { get; set; }
|
||||
|
||||
public OrderStatus? Status { get; set; }
|
||||
|
||||
public double? Sum { get; set; }
|
||||
}
|
||||
}
|
24
ComputerShopContracts/SearchModels/RequestSearchModel.cs
Normal file
24
ComputerShopContracts/SearchModels/RequestSearchModel.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopContracts.SearchModels
|
||||
{
|
||||
public class RequestSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public int? UserId { get; set; }
|
||||
|
||||
//!!!ДОБАВИТЬ ПОИСК ПО СБОРКЕ (СУЩНОСТИ ОЛЕГА)
|
||||
|
||||
public DateTime? DateFrom { get; set; }
|
||||
public DateTime? DateTo { get; set; }
|
||||
|
||||
public string? ClientFIO { get; set; }
|
||||
|
||||
|
||||
//!!!МБ ДОБАВИТЬ ПОИСК ПО СТАТУСУ (ЕСЛИ ОСТАНЕТСЯ)
|
||||
}
|
||||
}
|
17
ComputerShopContracts/SearchModels/ShipmentSearchModel.cs
Normal file
17
ComputerShopContracts/SearchModels/ShipmentSearchModel.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopContracts.SearchModels
|
||||
{
|
||||
public class ShipmentSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public int? UserId { get; set; }
|
||||
public string? ProviderName { get; set; }
|
||||
public DateTime? DateFrom { get; set; }
|
||||
public DateTime? DateTo { get; set; }
|
||||
}
|
||||
}
|
18
ComputerShopContracts/SearchModels/UserSearchModel.cs
Normal file
18
ComputerShopContracts/SearchModels/UserSearchModel.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopContracts.SearchModels
|
||||
{
|
||||
public class UserSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? Login { get; set; }
|
||||
|
||||
//!!!ПОИСК ПО ПАРОЛЮ НЕ СТАЛ ДОБАВЛЯТЬ, ИБО СТРАННО
|
||||
|
||||
public string? Email { get; set; }
|
||||
}
|
||||
}
|
21
ComputerShopContracts/StorageContracts/IOrderStorage.cs
Normal file
21
ComputerShopContracts/StorageContracts/IOrderStorage.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using ComputerShopContracts.BindingModels;
|
||||
using ComputerShopContracts.SearchModels;
|
||||
using ComputerShopContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopContracts.StorageContracts
|
||||
{
|
||||
public interface IOrderStorage
|
||||
{
|
||||
List<OrderViewModel> GetFullList();
|
||||
List<OrderViewModel> GetFilteredList(OrderSearchModel model);
|
||||
OrderViewModel? GetElement(OrderSearchModel model);
|
||||
OrderViewModel? Insert(OrderBindingModel model);
|
||||
OrderViewModel? Update(OrderBindingModel model);
|
||||
OrderViewModel? Delete(OrderBindingModel model);
|
||||
}
|
||||
}
|
21
ComputerShopContracts/StorageContracts/IRequestStorage.cs
Normal file
21
ComputerShopContracts/StorageContracts/IRequestStorage.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using ComputerShopContracts.BindingModels;
|
||||
using ComputerShopContracts.SearchModels;
|
||||
using ComputerShopContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopContracts.StorageContracts
|
||||
{
|
||||
public interface IRequestStorage
|
||||
{
|
||||
List<RequestViewModel> GetFullList();
|
||||
List<RequestViewModel> GetFilteredList(RequestSearchModel model);
|
||||
RequestViewModel? GetElement(RequestSearchModel model);
|
||||
RequestViewModel? Insert(RequestBindingModel model);
|
||||
RequestViewModel? Update(RequestBindingModel model);
|
||||
RequestViewModel? Delete(RequestBindingModel model);
|
||||
}
|
||||
}
|
21
ComputerShopContracts/StorageContracts/IShipmentStorage.cs
Normal file
21
ComputerShopContracts/StorageContracts/IShipmentStorage.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using ComputerShopContracts.BindingModels;
|
||||
using ComputerShopContracts.SearchModels;
|
||||
using ComputerShopContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopContracts.StorageContracts
|
||||
{
|
||||
public interface IShipmentStorage
|
||||
{
|
||||
List<ShipmentViewModel> GetFullList();
|
||||
List<ShipmentViewModel> GetFilteredList(ShipmentSearchModel model);
|
||||
ShipmentViewModel? GetElement(ShipmentSearchModel model);
|
||||
ShipmentViewModel? Insert(ShipmentBindingModel model);
|
||||
ShipmentViewModel? Update(ShipmentBindingModel model);
|
||||
ShipmentViewModel? Delete(ShipmentBindingModel model);
|
||||
}
|
||||
}
|
21
ComputerShopContracts/StorageContracts/IUserStorage.cs
Normal file
21
ComputerShopContracts/StorageContracts/IUserStorage.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using ComputerShopContracts.BindingModels;
|
||||
using ComputerShopContracts.SearchModels;
|
||||
using ComputerShopContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopContracts.StorageContracts
|
||||
{
|
||||
public interface IUserStorage
|
||||
{
|
||||
List<UserViewModel> GetFullList();
|
||||
List<UserViewModel> GetFilteredList(UserSearchModel model);
|
||||
UserViewModel? GetElement(UserSearchModel model);
|
||||
UserViewModel? Insert(UserBindingModel model);
|
||||
UserViewModel? Update(UserBindingModel model);
|
||||
UserViewModel? Delete(UserBindingModel model);
|
||||
}
|
||||
}
|
36
ComputerShopContracts/ViewModels/OrderViewModel.cs
Normal file
36
ComputerShopContracts/ViewModels/OrderViewModel.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using ComputerShopDataModels.Enums;
|
||||
using ComputerShopDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopContracts.ViewModels
|
||||
{
|
||||
public class OrderViewModel
|
||||
{
|
||||
[DisplayName("Номер")]
|
||||
public int Id { get; set; }
|
||||
|
||||
//!!!ТУТ МБ НЕ НУЖЕН DisplayName
|
||||
[DisplayName("Номер пользователя")]
|
||||
public int UserId { get; set; }
|
||||
|
||||
//!!!ТУТ МБ НАДО DisplayName (НО ВЯРД ЛИ)
|
||||
public Dictionary<int, IRequestModel> OrderRequests { get; set; } = new();
|
||||
public Dictionary<int, IShipmentModel> OrderShipments { get; set; } = new();
|
||||
|
||||
//!!!МБ НЕ НУЖНО DateTime.Now
|
||||
[DisplayName("Дата оформления")]
|
||||
public DateTime DateMake { get; set; } = DateTime.Now;
|
||||
|
||||
[DisplayName("Статус")]
|
||||
public OrderStatus Status { get; set; } = OrderStatus.Неизвестен;
|
||||
|
||||
[DisplayName("Стоимость")]
|
||||
public double Sum { get; set; }
|
||||
|
||||
}
|
||||
}
|
34
ComputerShopContracts/ViewModels/RequestViewModel.cs
Normal file
34
ComputerShopContracts/ViewModels/RequestViewModel.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopContracts.ViewModels
|
||||
{
|
||||
public class RequestViewModel
|
||||
{
|
||||
[DisplayName("Номер")]
|
||||
public int Id { get; set; }
|
||||
|
||||
//!!!ТУТ МБ НЕ НУЖЕН DisplayName
|
||||
[DisplayName("Номер пользователя")]
|
||||
public int UserId { get; set; }
|
||||
|
||||
//!!!МБ ДОБАВИТЬ НИК ПОЛЬЗОВАТЕЛЯ, СОЗДАВШЕГО ЗАЯВКУ
|
||||
|
||||
//!!!МБ ДОБАВИТЬ ID СБОРКИ
|
||||
|
||||
//!!!МБ НЕ НУЖНО DateTime.Now
|
||||
[DisplayName("Дата оформления")]
|
||||
public DateTime DateMake { get; set; } = DateTime.Now;
|
||||
|
||||
//!!!МБ НЕ НУЖЕН string.Empty
|
||||
[DisplayName("ФИО клиента")]
|
||||
public string ClientFIO { get; set; } = string.Empty;
|
||||
|
||||
|
||||
//!!!ЧТО-ТО СДЕЛАТЬ СО СТАТУСОМ (МБ УБРАТЬ ИЗ ER)
|
||||
}
|
||||
}
|
31
ComputerShopContracts/ViewModels/ShipmentViewModel.cs
Normal file
31
ComputerShopContracts/ViewModels/ShipmentViewModel.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopContracts.ViewModels
|
||||
{
|
||||
public class ShipmentViewModel
|
||||
{
|
||||
//!!!ТУТ МБ НЕ НУЖЕН DisplayName
|
||||
[DisplayName("Номер")]
|
||||
public int Id { get; set; }
|
||||
|
||||
//!!!ТУТ МБ НЕ НУЖЕН DisplayName
|
||||
[DisplayName("Номер пользователя")]
|
||||
public int UserId { get; set; }
|
||||
|
||||
//!!!МБ ДОБАВИТЬ НИК ПОЛЬЗОВАТЕЛЯ, СОЗДАВШЕГО ПАРТИЮ
|
||||
|
||||
//!!!МБ НЕ НУЖЕН string.Empty
|
||||
[DisplayName("Поставщик")]
|
||||
public string ProviderName { get; set; } = string.Empty;
|
||||
|
||||
//!!!МБ НЕ НУЖНО DateTime.Now
|
||||
[DisplayName("Дата поставки")]
|
||||
public DateTime DateShipment { get; set; } = DateTime.Now;
|
||||
|
||||
}
|
||||
}
|
25
ComputerShopContracts/ViewModels/UserViewModel.cs
Normal file
25
ComputerShopContracts/ViewModels/UserViewModel.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopContracts.ViewModels
|
||||
{
|
||||
public class UserViewModel
|
||||
{
|
||||
//!!!МБ ТУТ НАДО DisplayName (НО ВРЯД ЛИ)
|
||||
public int Id { get; set; }
|
||||
|
||||
//!!!МБ ТУТ НЕ НУЖНЫ string.Empty
|
||||
[DisplayName("Логин")]
|
||||
public string Login { get; set; } = string.Empty;
|
||||
|
||||
[DisplayName("Пароль")]
|
||||
public string Password { get; set; } = string.Empty;
|
||||
|
||||
[DisplayName("Почта")]
|
||||
public string Email { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
17
ComputerShopDataModels/Enums/OrderStatus.cs
Normal file
17
ComputerShopDataModels/Enums/OrderStatus.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopDataModels.Enums
|
||||
{
|
||||
public enum OrderStatus
|
||||
{
|
||||
Неизвестен = -1,
|
||||
Принят = 0,
|
||||
Выполняется = 1,
|
||||
Готов = 2,
|
||||
Выдан = 3
|
||||
}
|
||||
}
|
50
ComputerShopDataModels/Models/IOrderModel.cs
Normal file
50
ComputerShopDataModels/Models/IOrderModel.cs
Normal file
@ -0,0 +1,50 @@
|
||||
using ComputerShopDataModels.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopDataModels.Models
|
||||
{
|
||||
public interface IOrderModel : IId
|
||||
{
|
||||
//ID пользователя, который создал заказ
|
||||
int UserId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Заявки в заказе (может не быть)
|
||||
/// </summary>
|
||||
Dictionary<int, IRequestModel>? OrderRequests { get; }
|
||||
|
||||
//!!!УДАЛИТЬ
|
||||
//ID заявки (может быть пустым)
|
||||
//int? RequestId { get; }
|
||||
|
||||
//!!!УДАЛИТЬ
|
||||
//ID партии товаров (может быть пустым)
|
||||
//int? ShipmentId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Партии товаров в заказе (может не быть)
|
||||
/// </summary>
|
||||
Dictionary<int, IShipmentModel>? OrderShipments { get; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Дата оформления заказа
|
||||
/// </summary>
|
||||
DateTime DateCreate { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Статус заказа
|
||||
/// </summary>
|
||||
OrderStatus Status { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Стоимость заказа
|
||||
/// </summary>
|
||||
double Sum { get; }
|
||||
}
|
||||
}
|
39
ComputerShopDataModels/Models/IRequestModel.cs
Normal file
39
ComputerShopDataModels/Models/IRequestModel.cs
Normal file
@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopDataModels.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Заявка
|
||||
/// </summary>
|
||||
public interface IRequestModel : IId
|
||||
{
|
||||
//ID пользователя, создавшего заявку
|
||||
int UserId { get; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//!!!ДОБАВИТЬ ССЫЛКУ НА СБОРКУ ИЗ ЧАСТИ ОЛЕГА
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Дата создания заявки
|
||||
/// </summary>
|
||||
DateTime DateMake { get; }
|
||||
|
||||
/// <summary>
|
||||
/// ФИО клиента, для которого создана заявка
|
||||
/// </summary>
|
||||
string ClientFIO { get; }
|
||||
|
||||
|
||||
//!!!ЧТО-ТО СДЕЛАТЬ СО СТАТУСОМ (МБ УБРАТЬ ИЗ ER)
|
||||
}
|
||||
}
|
27
ComputerShopDataModels/Models/IShipmentModel.cs
Normal file
27
ComputerShopDataModels/Models/IShipmentModel.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopDataModels.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Поставка товара
|
||||
/// </summary>
|
||||
public interface IShipmentModel : IId
|
||||
{
|
||||
//ID пользователя, создавшего поставку
|
||||
int UserId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Название поставщика
|
||||
/// </summary>
|
||||
string ProviderName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Дата поставки
|
||||
/// </summary>
|
||||
DateTime DateShipment { get; }
|
||||
}
|
||||
}
|
15
ComputerShopDataModels/Models/IUserModel.cs
Normal file
15
ComputerShopDataModels/Models/IUserModel.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComputerShopDataModels.Models
|
||||
{
|
||||
public interface IUserModel : IId
|
||||
{
|
||||
string Login { get; }
|
||||
string Password { get; }
|
||||
string Email { get; }
|
||||
}
|
||||
}
|
@ -15,4 +15,9 @@
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.11" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ComputerShopContracts\ComputerShopContracts.csproj" />
|
||||
<ProjectReference Include="..\ComputerShopDataModels\ComputerShopDataModels.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
Loading…
x
Reference in New Issue
Block a user