From 67538380e35d9c72f536cc4a952b2ac7736023c9 Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Sat, 4 Feb 2023 21:31:11 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BF=D0=B5=D1=80=D0=B2=D0=BE=D0=B9=20=D0=B1=D0=B8?= =?UTF-8?q?=D0=B1=D0=BB=D0=B8=D0=BE=D1=82=D0=B5=D0=BA=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbstractShopDataModels.sln | 25 ++++++++++++++++++ .../AbstractShopDataModels.csproj | 9 +++++++ .../AbstractShopDataModels/IComponentModel.cs | 12 +++++++++ .../AbstractShopDataModels/IId.cs | 8 ++++++ .../AbstractShopDataModels/IOrderModel.cs | 26 +++++++++++++++++++ .../AbstractShopDataModels/IProductModel.cs | 21 +++++++++++++++ .../AbstractShopDataModels/OrderStatus.cs | 16 ++++++++++++ 7 files changed, 117 insertions(+) create mode 100644 AbstractShopDataModels/AbstractShopDataModels.sln create mode 100644 AbstractShopDataModels/AbstractShopDataModels/AbstractShopDataModels.csproj create mode 100644 AbstractShopDataModels/AbstractShopDataModels/IComponentModel.cs create mode 100644 AbstractShopDataModels/AbstractShopDataModels/IId.cs create mode 100644 AbstractShopDataModels/AbstractShopDataModels/IOrderModel.cs create mode 100644 AbstractShopDataModels/AbstractShopDataModels/IProductModel.cs create mode 100644 AbstractShopDataModels/AbstractShopDataModels/OrderStatus.cs diff --git a/AbstractShopDataModels/AbstractShopDataModels.sln b/AbstractShopDataModels/AbstractShopDataModels.sln new file mode 100644 index 0000000..01b71de --- /dev/null +++ b/AbstractShopDataModels/AbstractShopDataModels.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33103.184 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AbstractShopDataModels", "AbstractShopDataModels\AbstractShopDataModels.csproj", "{7388459F-91DB-40D9-8999-500015301160}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7388459F-91DB-40D9-8999-500015301160}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7388459F-91DB-40D9-8999-500015301160}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7388459F-91DB-40D9-8999-500015301160}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7388459F-91DB-40D9-8999-500015301160}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {60688C9E-4871-4357-A48F-63718AD0FA65} + EndGlobalSection +EndGlobal diff --git a/AbstractShopDataModels/AbstractShopDataModels/AbstractShopDataModels.csproj b/AbstractShopDataModels/AbstractShopDataModels/AbstractShopDataModels.csproj new file mode 100644 index 0000000..132c02c --- /dev/null +++ b/AbstractShopDataModels/AbstractShopDataModels/AbstractShopDataModels.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/AbstractShopDataModels/AbstractShopDataModels/IComponentModel.cs b/AbstractShopDataModels/AbstractShopDataModels/IComponentModel.cs new file mode 100644 index 0000000..163b553 --- /dev/null +++ b/AbstractShopDataModels/AbstractShopDataModels/IComponentModel.cs @@ -0,0 +1,12 @@ +namespace AbstractShopDataModels +{ + //интерфейс, отвечающий за компоненты + internal interface IComponentModel : IId + { + //название составляющей (изделие состоит из составляющих) + string ComponentName { get; } + + //цена составляющей + double Cost { get; } + } +} diff --git a/AbstractShopDataModels/AbstractShopDataModels/IId.cs b/AbstractShopDataModels/AbstractShopDataModels/IId.cs new file mode 100644 index 0000000..3107c32 --- /dev/null +++ b/AbstractShopDataModels/AbstractShopDataModels/IId.cs @@ -0,0 +1,8 @@ +namespace AbstractShopDataModels +{ + //интерфейс, отвечающий за id у компонентов, продуктов и чеков + internal interface IId + { + int Id { get; } + } +} diff --git a/AbstractShopDataModels/AbstractShopDataModels/IOrderModel.cs b/AbstractShopDataModels/AbstractShopDataModels/IOrderModel.cs new file mode 100644 index 0000000..96b2fb4 --- /dev/null +++ b/AbstractShopDataModels/AbstractShopDataModels/IOrderModel.cs @@ -0,0 +1,26 @@ +using AbstractShopDataModels.Enums; + +namespace AbstractShopDataModels +{ + //интерфейс, отвечающий за чек + internal interface IOrderModel : IId + { + //id продукта + int ProductId { get; } + + //кол-во продуктов + int Count { get; } + + //суммарная стоимость продуктов + double Sum { get; } + + //статус заказа + OrderStatus Status { get; } + + //дата создания заказа + DateTime DateCreate { get; } + + //дата завершения заказа (не обязательна к указанию сразу) + DateTime? DateImplement { get; } + } +} diff --git a/AbstractShopDataModels/AbstractShopDataModels/IProductModel.cs b/AbstractShopDataModels/AbstractShopDataModels/IProductModel.cs new file mode 100644 index 0000000..dfd51f8 --- /dev/null +++ b/AbstractShopDataModels/AbstractShopDataModels/IProductModel.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AbstractShopDataModels +{ + //интерфейс, отвечающий за продукт + internal interface IProductModel : IId + { + //наименование изделия + string ProductName { get; } + + //цена изделия + double Price { get; } + + //словарь, хранящий пары кол-во + компонент и его цена + Dictionary ProductComponents { get; } + } +} diff --git a/AbstractShopDataModels/AbstractShopDataModels/OrderStatus.cs b/AbstractShopDataModels/AbstractShopDataModels/OrderStatus.cs new file mode 100644 index 0000000..863259d --- /dev/null +++ b/AbstractShopDataModels/AbstractShopDataModels/OrderStatus.cs @@ -0,0 +1,16 @@ +namespace AbstractShopDataModels.Enums +{ + //статус заказа + public enum OrderStatus + { + Неизвестен = -1, + + Принят = 0, + + Выполняется = 1, + + Готов = 2, + + Выдан = 3 + } +} \ No newline at end of file