From ca3570c197115fc547059b1e1d2d979e1642f97f Mon Sep 17 00:00:00 2001 From: Oleg Shabunov Date: Wed, 15 May 2024 15:07:09 +0400 Subject: [PATCH] Create DataModels --- SushiBar.sln | 8 +++++++- SushiBarDataModels/IId.cs | 7 +++++++ SushiBarDataModels/Models/ICheque.cs | 13 +++++++++++++ SushiBarDataModels/Models/IChequeItem.cs | 13 +++++++++++++ SushiBarDataModels/Models/ICook.cs | 9 +++++++++ SushiBarDataModels/Models/ICustomer.cs | 11 +++++++++++ SushiBarDataModels/Models/IDish.cs | 9 +++++++++ SushiBarDataModels/Models/IDishIngredient.cs | 11 +++++++++++ SushiBarDataModels/Models/IIngredient.cs | 11 +++++++++++ SushiBarDataModels/Models/IPromotion.cs | 11 +++++++++++ SushiBarDataModels/SushiBarDataModels.csproj | 9 +++++++++ {SushiBar => SushiBarView}/Form1.Designer.cs | 0 {SushiBar => SushiBarView}/Form1.cs | 0 {SushiBar => SushiBarView}/Form1.resx | 0 {SushiBar => SushiBarView}/Program.cs | 0 .../SushiBarView.csproj | 0 16 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 SushiBarDataModels/IId.cs create mode 100644 SushiBarDataModels/Models/ICheque.cs create mode 100644 SushiBarDataModels/Models/IChequeItem.cs create mode 100644 SushiBarDataModels/Models/ICook.cs create mode 100644 SushiBarDataModels/Models/ICustomer.cs create mode 100644 SushiBarDataModels/Models/IDish.cs create mode 100644 SushiBarDataModels/Models/IDishIngredient.cs create mode 100644 SushiBarDataModels/Models/IIngredient.cs create mode 100644 SushiBarDataModels/Models/IPromotion.cs create mode 100644 SushiBarDataModels/SushiBarDataModels.csproj rename {SushiBar => SushiBarView}/Form1.Designer.cs (100%) rename {SushiBar => SushiBarView}/Form1.cs (100%) rename {SushiBar => SushiBarView}/Form1.resx (100%) rename {SushiBar => SushiBarView}/Program.cs (100%) rename SushiBar/SushiBar.csproj => SushiBarView/SushiBarView.csproj (100%) diff --git a/SushiBar.sln b/SushiBar.sln index 7a4da34..ea2c20a 100644 --- a/SushiBar.sln +++ b/SushiBar.sln @@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.8.34511.84 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SushiBar", "SushiBar\SushiBar.csproj", "{68873614-5B4D-4753-B03B-F28E73E17951}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SushiBarView", "SushiBarView\SushiBarView.csproj", "{68873614-5B4D-4753-B03B-F28E73E17951}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SushiBarDataModels", "SushiBarDataModels\SushiBarDataModels.csproj", "{4A5A85B2-9B70-4493-B550-0E29FE82E9FD}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -15,6 +17,10 @@ Global {68873614-5B4D-4753-B03B-F28E73E17951}.Debug|Any CPU.Build.0 = Debug|Any CPU {68873614-5B4D-4753-B03B-F28E73E17951}.Release|Any CPU.ActiveCfg = Release|Any CPU {68873614-5B4D-4753-B03B-F28E73E17951}.Release|Any CPU.Build.0 = Release|Any CPU + {4A5A85B2-9B70-4493-B550-0E29FE82E9FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4A5A85B2-9B70-4493-B550-0E29FE82E9FD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4A5A85B2-9B70-4493-B550-0E29FE82E9FD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4A5A85B2-9B70-4493-B550-0E29FE82E9FD}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/SushiBarDataModels/IId.cs b/SushiBarDataModels/IId.cs new file mode 100644 index 0000000..2b4af59 --- /dev/null +++ b/SushiBarDataModels/IId.cs @@ -0,0 +1,7 @@ +namespace SushiBarDataModels +{ + public interface IId + { + int Id { get; } + } +} diff --git a/SushiBarDataModels/Models/ICheque.cs b/SushiBarDataModels/Models/ICheque.cs new file mode 100644 index 0000000..b77c241 --- /dev/null +++ b/SushiBarDataModels/Models/ICheque.cs @@ -0,0 +1,13 @@ +namespace SushiBarDataModels.Models +{ + public interface ICheque : IId + { + int? CustomerId { get; } + + DateTime OrderDate { get; } + + double TotalSum { get; } + + int? PromotionId { get; } + } +} diff --git a/SushiBarDataModels/Models/IChequeItem.cs b/SushiBarDataModels/Models/IChequeItem.cs new file mode 100644 index 0000000..53c1d38 --- /dev/null +++ b/SushiBarDataModels/Models/IChequeItem.cs @@ -0,0 +1,13 @@ +namespace SushiBarDataModels.Models +{ + public interface IChequeItem : IId + { + int DishId { get; } + + int ChequeId { get; } + + int CookId { get; } + + int Count { get; } + } +} diff --git a/SushiBarDataModels/Models/ICook.cs b/SushiBarDataModels/Models/ICook.cs new file mode 100644 index 0000000..dfbe0df --- /dev/null +++ b/SushiBarDataModels/Models/ICook.cs @@ -0,0 +1,9 @@ +namespace SushiBarDataModels.Models +{ + public interface ICook : IId + { + string Fio { get; } + + DateTime EmploymentDate { get; } + } +} diff --git a/SushiBarDataModels/Models/ICustomer.cs b/SushiBarDataModels/Models/ICustomer.cs new file mode 100644 index 0000000..21facab --- /dev/null +++ b/SushiBarDataModels/Models/ICustomer.cs @@ -0,0 +1,11 @@ +namespace SushiBarDataModels.Models +{ + public interface ICustomer : IId + { + string Fio { get; } + + DateTime BirthdayDate { get; } + + double SumOfAllOrders { get; } + } +} diff --git a/SushiBarDataModels/Models/IDish.cs b/SushiBarDataModels/Models/IDish.cs new file mode 100644 index 0000000..752a96a --- /dev/null +++ b/SushiBarDataModels/Models/IDish.cs @@ -0,0 +1,9 @@ +namespace SushiBarDataModels.Models +{ + public interface IDish : IId + { + string DishName { get; } + + string Category { get; } + } +} diff --git a/SushiBarDataModels/Models/IDishIngredient.cs b/SushiBarDataModels/Models/IDishIngredient.cs new file mode 100644 index 0000000..5ca5945 --- /dev/null +++ b/SushiBarDataModels/Models/IDishIngredient.cs @@ -0,0 +1,11 @@ +namespace SushiBarDataModels.Models +{ + public interface IDishIngredient : IId + { + int DishId { get; } + + int IngredientId { get; } + + int Count { get; } + } +} diff --git a/SushiBarDataModels/Models/IIngredient.cs b/SushiBarDataModels/Models/IIngredient.cs new file mode 100644 index 0000000..fae8847 --- /dev/null +++ b/SushiBarDataModels/Models/IIngredient.cs @@ -0,0 +1,11 @@ +namespace SushiBarDataModels.Models +{ + public interface IIngredient : IId + { + string IngredientName { get; } + + string Unit { get; } + + double Cost { get; } + } +} diff --git a/SushiBarDataModels/Models/IPromotion.cs b/SushiBarDataModels/Models/IPromotion.cs new file mode 100644 index 0000000..c9effd1 --- /dev/null +++ b/SushiBarDataModels/Models/IPromotion.cs @@ -0,0 +1,11 @@ +namespace SushiBarDataModels.Models +{ + public interface IPromotion : IId + { + string PromotionName { get; } + + float Discount { get; } + + double TriggeringSum { get; } + } +} diff --git a/SushiBarDataModels/SushiBarDataModels.csproj b/SushiBarDataModels/SushiBarDataModels.csproj new file mode 100644 index 0000000..132c02c --- /dev/null +++ b/SushiBarDataModels/SushiBarDataModels.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/SushiBar/Form1.Designer.cs b/SushiBarView/Form1.Designer.cs similarity index 100% rename from SushiBar/Form1.Designer.cs rename to SushiBarView/Form1.Designer.cs diff --git a/SushiBar/Form1.cs b/SushiBarView/Form1.cs similarity index 100% rename from SushiBar/Form1.cs rename to SushiBarView/Form1.cs diff --git a/SushiBar/Form1.resx b/SushiBarView/Form1.resx similarity index 100% rename from SushiBar/Form1.resx rename to SushiBarView/Form1.resx diff --git a/SushiBar/Program.cs b/SushiBarView/Program.cs similarity index 100% rename from SushiBar/Program.cs rename to SushiBarView/Program.cs diff --git a/SushiBar/SushiBar.csproj b/SushiBarView/SushiBarView.csproj similarity index 100% rename from SushiBar/SushiBar.csproj rename to SushiBarView/SushiBarView.csproj