Compare commits
4 Commits
167a915d9f
...
049582dbc4
Author | SHA1 | Date | |
---|---|---|---|
049582dbc4 | |||
92d6b4ed4d | |||
8a003df724 | |||
1f59b3f931 |
19
ComputerShopContracts/BindingModels/AssemblyBindingModel.cs
Normal file
19
ComputerShopContracts/BindingModels/AssemblyBindingModel.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
using ComputerShopDataModels.Models;
|
||||||
|
|
||||||
|
namespace ComputerShopContracts.BindingModels
|
||||||
|
{
|
||||||
|
public class AssemblyBindingModel : IAssemblyModel
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public int UserId { get; set; }
|
||||||
|
|
||||||
|
public string AssemblyName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public double Cost { get; set; }
|
||||||
|
|
||||||
|
public string Category { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public Dictionary<int, (IComponentModel, int)> AssemblyComponents { get; set; } = new();
|
||||||
|
}
|
||||||
|
}
|
15
ComputerShopContracts/BindingModels/ComponentBindingModel.cs
Normal file
15
ComputerShopContracts/BindingModels/ComponentBindingModel.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
using ComputerShopDataModels.Models;
|
||||||
|
|
||||||
|
namespace ComputerShopContracts.BindingModels
|
||||||
|
{
|
||||||
|
public class ComponentBindingModel : IComponentModel
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public int UserId { get; set; }
|
||||||
|
|
||||||
|
public string ComponentName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public double Cost { get; set; }
|
||||||
|
}
|
||||||
|
}
|
21
ComputerShopContracts/BindingModels/ProductBindingModel.cs
Normal file
21
ComputerShopContracts/BindingModels/ProductBindingModel.cs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
using ComputerShopDataModels.Models;
|
||||||
|
|
||||||
|
namespace ComputerShopContracts.BindingModels
|
||||||
|
{
|
||||||
|
public class ProductBindingModel : IProductModel
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public int UserId { get; set; }
|
||||||
|
|
||||||
|
public string ProductName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public double Cost { get; set; }
|
||||||
|
|
||||||
|
public int Warranty { get; set; }
|
||||||
|
|
||||||
|
public Dictionary<int, (IComponentModel, int)> ProductComponents { get; set; } = new();
|
||||||
|
|
||||||
|
public int? ShipmentId { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -13,8 +13,7 @@ namespace ComputerShopContracts.BindingModels
|
|||||||
|
|
||||||
public int UserId { get; set; }
|
public int UserId { get; set; }
|
||||||
|
|
||||||
//!!!ДОБАВИТЬ ССЫЛКУ НА СБОРКУ
|
public int AssemblyId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public DateTime DateMake { get; set; } = DateTime.Now;
|
public DateTime DateMake { get; set; } = DateTime.Now;
|
||||||
|
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
using ComputerShopContracts.BindingModels;
|
||||||
|
using ComputerShopContracts.SearchModels;
|
||||||
|
using ComputerShopContracts.ViewModels;
|
||||||
|
|
||||||
|
namespace ComputerShopContracts.BusinessLogicContracts
|
||||||
|
{
|
||||||
|
public interface IAssemblyLogic
|
||||||
|
{
|
||||||
|
List<AssemblyViewModel>? ReadList(AssemblySearchModel? Model);
|
||||||
|
|
||||||
|
AssemblyViewModel? ReadElement(AssemblySearchModel Model);
|
||||||
|
|
||||||
|
bool Create(AssemblyBindingModel Model);
|
||||||
|
|
||||||
|
bool Update(AssemblyBindingModel Model);
|
||||||
|
|
||||||
|
bool Delete(AssemblyBindingModel Model);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
using ComputerShopContracts.BindingModels;
|
||||||
|
using ComputerShopContracts.SearchModels;
|
||||||
|
using ComputerShopContracts.ViewModels;
|
||||||
|
|
||||||
|
namespace ComputerShopContracts.BusinessLogicContracts
|
||||||
|
{
|
||||||
|
public interface IComponentLogic
|
||||||
|
{
|
||||||
|
List<ComponentViewModel>? ReadList(ComponentSearchModel? Model);
|
||||||
|
|
||||||
|
ComponentViewModel? ReadElement(ComponentSearchModel Model);
|
||||||
|
|
||||||
|
bool Create(ComponentBindingModel Model);
|
||||||
|
|
||||||
|
bool Update(ComponentBindingModel Model);
|
||||||
|
|
||||||
|
bool Delete(ComponentBindingModel Model);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
using ComputerShopContracts.BindingModels;
|
||||||
|
using ComputerShopContracts.SearchModels;
|
||||||
|
using ComputerShopContracts.ViewModels;
|
||||||
|
|
||||||
|
namespace ComputerShopContracts.BusinessLogicContracts
|
||||||
|
{
|
||||||
|
public interface IProductLogic
|
||||||
|
{
|
||||||
|
List<ProductViewModel>? ReadList(ProductSearchModel? Model);
|
||||||
|
|
||||||
|
ProductViewModel? ReadElement(ProductSearchModel Model);
|
||||||
|
|
||||||
|
bool Create(ProductBindingModel Model);
|
||||||
|
|
||||||
|
bool Update(ProductBindingModel Model);
|
||||||
|
|
||||||
|
bool Delete(ProductBindingModel Model);
|
||||||
|
}
|
||||||
|
}
|
11
ComputerShopContracts/SearchModels/AssemblySearchModel.cs
Normal file
11
ComputerShopContracts/SearchModels/AssemblySearchModel.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
namespace ComputerShopContracts.SearchModels
|
||||||
|
{
|
||||||
|
public class AssemblySearchModel
|
||||||
|
{
|
||||||
|
public int? Id { get; set; }
|
||||||
|
|
||||||
|
public int? UserId { get; set; }
|
||||||
|
|
||||||
|
public string? Category { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
namespace ComputerShopContracts.SearchModels
|
||||||
|
{
|
||||||
|
public class ComponentSearchModel
|
||||||
|
{
|
||||||
|
public int? Id { get; set; }
|
||||||
|
|
||||||
|
public int? UserId { get; set; }
|
||||||
|
}
|
||||||
|
}
|
11
ComputerShopContracts/SearchModels/ProductSearchModel.cs
Normal file
11
ComputerShopContracts/SearchModels/ProductSearchModel.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
namespace ComputerShopContracts.SearchModels
|
||||||
|
{
|
||||||
|
public class ProductSearchModel
|
||||||
|
{
|
||||||
|
public int? Id { get; set; }
|
||||||
|
|
||||||
|
public int? UserId { get; set; }
|
||||||
|
|
||||||
|
public int? ShipmentId { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -11,7 +11,8 @@ namespace ComputerShopContracts.SearchModels
|
|||||||
public int? Id { get; set; }
|
public int? Id { get; set; }
|
||||||
public int? UserId { get; set; }
|
public int? UserId { get; set; }
|
||||||
|
|
||||||
//!!!ДОБАВИТЬ ПОИСК ПО СБОРКЕ (СУЩНОСТИ ОЛЕГА)
|
//поиск по сборкам
|
||||||
|
public int? AssemblyId { get; set; }
|
||||||
|
|
||||||
//!!!мб надо добавить поиск по заказам
|
//!!!мб надо добавить поиск по заказам
|
||||||
|
|
||||||
|
21
ComputerShopContracts/StorageContracts/IAssemblyStorage.cs
Normal file
21
ComputerShopContracts/StorageContracts/IAssemblyStorage.cs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
using ComputerShopContracts.BindingModels;
|
||||||
|
using ComputerShopContracts.SearchModels;
|
||||||
|
using ComputerShopContracts.ViewModels;
|
||||||
|
|
||||||
|
namespace ComputerShopContracts.StorageContracts
|
||||||
|
{
|
||||||
|
public interface IAssemblyStorage
|
||||||
|
{
|
||||||
|
List<AssemblyViewModel> GetFullList();
|
||||||
|
|
||||||
|
List<AssemblyViewModel> GetFilteredList(AssemblySearchModel Model);
|
||||||
|
|
||||||
|
AssemblyViewModel? GetElement(AssemblySearchModel Model);
|
||||||
|
|
||||||
|
AssemblyViewModel? Insert(AssemblyBindingModel Model);
|
||||||
|
|
||||||
|
AssemblyViewModel? Update(AssemblyBindingModel Model);
|
||||||
|
|
||||||
|
AssemblyViewModel? Delete(AssemblyBindingModel Model);
|
||||||
|
}
|
||||||
|
}
|
21
ComputerShopContracts/StorageContracts/IComponentStorage.cs
Normal file
21
ComputerShopContracts/StorageContracts/IComponentStorage.cs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
using ComputerShopContracts.BindingModels;
|
||||||
|
using ComputerShopContracts.SearchModels;
|
||||||
|
using ComputerShopContracts.ViewModels;
|
||||||
|
|
||||||
|
namespace ComputerShopContracts.StorageContracts
|
||||||
|
{
|
||||||
|
public interface IComponentStorage
|
||||||
|
{
|
||||||
|
List<ComponentViewModel> GetFullList();
|
||||||
|
|
||||||
|
List<ComponentViewModel> GetFilteredList(ComponentSearchModel Model);
|
||||||
|
|
||||||
|
ComponentViewModel? GetElement(ComponentSearchModel Model);
|
||||||
|
|
||||||
|
ComponentViewModel? Insert(ComponentBindingModel Model);
|
||||||
|
|
||||||
|
ComponentViewModel? Update(ComponentBindingModel Model);
|
||||||
|
|
||||||
|
ComponentViewModel? Delete(ComponentBindingModel Model);
|
||||||
|
}
|
||||||
|
}
|
21
ComputerShopContracts/StorageContracts/IProductStorage.cs
Normal file
21
ComputerShopContracts/StorageContracts/IProductStorage.cs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
using ComputerShopContracts.BindingModels;
|
||||||
|
using ComputerShopContracts.SearchModels;
|
||||||
|
using ComputerShopContracts.ViewModels;
|
||||||
|
|
||||||
|
namespace ComputerShopContracts.StorageContracts
|
||||||
|
{
|
||||||
|
public interface IProductStorage
|
||||||
|
{
|
||||||
|
List<ProductViewModel> GetFullList();
|
||||||
|
|
||||||
|
List<ProductViewModel> GetFilteredList(ProductSearchModel Model);
|
||||||
|
|
||||||
|
ProductViewModel? GetElement(ProductSearchModel Model);
|
||||||
|
|
||||||
|
ProductViewModel? Insert(ProductBindingModel Model);
|
||||||
|
|
||||||
|
ProductViewModel? Update(ProductBindingModel Model);
|
||||||
|
|
||||||
|
ProductViewModel? Delete(ProductBindingModel Model);
|
||||||
|
}
|
||||||
|
}
|
23
ComputerShopContracts/ViewModels/AssemblyViewModel.cs
Normal file
23
ComputerShopContracts/ViewModels/AssemblyViewModel.cs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
using ComputerShopDataModels.Models;
|
||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
|
namespace ComputerShopContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class AssemblyViewModel : IAssemblyModel
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public int UserId { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("Название сборки")]
|
||||||
|
public string AssemblyName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[DisplayName("Стоимость")]
|
||||||
|
public double Cost { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("Категория")]
|
||||||
|
public string Category { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public Dictionary<int, (IComponentModel, int)> AssemblyComponents { get; set; } = new();
|
||||||
|
}
|
||||||
|
}
|
18
ComputerShopContracts/ViewModels/ComponentViewModel.cs
Normal file
18
ComputerShopContracts/ViewModels/ComponentViewModel.cs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
using ComputerShopDataModels.Models;
|
||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
|
namespace ComputerShopContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class ComponentViewModel : IComponentModel
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public int UserId { get; }
|
||||||
|
|
||||||
|
[DisplayName("Название комплектующей")]
|
||||||
|
public string ComponentName { get; } = string.Empty;
|
||||||
|
|
||||||
|
[DisplayName("Стоимость")]
|
||||||
|
public double Cost { get; }
|
||||||
|
}
|
||||||
|
}
|
28
ComputerShopContracts/ViewModels/ProductViewModel.cs
Normal file
28
ComputerShopContracts/ViewModels/ProductViewModel.cs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
using ComputerShopDataModels.Models;
|
||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
|
namespace ComputerShopContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class ProductViewModel : IProductModel
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public int UserId { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("Название товара")]
|
||||||
|
public string ProductName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[DisplayName("Стоимость")]
|
||||||
|
public double Cost { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("Гарантия (мес.)")]
|
||||||
|
public int Warranty { get; set; }
|
||||||
|
|
||||||
|
public Dictionary<int, (IComponentModel, int)> ProductComponents { get; set; } = new();
|
||||||
|
|
||||||
|
public int? ShipmentId { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("Поставщик")]
|
||||||
|
public string ProviderName { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
}
|
@ -19,7 +19,7 @@ namespace ComputerShopContracts.ViewModels
|
|||||||
|
|
||||||
//!!!МБ ДОБАВИТЬ НИК ПОЛЬЗОВАТЕЛЯ, СОЗДАВШЕГО ЗАЯВКУ
|
//!!!МБ ДОБАВИТЬ НИК ПОЛЬЗОВАТЕЛЯ, СОЗДАВШЕГО ЗАЯВКУ
|
||||||
|
|
||||||
//!!!МБ ДОБАВИТЬ ID СБОРКИ
|
public int AssemblyId { get; set; }
|
||||||
|
|
||||||
public Dictionary<int, IOrderModel> RequestOrders { get; set; } = new();
|
public Dictionary<int, IOrderModel> RequestOrders { get; set; } = new();
|
||||||
|
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace ComputerShopDataModels.Enums
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace ComputerShopDataModels.Enums
|
|
||||||
{
|
{
|
||||||
public enum OrderStatus
|
public enum OrderStatus
|
||||||
{
|
{
|
||||||
|
33
ComputerShopDataModels/Models/IAssemblyModel.cs
Normal file
33
ComputerShopDataModels/Models/IAssemblyModel.cs
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
namespace ComputerShopDataModels.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Сборка
|
||||||
|
/// </summary>
|
||||||
|
public interface IAssemblyModel : IId
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Пользователь, который создал сборку
|
||||||
|
/// </summary>
|
||||||
|
int UserId { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Название сборки
|
||||||
|
/// </summary>
|
||||||
|
string AssemblyName { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Стоимость
|
||||||
|
/// </summary>
|
||||||
|
double Cost { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Категория
|
||||||
|
/// </summary>
|
||||||
|
string Category { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Список комплектующих
|
||||||
|
/// </summary>
|
||||||
|
Dictionary<int, (IComponentModel, int)> AssemblyComponents { get; }
|
||||||
|
}
|
||||||
|
}
|
23
ComputerShopDataModels/Models/IComponentModel.cs
Normal file
23
ComputerShopDataModels/Models/IComponentModel.cs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
namespace ComputerShopDataModels.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Комплектующая
|
||||||
|
/// </summary>
|
||||||
|
public interface IComponentModel : IId
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Пользователь, который добавил комплектующую
|
||||||
|
/// </summary>
|
||||||
|
int UserId { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Название комплектующей
|
||||||
|
/// </summary>
|
||||||
|
string ComponentName { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Цена комплектующей
|
||||||
|
/// </summary>
|
||||||
|
double Cost { get; }
|
||||||
|
}
|
||||||
|
}
|
38
ComputerShopDataModels/Models/IProductModel.cs
Normal file
38
ComputerShopDataModels/Models/IProductModel.cs
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
namespace ComputerShopDataModels.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Товар
|
||||||
|
/// </summary>
|
||||||
|
public interface IProductModel : IId
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Пользователь, который добавил товар
|
||||||
|
/// </summary>
|
||||||
|
int UserId { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Название товара
|
||||||
|
/// </summary>
|
||||||
|
string ProductName { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Стоимость товара
|
||||||
|
/// </summary>
|
||||||
|
double Cost { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Гарантия
|
||||||
|
/// </summary>
|
||||||
|
int Warranty { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Список комплектующих
|
||||||
|
/// </summary>
|
||||||
|
Dictionary<int, (IComponentModel, int)> ProductComponents { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Привязка товара к партии товаров
|
||||||
|
/// </summary>
|
||||||
|
int? ShipmentId { get; }
|
||||||
|
}
|
||||||
|
}
|
@ -14,12 +14,10 @@ namespace ComputerShopDataModels.Models
|
|||||||
//ID пользователя, создавшего заявку
|
//ID пользователя, создавшего заявку
|
||||||
int UserId { get; }
|
int UserId { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ID сборки
|
||||||
|
/// </summary>
|
||||||
|
int AssemblyId { get; }
|
||||||
//!!!ДОБАВИТЬ ССЫЛКУ НА СБОРКУ ИЗ ЧАСТИ ОЛЕГА
|
|
||||||
|
|
||||||
|
|
||||||
Dictionary<int, IOrderModel> RequestOrders { get; }
|
Dictionary<int, IOrderModel> RequestOrders { get; }
|
||||||
|
|
||||||
|
@ -6,6 +6,12 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Remove="Implements\**" />
|
||||||
|
<EmbeddedResource Remove="Implements\**" />
|
||||||
|
<None Remove="Implements\**" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.18" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.18" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.18">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.18">
|
||||||
@ -20,8 +26,4 @@
|
|||||||
<ProjectReference Include="..\ComputerShopDataModels\ComputerShopDataModels.csproj" />
|
<ProjectReference Include="..\ComputerShopDataModels\ComputerShopDataModels.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Implements\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
Loading…
Reference in New Issue
Block a user