Contracts
This commit is contained in:
parent
fb5a98c8ed
commit
dfbe5539dd
@ -7,6 +7,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoWorkshop", "AutoWorksho
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoWorkshopDataModels", "AutoWorkshopDataModels\AutoWorkshopDataModels.csproj", "{D52094D2-A57E-4BAD-B049-3B64065463DA}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoWorkshopContracts", "AutoWorkshopContracts\AutoWorkshopContracts.csproj", "{93CF1C25-57B5-4E95-A394-E01AE440E138}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@ -21,6 +23,10 @@ Global
|
||||
{D52094D2-A57E-4BAD-B049-3B64065463DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D52094D2-A57E-4BAD-B049-3B64065463DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D52094D2-A57E-4BAD-B049-3B64065463DA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{93CF1C25-57B5-4E95-A394-E01AE440E138}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{93CF1C25-57B5-4E95-A394-E01AE440E138}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{93CF1C25-57B5-4E95-A394-E01AE440E138}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{93CF1C25-57B5-4E95-A394-E01AE440E138}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
13
AutoWorkshopContracts/AutoWorkshopContracts.csproj
Normal file
13
AutoWorkshopContracts/AutoWorkshopContracts.csproj
Normal file
@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AutoWorkshopDataModels\AutoWorkshopDataModels.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
11
AutoWorkshopContracts/BindingModels/ComponentBindingModel.cs
Normal file
11
AutoWorkshopContracts/BindingModels/ComponentBindingModel.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using AutoWorkshopDataModels.Models;
|
||||
|
||||
namespace AutoWorkshopContracts.BindingModels
|
||||
{
|
||||
public class ComponentBindingModel : IComponentModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string ComponentName { get; set; } = string.Empty;
|
||||
public double Cost { get; set; }
|
||||
}
|
||||
}
|
16
AutoWorkshopContracts/BindingModels/OrderBindingModel.cs
Normal file
16
AutoWorkshopContracts/BindingModels/OrderBindingModel.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using AutoWorkshopDataModels.Models;
|
||||
using AutoWorkshopDataModels.Enums;
|
||||
|
||||
namespace AutoWorkshopContracts.BindingModels
|
||||
{
|
||||
public class OrderBindingModel : IOrderModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int ProductId { get; set; }
|
||||
public int Count { get; set; }
|
||||
public double Sum { get; set; }
|
||||
public OrderStatus Status { get; set; } = OrderStatus.Undefined;
|
||||
public DateTime DateCreate { get; set; } = DateTime.Now;
|
||||
public DateTime? DateImplement { get; set; }
|
||||
}
|
||||
}
|
16
AutoWorkshopContracts/BindingModels/ProductBindingModel.cs
Normal file
16
AutoWorkshopContracts/BindingModels/ProductBindingModel.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using AutoWorkshopDataModels.Models;
|
||||
|
||||
namespace AutoWorkshopContracts.BindingModels
|
||||
{
|
||||
public class RepairBindingModel : IRepairModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string RepairName { get; set; } = string.Empty;
|
||||
public double Price { get; set; }
|
||||
public Dictionary<int, (IComponentModel, int)> RepairComponents
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = new();
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
using AutoWorkshopContracts.BindingModels;
|
||||
using AutoWorkshopContracts.SearchModels;
|
||||
using AutoWorkshopContracts.ViewModels;
|
||||
|
||||
namespace AutoWorkshopContracts.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);
|
||||
}
|
||||
|
||||
}
|
15
AutoWorkshopContracts/BusinessLogicContracts/IOrderLogic.cs
Normal file
15
AutoWorkshopContracts/BusinessLogicContracts/IOrderLogic.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using AutoWorkshopContracts.BindingModels;
|
||||
using AutoWorkshopContracts.SearchModels;
|
||||
using AutoWorkshopContracts.ViewModels;
|
||||
|
||||
namespace AutoWorkshopContracts.BusinessLogicContracts
|
||||
{
|
||||
public interface IOrderLogic
|
||||
{
|
||||
List<OrderViewModel>? ReadList(OrderSearchModel? model);
|
||||
bool CreateOrder(OrderBindingModel model);
|
||||
bool TakeOrderInWork(OrderBindingModel model);
|
||||
bool FinishOrder(OrderBindingModel model);
|
||||
bool DeliveryOrder(OrderBindingModel model);
|
||||
}
|
||||
}
|
15
AutoWorkshopContracts/BusinessLogicContracts/IRepairLogic.cs
Normal file
15
AutoWorkshopContracts/BusinessLogicContracts/IRepairLogic.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using AutoWorkshopContracts.BindingModels;
|
||||
using AutoWorkshopContracts.SearchModels;
|
||||
using AutoWorkshopContracts.ViewModels;
|
||||
|
||||
namespace AutoWorkshopContracts.BusinessLogicContracts
|
||||
{
|
||||
public interface IRepairLogic
|
||||
{
|
||||
List<RepairViewModel>? ReadList(RepairSearchModel? model);
|
||||
RepairViewModel? ReadElement(RepairSearchModel model);
|
||||
bool Create(RepairBindingModel model);
|
||||
bool Update(RepairBindingModel model);
|
||||
bool Delete(RepairBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
namespace AutoWorkshopContracts.SearchModels
|
||||
{
|
||||
public class ComponentSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? ComponentName { get; set; }
|
||||
}
|
||||
}
|
7
AutoWorkshopContracts/SearchModels/OrderSearchModel.cs
Normal file
7
AutoWorkshopContracts/SearchModels/OrderSearchModel.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace AutoWorkshopContracts.SearchModels
|
||||
{
|
||||
public class OrderSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
}
|
||||
}
|
8
AutoWorkshopContracts/SearchModels/RepairSearchModel.cs
Normal file
8
AutoWorkshopContracts/SearchModels/RepairSearchModel.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace AutoWorkshopContracts.SearchModels
|
||||
{
|
||||
public class RepairSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? RepairName { get; set; }
|
||||
}
|
||||
}
|
17
AutoWorkshopContracts/StoragesContracts/IComponentStorage.cs
Normal file
17
AutoWorkshopContracts/StoragesContracts/IComponentStorage.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using AutoWorkshopContracts.BindingModels;
|
||||
using AutoWorkshopContracts.SearchModels;
|
||||
using AutoWorkshopContracts.ViewModels;
|
||||
|
||||
namespace AutoWorkshopContracts.StoragesContracts
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
16
AutoWorkshopContracts/StoragesContracts/IOrderStorage.cs
Normal file
16
AutoWorkshopContracts/StoragesContracts/IOrderStorage.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using AutoWorkshopContracts.BindingModels;
|
||||
using AutoWorkshopContracts.SearchModels;
|
||||
using AutoWorkshopContracts.ViewModels;
|
||||
|
||||
namespace AutoWorkshopContracts.StoragesContracts
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
15
AutoWorkshopContracts/StoragesContracts/IRepairStorage.cs
Normal file
15
AutoWorkshopContracts/StoragesContracts/IRepairStorage.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using AutoWorkshopContracts.SearchModels;
|
||||
using AutoWorkshopContracts.ViewModels;
|
||||
|
||||
namespace AutoWorkshopContracts.StoragesContracts
|
||||
{
|
||||
public interface IProductStorage
|
||||
{
|
||||
List<RepairViewModel> GetFullList();
|
||||
List<RepairViewModel> GetFilteredList(RepairSearchModel model);
|
||||
RepairViewModel? GetElement(RepairSearchModel model);
|
||||
RepairViewModel? Insert(RepairSearchModel model);
|
||||
RepairViewModel? Update(RepairSearchModel model);
|
||||
RepairViewModel? Delete(RepairSearchModel model);
|
||||
}
|
||||
}
|
16
AutoWorkshopContracts/ViewModels/ComponentViewModel.cs
Normal file
16
AutoWorkshopContracts/ViewModels/ComponentViewModel.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using AutoWorkshopDataModels.Models;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace AutoWorkshopContracts.ViewModels
|
||||
{
|
||||
public class ComponentViewModel : IComponentModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("Название компонента")]
|
||||
|
||||
public string ComponentName { get; set; } = string.Empty;
|
||||
[DisplayName("Цена")]
|
||||
|
||||
public double Cost { get; set; }
|
||||
}
|
||||
}
|
32
AutoWorkshopContracts/ViewModels/OrderViewModel.cs
Normal file
32
AutoWorkshopContracts/ViewModels/OrderViewModel.cs
Normal file
@ -0,0 +1,32 @@
|
||||
using AutoWorkshopDataModels.Enums;
|
||||
using AutoWorkshopDataModels.Models;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace AutoWorkshopContracts.ViewModels
|
||||
{
|
||||
public class OrderViewModel : IOrderModel
|
||||
{
|
||||
[DisplayName("Номер")]
|
||||
public int Id { get; set; }
|
||||
|
||||
public int ProductId { get; set; }
|
||||
|
||||
[DisplayName("Изделие")]
|
||||
public string ProductName { get; set; } = string.Empty;
|
||||
|
||||
[DisplayName("Количество")]
|
||||
public int Count { get; set; }
|
||||
|
||||
[DisplayName("Сумма")]
|
||||
public double Sum { get; set; }
|
||||
|
||||
[DisplayName("Статус")]
|
||||
public OrderStatus Status { get; set; } = OrderStatus.Undefined;
|
||||
|
||||
[DisplayName("Дата создания")]
|
||||
public DateTime DateCreate { get; set; } = DateTime.Now;
|
||||
|
||||
[DisplayName("Дата выполнения")]
|
||||
public DateTime? DateImplement { get; set; }
|
||||
}
|
||||
}
|
22
AutoWorkshopContracts/ViewModels/RepairViewModel.cs
Normal file
22
AutoWorkshopContracts/ViewModels/RepairViewModel.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using AutoWorkshopDataModels.Models;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace AutoWorkshopContracts.ViewModels
|
||||
{
|
||||
public class RepairViewModel : IRepairModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("Название изделия")]
|
||||
|
||||
public string RepairName { get; set; } = string.Empty;
|
||||
[DisplayName("Цена")]
|
||||
|
||||
public double Price { get; set; }
|
||||
|
||||
public Dictionary<int, (IComponentModel, int)> RepairComponents
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = new();
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
namespace AutoWorkshopDataModels
|
||||
{
|
||||
public interface IProductModel : IId
|
||||
{
|
||||
string ProductName { get; }
|
||||
double Price { get; }
|
||||
Dictionary<int, (IComponentModel, int)> ProductComponents { get; }
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
namespace AutoWorkshopDataModels
|
||||
namespace AutoWorkshopDataModels.Models
|
||||
{
|
||||
public interface IComponentModel : IId
|
||||
{
|
9
AutoWorkshopDataModels/Models/IRepairModel.cs
Normal file
9
AutoWorkshopDataModels/Models/IRepairModel.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace AutoWorkshopDataModels.Models
|
||||
{
|
||||
public interface IRepairModel : IId
|
||||
{
|
||||
string RepairName { get; }
|
||||
double Price { get; }
|
||||
Dictionary<int, (IComponentModel, int)> RepairComponents { get; }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user