diff --git a/Confectionery/Confectionery.sln b/Confectionery/Confectionery.sln index 8f853ab..5fa8fc7 100644 --- a/Confectionery/Confectionery.sln +++ b/Confectionery/Confectionery.sln @@ -3,7 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.32112.339 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Confectionery", "Confectionery\Confectionery.csproj", "{B900135E-8594-4AEA-B074-93DECD74C8DE}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConfectioneryDataModels", "ConfectioneryDataModels\ConfectioneryDataModels.csproj", "{D7A8174D-1B45-4463-A4D7-C82CA529EE4D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConfectioneryContracts", "ConfectioneryContracts\ConfectioneryContracts.csproj", "{C151D91F-BDB0-46AD-8573-3F6174E9E76A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConfectioneryView", "ConfectioneryView\ConfectioneryView.csproj", "{B222E04E-D0E7-49F4-8747-426125645B93}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -11,10 +15,18 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B900135E-8594-4AEA-B074-93DECD74C8DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B900135E-8594-4AEA-B074-93DECD74C8DE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B900135E-8594-4AEA-B074-93DECD74C8DE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B900135E-8594-4AEA-B074-93DECD74C8DE}.Release|Any CPU.Build.0 = Release|Any CPU + {D7A8174D-1B45-4463-A4D7-C82CA529EE4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D7A8174D-1B45-4463-A4D7-C82CA529EE4D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D7A8174D-1B45-4463-A4D7-C82CA529EE4D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D7A8174D-1B45-4463-A4D7-C82CA529EE4D}.Release|Any CPU.Build.0 = Release|Any CPU + {C151D91F-BDB0-46AD-8573-3F6174E9E76A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C151D91F-BDB0-46AD-8573-3F6174E9E76A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C151D91F-BDB0-46AD-8573-3F6174E9E76A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C151D91F-BDB0-46AD-8573-3F6174E9E76A}.Release|Any CPU.Build.0 = Release|Any CPU + {B222E04E-D0E7-49F4-8747-426125645B93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B222E04E-D0E7-49F4-8747-426125645B93}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B222E04E-D0E7-49F4-8747-426125645B93}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B222E04E-D0E7-49F4-8747-426125645B93}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Confectionery/ConfectioneryContracts/BindingModels/ComponentBindingModel.cs b/Confectionery/ConfectioneryContracts/BindingModels/ComponentBindingModel.cs new file mode 100644 index 0000000..d6107ce --- /dev/null +++ b/Confectionery/ConfectioneryContracts/BindingModels/ComponentBindingModel.cs @@ -0,0 +1,18 @@ +using ConfectioneryDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryContracts.BindingModels +{ + public class ComponentBindingModel : IComponentModel + { + public int Id { get; set; } + + public string ComponentName { get; set; } = string.Empty; + + public double Cost { get; set; } + } +} diff --git a/Confectionery/ConfectioneryContracts/BindingModels/OrderBindingModel.cs b/Confectionery/ConfectioneryContracts/BindingModels/OrderBindingModel.cs new file mode 100644 index 0000000..c367c94 --- /dev/null +++ b/Confectionery/ConfectioneryContracts/BindingModels/OrderBindingModel.cs @@ -0,0 +1,27 @@ +using ConfectioneryDataModels.Enums; +using ConfectioneryDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryContracts.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.Неизвестен; + + public DateTime DateCreate { get; set; } = DateTime.Now; + + public DateTime? DateImplement { get; set; } + } +} diff --git a/Confectionery/ConfectioneryContracts/BindingModels/ProductBindingModel.cs b/Confectionery/ConfectioneryContracts/BindingModels/ProductBindingModel.cs new file mode 100644 index 0000000..ab4bf89 --- /dev/null +++ b/Confectionery/ConfectioneryContracts/BindingModels/ProductBindingModel.cs @@ -0,0 +1,20 @@ +using ConfectioneryDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryContracts.BindingModels +{ + public class ProductBindingModel : IProductModel + { + public int Id { get; set; } + + public string ProductName { get; set; } = string.Empty; + + public double Price { get; set; } + + public Dictionary ProductComponents { get; set; } = new(); + } +} diff --git a/Confectionery/ConfectioneryContracts/ConfectioneryContracts.csproj b/Confectionery/ConfectioneryContracts/ConfectioneryContracts.csproj new file mode 100644 index 0000000..94665f9 --- /dev/null +++ b/Confectionery/ConfectioneryContracts/ConfectioneryContracts.csproj @@ -0,0 +1,20 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + diff --git a/Confectionery/ConfectioneryDataModels/ConfectioneryDataModels.csproj b/Confectionery/ConfectioneryDataModels/ConfectioneryDataModels.csproj new file mode 100644 index 0000000..132c02c --- /dev/null +++ b/Confectionery/ConfectioneryDataModels/ConfectioneryDataModels.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/Confectionery/ConfectioneryDataModels/Enums/OrderStatus.cs b/Confectionery/ConfectioneryDataModels/Enums/OrderStatus.cs new file mode 100644 index 0000000..1c95908 --- /dev/null +++ b/Confectionery/ConfectioneryDataModels/Enums/OrderStatus.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryDataModels.Enums +{ + public enum OrderStatus + { + Неизвестен = -1, + + Принят = 0, + + Выполняется = 1, + + Готов = 2, + + Выдан = 3 + } +} diff --git a/Confectionery/ConfectioneryDataModels/IId.cs b/Confectionery/ConfectioneryDataModels/IId.cs new file mode 100644 index 0000000..b7d876a --- /dev/null +++ b/Confectionery/ConfectioneryDataModels/IId.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryDataModels.Models +{ + public interface IId + { + int Id { get; } + } +} diff --git a/Confectionery/ConfectioneryDataModels/Models/IComponentModel.cs b/Confectionery/ConfectioneryDataModels/Models/IComponentModel.cs new file mode 100644 index 0000000..811f882 --- /dev/null +++ b/Confectionery/ConfectioneryDataModels/Models/IComponentModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryDataModels.Models +{ + public interface IComponentModel : IId + { + string ComponentName { get; } + + double Cost { get; } + } +} diff --git a/Confectionery/ConfectioneryDataModels/Models/IOrderModel.cs b/Confectionery/ConfectioneryDataModels/Models/IOrderModel.cs new file mode 100644 index 0000000..39fb31e --- /dev/null +++ b/Confectionery/ConfectioneryDataModels/Models/IOrderModel.cs @@ -0,0 +1,24 @@ +using ConfectioneryDataModels.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryDataModels.Models +{ + public interface IOrderModel : IId + { + int ProductId { get; } + + int Count { get; } + + double Sum { get; } + + OrderStatus Status { get; } + + DateTime DateCreate { get; } + + DateTime? DateImplement { get; } + } +} diff --git a/Confectionery/ConfectioneryDataModels/Models/IProductModel.cs b/Confectionery/ConfectioneryDataModels/Models/IProductModel.cs new file mode 100644 index 0000000..1831847 --- /dev/null +++ b/Confectionery/ConfectioneryDataModels/Models/IProductModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConfectioneryDataModels.Models +{ + public interface IProductModel : IId + { + string ProductName { get; } + + double Price { get; } + + Dictionary ProductComponents { get; } + } +} diff --git a/Confectionery/ConfectioneryView/ConfectioneryView.csproj b/Confectionery/ConfectioneryView/ConfectioneryView.csproj new file mode 100644 index 0000000..b57c89e --- /dev/null +++ b/Confectionery/ConfectioneryView/ConfectioneryView.csproj @@ -0,0 +1,11 @@ + + + + WinExe + net6.0-windows + enable + true + enable + + + \ No newline at end of file diff --git a/Confectionery/ConfectioneryView/Form1.Designer.cs b/Confectionery/ConfectioneryView/Form1.Designer.cs new file mode 100644 index 0000000..4fdee0d --- /dev/null +++ b/Confectionery/ConfectioneryView/Form1.Designer.cs @@ -0,0 +1,39 @@ +namespace ConfectioneryView +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Text = "Form1"; + } + + #endregion + } +} \ No newline at end of file diff --git a/Confectionery/ConfectioneryView/Form1.cs b/Confectionery/ConfectioneryView/Form1.cs new file mode 100644 index 0000000..0d39778 --- /dev/null +++ b/Confectionery/ConfectioneryView/Form1.cs @@ -0,0 +1,10 @@ +namespace ConfectioneryView +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/Confectionery/ConfectioneryView/Form1.resx b/Confectionery/ConfectioneryView/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Confectionery/ConfectioneryView/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Confectionery/ConfectioneryView/Program.cs b/Confectionery/ConfectioneryView/Program.cs new file mode 100644 index 0000000..8b4cd92 --- /dev/null +++ b/Confectionery/ConfectioneryView/Program.cs @@ -0,0 +1,17 @@ +namespace ConfectioneryView +{ + internal static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + // To customize application configuration such as set high DPI settings or default font, + // see https://aka.ms/applicationconfiguration. + ApplicationConfiguration.Initialize(); + Application.Run(new Form1()); + } + } +} \ No newline at end of file