diff --git a/FishFactory/FishFactory.csproj b/FishFactory/FishFactory.csproj new file mode 100644 index 0000000..e0de06e --- /dev/null +++ b/FishFactory/FishFactory.csproj @@ -0,0 +1,19 @@ + + + + WinExe + net6.0-windows + enable + true + enable + + + + + + + + + + + \ No newline at end of file diff --git a/FishFactory/FishFactory.sln b/FishFactory/FishFactory.sln new file mode 100644 index 0000000..c9b9f51 --- /dev/null +++ b/FishFactory/FishFactory.sln @@ -0,0 +1,71 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34221.43 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FishFactory", "FishFactory.csproj", "{D820588F-CBC7-418A-8473-1224A24A8327}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FishFactoryBusinessLogic", "..\FishFactoryBusinessLogic\FishFactoryBusinessLogic.csproj", "{B2815667-7698-4714-8A4A-49E2D2D12897}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FishFactoryContracts", "..\FishFactoryContracts\FishFactoryContracts.csproj", "{FC95CF33-FB17-4D4A-A459-C366833A2A48}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FishFactoryDataModel", "..\FishFactoryDataModels\FishFactoryDataModel.csproj", "{12087D2D-57C5-45AA-A5D2-9D4D22E237B5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FishFactoryListImplement", "..\FishFactoryListImplement\FishFactoryListImplement.csproj", "{A507DACE-7D8D-4C0F-AB5D-764FE1A61EDC}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D820588F-CBC7-418A-8473-1224A24A8327}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D820588F-CBC7-418A-8473-1224A24A8327}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D820588F-CBC7-418A-8473-1224A24A8327}.Debug|x86.ActiveCfg = Debug|Any CPU + {D820588F-CBC7-418A-8473-1224A24A8327}.Debug|x86.Build.0 = Debug|Any CPU + {D820588F-CBC7-418A-8473-1224A24A8327}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D820588F-CBC7-418A-8473-1224A24A8327}.Release|Any CPU.Build.0 = Release|Any CPU + {D820588F-CBC7-418A-8473-1224A24A8327}.Release|x86.ActiveCfg = Release|Any CPU + {D820588F-CBC7-418A-8473-1224A24A8327}.Release|x86.Build.0 = Release|Any CPU + {B2815667-7698-4714-8A4A-49E2D2D12897}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B2815667-7698-4714-8A4A-49E2D2D12897}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B2815667-7698-4714-8A4A-49E2D2D12897}.Debug|x86.ActiveCfg = Debug|x86 + {B2815667-7698-4714-8A4A-49E2D2D12897}.Debug|x86.Build.0 = Debug|x86 + {B2815667-7698-4714-8A4A-49E2D2D12897}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B2815667-7698-4714-8A4A-49E2D2D12897}.Release|Any CPU.Build.0 = Release|Any CPU + {B2815667-7698-4714-8A4A-49E2D2D12897}.Release|x86.ActiveCfg = Release|x86 + {B2815667-7698-4714-8A4A-49E2D2D12897}.Release|x86.Build.0 = Release|x86 + {FC95CF33-FB17-4D4A-A459-C366833A2A48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FC95CF33-FB17-4D4A-A459-C366833A2A48}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FC95CF33-FB17-4D4A-A459-C366833A2A48}.Debug|x86.ActiveCfg = Debug|x86 + {FC95CF33-FB17-4D4A-A459-C366833A2A48}.Debug|x86.Build.0 = Debug|x86 + {FC95CF33-FB17-4D4A-A459-C366833A2A48}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FC95CF33-FB17-4D4A-A459-C366833A2A48}.Release|Any CPU.Build.0 = Release|Any CPU + {FC95CF33-FB17-4D4A-A459-C366833A2A48}.Release|x86.ActiveCfg = Release|x86 + {FC95CF33-FB17-4D4A-A459-C366833A2A48}.Release|x86.Build.0 = Release|x86 + {12087D2D-57C5-45AA-A5D2-9D4D22E237B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {12087D2D-57C5-45AA-A5D2-9D4D22E237B5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {12087D2D-57C5-45AA-A5D2-9D4D22E237B5}.Debug|x86.ActiveCfg = Debug|x86 + {12087D2D-57C5-45AA-A5D2-9D4D22E237B5}.Debug|x86.Build.0 = Debug|x86 + {12087D2D-57C5-45AA-A5D2-9D4D22E237B5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {12087D2D-57C5-45AA-A5D2-9D4D22E237B5}.Release|Any CPU.Build.0 = Release|Any CPU + {12087D2D-57C5-45AA-A5D2-9D4D22E237B5}.Release|x86.ActiveCfg = Release|x86 + {12087D2D-57C5-45AA-A5D2-9D4D22E237B5}.Release|x86.Build.0 = Release|x86 + {A507DACE-7D8D-4C0F-AB5D-764FE1A61EDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A507DACE-7D8D-4C0F-AB5D-764FE1A61EDC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A507DACE-7D8D-4C0F-AB5D-764FE1A61EDC}.Debug|x86.ActiveCfg = Debug|x86 + {A507DACE-7D8D-4C0F-AB5D-764FE1A61EDC}.Debug|x86.Build.0 = Debug|x86 + {A507DACE-7D8D-4C0F-AB5D-764FE1A61EDC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A507DACE-7D8D-4C0F-AB5D-764FE1A61EDC}.Release|Any CPU.Build.0 = Release|Any CPU + {A507DACE-7D8D-4C0F-AB5D-764FE1A61EDC}.Release|x86.ActiveCfg = Release|x86 + {A507DACE-7D8D-4C0F-AB5D-764FE1A61EDC}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {47DFAE66-FEF5-4276-AF01-33DFBD2C726A} + EndGlobalSection +EndGlobal diff --git a/FishFactory/FormCanned.Designer.cs b/FishFactory/FormCanned.Designer.cs new file mode 100644 index 0000000..0740892 --- /dev/null +++ b/FishFactory/FormCanned.Designer.cs @@ -0,0 +1,190 @@ +namespace FishFactory.Forms +{ + partial class FormCanned + { + /// + /// 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.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.button3 = new System.Windows.Forms.Button(); + this.button4 = new System.Windows.Forms.Button(); + this.dataGridView1 = new System.Windows.Forms.DataGridView(); + this.Component = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Count = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(18, 16); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(76, 16); + this.label1.TabIndex = 0; + this.label1.Text = "Название:"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(18, 44); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(80, 16); + this.label2.TabIndex = 1; + this.label2.Text = "Стоимость:"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(661, 47); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(97, 30); + this.button1.TabIndex = 0; + this.button1.Text = "Добавить"; + this.button1.UseVisualStyleBackColor = true; + // + // button2 + // + this.button2.Location = new System.Drawing.Point(661, 96); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(97, 30); + this.button2.TabIndex = 1; + this.button2.Text = "Изменить"; + this.button2.UseVisualStyleBackColor = true; + // + // button3 + // + this.button3.Location = new System.Drawing.Point(661, 142); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(97, 30); + this.button3.TabIndex = 2; + this.button3.Text = "Удалить"; + this.button3.UseVisualStyleBackColor = true; + // + // button4 + // + this.button4.Location = new System.Drawing.Point(661, 185); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(97, 30); + this.button4.TabIndex = 3; + this.button4.Text = "Обновить"; + this.button4.UseVisualStyleBackColor = true; + // + // dataGridView1 + // + this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.Component, + this.Count}); + this.dataGridView1.Location = new System.Drawing.Point(0, 21); + this.dataGridView1.Name = "dataGridView1"; + this.dataGridView1.RowHeadersWidth = 51; + this.dataGridView1.RowTemplate.Height = 24; + this.dataGridView1.Size = new System.Drawing.Size(627, 443); + this.dataGridView1.TabIndex = 4; + // + // Component + // + this.Component.HeaderText = "Компонент"; + this.Component.MinimumWidth = 6; + this.Component.Name = "Component"; + this.Component.Width = 125; + // + // Count + // + this.Count.HeaderText = "Количество"; + this.Count.MinimumWidth = 6; + this.Count.Name = "Count"; + this.Count.Width = 125; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(107, 14); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(281, 22); + this.textBox1.TabIndex = 3; + // + // textBox2 + // + this.textBox2.Location = new System.Drawing.Point(107, 42); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(97, 22); + this.textBox2.TabIndex = 4; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.button4); + this.groupBox1.Controls.Add(this.button3); + this.groupBox1.Controls.Add(this.dataGridView1); + this.groupBox1.Controls.Add(this.button2); + this.groupBox1.Controls.Add(this.button1); + this.groupBox1.Location = new System.Drawing.Point(16, 76); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(787, 464); + this.groupBox1.TabIndex = 5; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Компоненты"; + // + // FormCanned + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(813, 558); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.textBox2); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Name = "FormCanned"; + this.Text = "FormCanned"; + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); + this.groupBox1.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Button button4; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.DataGridView dataGridView1; + private System.Windows.Forms.DataGridViewTextBoxColumn Component; + private System.Windows.Forms.DataGridViewTextBoxColumn Count; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.GroupBox groupBox1; + } +} \ No newline at end of file diff --git a/FishFactory/FormCanned.cs b/FishFactory/FormCanned.cs new file mode 100644 index 0000000..2bf2f9c --- /dev/null +++ b/FishFactory/FormCanned.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace FishFactory.Forms +{ + public partial class FormCanned : Form + { + public FormCanned() + { + InitializeComponent(); + } + } +} diff --git a/FishFactory/FormCanned.resx b/FishFactory/FormCanned.resx new file mode 100644 index 0000000..0ecc145 --- /dev/null +++ b/FishFactory/FormCanned.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/FishFactory/FormCannedComponent.Designer.cs b/FishFactory/FormCannedComponent.Designer.cs new file mode 100644 index 0000000..5e90bfa --- /dev/null +++ b/FishFactory/FormCannedComponent.Designer.cs @@ -0,0 +1,117 @@ +namespace FishFactory.Forms +{ + partial class FormCannedComponent + { + /// + /// 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.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.comboBox1 = new System.Windows.Forms.ComboBox(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(220, 80); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(86, 29); + this.button1.TabIndex = 0; + this.button1.Text = "button1"; + this.button1.UseVisualStyleBackColor = true; + // + // button2 + // + this.button2.Location = new System.Drawing.Point(316, 80); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(86, 29); + this.button2.TabIndex = 1; + this.button2.Text = "button2"; + this.button2.UseVisualStyleBackColor = true; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(14, 14); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(82, 16); + this.label1.TabIndex = 2; + this.label1.Text = "Компонент:"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(14, 46); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(88, 16); + this.label2.TabIndex = 3; + this.label2.Text = "Количество:"; + // + // comboBox1 + // + this.comboBox1.FormattingEnabled = true; + this.comboBox1.Location = new System.Drawing.Point(121, 10); + this.comboBox1.Name = "comboBox1"; + this.comboBox1.Size = new System.Drawing.Size(285, 24); + this.comboBox1.TabIndex = 4; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(121, 46); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(285, 22); + this.textBox1.TabIndex = 5; + // + // FormCannedComponent + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(426, 120); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.comboBox1); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Name = "FormCannedComponent"; + this.Text = "FormCannedComponent"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.ComboBox comboBox1; + private System.Windows.Forms.TextBox textBox1; + } +} \ No newline at end of file diff --git a/FishFactory/FormCannedComponent.cs b/FishFactory/FormCannedComponent.cs new file mode 100644 index 0000000..86f496a --- /dev/null +++ b/FishFactory/FormCannedComponent.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace FishFactory.Forms +{ + public partial class FormCannedComponent : Form + { + public FormCannedComponent() + { + InitializeComponent(); + } + } +} diff --git a/FishFactory/FormCannedComponent.resx b/FishFactory/FormCannedComponent.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/FishFactory/FormCannedComponent.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/FishFactory/FormComponent.Designer.cs b/FishFactory/FormComponent.Designer.cs new file mode 100644 index 0000000..8412d68 --- /dev/null +++ b/FishFactory/FormComponent.Designer.cs @@ -0,0 +1,118 @@ +namespace FishFactory.Forms +{ + partial class FormComponent + { + /// + /// 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.buttonSave = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.textBoxName = new System.Windows.Forms.TextBox(); + this.textBoxCost = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // buttonSave + // + this.buttonSave.Location = new System.Drawing.Point(217, 95); + this.buttonSave.Name = "buttonSave"; + this.buttonSave.Size = new System.Drawing.Size(98, 27); + this.buttonSave.TabIndex = 0; + this.buttonSave.Text = "Сохранить"; + this.buttonSave.UseVisualStyleBackColor = true; + this.buttonSave.Click += new System.EventHandler(this.buttonSave_Click); + // + // buttonCancel + // + this.buttonCancel.Location = new System.Drawing.Point(325, 95); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(98, 27); + this.buttonCancel.TabIndex = 1; + this.buttonCancel.Text = "Отмена"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(24, 24); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(76, 16); + this.label1.TabIndex = 2; + this.label1.Text = "Название:"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(24, 55); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(43, 16); + this.label2.TabIndex = 3; + this.label2.Text = "Цена:"; + // + // textBoxName + // + this.textBoxName.Location = new System.Drawing.Point(118, 21); + this.textBoxName.Name = "textBoxName"; + this.textBoxName.Size = new System.Drawing.Size(305, 22); + this.textBoxName.TabIndex = 4; + // + // textBoxCost + // + this.textBoxCost.Location = new System.Drawing.Point(118, 52); + this.textBoxCost.Name = "textBoxCost"; + this.textBoxCost.Size = new System.Drawing.Size(186, 22); + this.textBoxCost.TabIndex = 5; + // + // FormComponent + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(462, 139); + this.Controls.Add(this.textBoxCost); + this.Controls.Add(this.textBoxName); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonSave); + this.Name = "FormComponent"; + this.Text = "FormComponent"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button buttonSave; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox textBoxName; + private System.Windows.Forms.TextBox textBoxCost; + } +} \ No newline at end of file diff --git a/FishFactory/FormComponent.cs b/FishFactory/FormComponent.cs new file mode 100644 index 0000000..613e314 --- /dev/null +++ b/FishFactory/FormComponent.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using Microsoft.Extensions.Logging; +using FishFactoryBusinessLogic.BusinessLogic; + +namespace FishFactory.Forms +{ + public partial class FormComponent : Form + { + private readonly ILogger _logger; + private readonly IComponentLogic _logic; + private int? _id; + public int Id { set { _id = value; } } + public FormComponent((ILogger logger, IComponentLogic logic) + { + InitializeComponent(); + } + + private void buttonSave_Click(object sender, EventArgs e) + { + + } + + private void buttonCancel_Click(object sender, EventArgs e) + { + + } + } +} diff --git a/FishFactory/FormComponent.resx b/FishFactory/FormComponent.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/FishFactory/FormComponent.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/FishFactory/FormComponents.Designer.cs b/FishFactory/FormComponents.Designer.cs new file mode 100644 index 0000000..b04807a --- /dev/null +++ b/FishFactory/FormComponents.Designer.cs @@ -0,0 +1,110 @@ +namespace FishFactory.Forms +{ + partial class FormComponents + { + /// + /// 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.dataGridView1 = new System.Windows.Forms.DataGridView(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.button3 = new System.Windows.Forms.Button(); + this.button4 = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); + this.SuspendLayout(); + // + // dataGridView1 + // + this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView1.Location = new System.Drawing.Point(-1, -2); + this.dataGridView1.Name = "dataGridView1"; + this.dataGridView1.RowHeadersWidth = 51; + this.dataGridView1.RowTemplate.Height = 24; + this.dataGridView1.Size = new System.Drawing.Size(499, 454); + this.dataGridView1.TabIndex = 0; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(525, 38); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(111, 28); + this.button1.TabIndex = 1; + this.button1.Text = "button1"; + this.button1.UseVisualStyleBackColor = true; + // + // button2 + // + this.button2.Location = new System.Drawing.Point(525, 78); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(111, 28); + this.button2.TabIndex = 2; + this.button2.Text = "button2"; + this.button2.UseVisualStyleBackColor = true; + // + // button3 + // + this.button3.Location = new System.Drawing.Point(525, 120); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(111, 28); + this.button3.TabIndex = 3; + this.button3.Text = "button3"; + this.button3.UseVisualStyleBackColor = true; + // + // button4 + // + this.button4.Location = new System.Drawing.Point(525, 161); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(111, 28); + this.button4.TabIndex = 4; + this.button4.Text = "button4"; + this.button4.UseVisualStyleBackColor = true; + // + // FormComponents + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(662, 450); + this.Controls.Add(this.button4); + this.Controls.Add(this.button3); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.dataGridView1); + this.Name = "FormComponents"; + this.Text = "FormComponents"; + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.DataGridView dataGridView1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.Button button4; + } +} \ No newline at end of file diff --git a/FishFactory/FormComponents.cs b/FishFactory/FormComponents.cs new file mode 100644 index 0000000..4915dd4 --- /dev/null +++ b/FishFactory/FormComponents.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace FishFactory.Forms +{ + public partial class FormComponents : Form + { + public FormComponents() + { + InitializeComponent(); + } + } +} diff --git a/FishFactory/FormComponents.resx b/FishFactory/FormComponents.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/FishFactory/FormComponents.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/FishFactory/FormCreateOrder.Designer.cs b/FishFactory/FormCreateOrder.Designer.cs new file mode 100644 index 0000000..972a2e7 --- /dev/null +++ b/FishFactory/FormCreateOrder.Designer.cs @@ -0,0 +1,139 @@ +namespace FishFactory.Forms +{ + partial class FormCreateOrder + { + /// + /// 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.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.textBoxCount = new System.Windows.Forms.TextBox(); + this.comboBoxCanned = new System.Windows.Forms.ComboBox(); + this.textBoxSum = new System.Windows.Forms.TextBox(); + this.buttonSave = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(22, 13); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(68, 16); + this.label1.TabIndex = 0; + this.label1.Text = "Изделие:"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(22, 46); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(88, 16); + this.label2.TabIndex = 1; + this.label2.Text = "Количество:"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(22, 75); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(53, 16); + this.label3.TabIndex = 2; + this.label3.Text = "Сумма:"; + // + // textBoxCount + // + this.textBoxCount.Location = new System.Drawing.Point(118, 43); + this.textBoxCount.Name = "textBoxCount"; + this.textBoxCount.Size = new System.Drawing.Size(280, 22); + this.textBoxCount.TabIndex = 3; + // + // comboBoxCanned + // + this.comboBoxCanned.FormattingEnabled = true; + this.comboBoxCanned.Location = new System.Drawing.Point(118, 11); + this.comboBoxCanned.Name = "comboBoxCanned"; + this.comboBoxCanned.Size = new System.Drawing.Size(280, 24); + this.comboBoxCanned.TabIndex = 4; + // + // textBoxSum + // + this.textBoxSum.Location = new System.Drawing.Point(118, 75); + this.textBoxSum.Name = "textBoxSum"; + this.textBoxSum.Size = new System.Drawing.Size(280, 22); + this.textBoxSum.TabIndex = 5; + // + // buttonSave + // + this.buttonSave.Location = new System.Drawing.Point(215, 108); + this.buttonSave.Name = "buttonSave"; + this.buttonSave.Size = new System.Drawing.Size(88, 28); + this.buttonSave.TabIndex = 6; + this.buttonSave.Text = "Сохранить"; + this.buttonSave.UseVisualStyleBackColor = true; + // + // buttonCancel + // + this.buttonCancel.Location = new System.Drawing.Point(310, 108); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(88, 28); + this.buttonCancel.TabIndex = 7; + this.buttonCancel.Text = "Отмена"; + this.buttonCancel.UseVisualStyleBackColor = true; + // + // FormCreateOrder + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(428, 146); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonSave); + this.Controls.Add(this.textBoxSum); + this.Controls.Add(this.comboBoxCanned); + this.Controls.Add(this.textBoxCount); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Name = "FormCreateOrder"; + this.Text = "Заказ"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox textBoxCount; + private System.Windows.Forms.ComboBox comboBoxCanned; + private System.Windows.Forms.TextBox textBoxSum; + private System.Windows.Forms.Button buttonSave; + private System.Windows.Forms.Button buttonCancel; + } +} \ No newline at end of file diff --git a/FishFactory/FormCreateOrder.cs b/FishFactory/FormCreateOrder.cs new file mode 100644 index 0000000..c2d0511 --- /dev/null +++ b/FishFactory/FormCreateOrder.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace FishFactory.Forms +{ + public partial class FormCreateOrder : Form + { + public FormCreateOrder() + { + InitializeComponent(); + } + } +} diff --git a/FishFactory/FormCreateOrder.resx b/FishFactory/FormCreateOrder.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/FishFactory/FormCreateOrder.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/FishFactory/FormMain.Designer.cs b/FishFactory/FormMain.Designer.cs new file mode 100644 index 0000000..57a63ee --- /dev/null +++ b/FishFactory/FormMain.Designer.cs @@ -0,0 +1,171 @@ +namespace FishFactory.Forms +{ + partial class FormMain + { + /// + /// 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMain)); + this.toolStrip1 = new System.Windows.Forms.ToolStrip(); + this.buttonCreateOrder = new System.Windows.Forms.Button(); + this.buttonTakeOrderInWork = new System.Windows.Forms.Button(); + this.buttonOrderReady = new System.Windows.Forms.Button(); + this.buttonIssuedOrder = new System.Windows.Forms.Button(); + this.buttonRef = new System.Windows.Forms.Button(); + this.dataGridView1 = new System.Windows.Forms.DataGridView(); + this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton(); + this.компонентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.консервыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStrip1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); + this.SuspendLayout(); + // + // toolStrip1 + // + this.toolStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); + this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripDropDownButton1}); + this.toolStrip1.Location = new System.Drawing.Point(0, 0); + this.toolStrip1.Name = "toolStrip1"; + this.toolStrip1.Size = new System.Drawing.Size(865, 27); + this.toolStrip1.TabIndex = 0; + this.toolStrip1.Text = "toolStrip1"; + // + // buttonCreateOrder + // + this.buttonCreateOrder.Location = new System.Drawing.Point(655, 43); + this.buttonCreateOrder.Name = "buttonCreateOrder"; + this.buttonCreateOrder.Size = new System.Drawing.Size(175, 26); + this.buttonCreateOrder.TabIndex = 1; + this.buttonCreateOrder.Text = "Создать заказ"; + this.buttonCreateOrder.UseVisualStyleBackColor = true; + // + // buttonTakeOrderInWork + // + this.buttonTakeOrderInWork.Location = new System.Drawing.Point(655, 90); + this.buttonTakeOrderInWork.Name = "buttonTakeOrderInWork"; + this.buttonTakeOrderInWork.Size = new System.Drawing.Size(175, 26); + this.buttonTakeOrderInWork.TabIndex = 2; + this.buttonTakeOrderInWork.Text = "Отдать на выполнение"; + this.buttonTakeOrderInWork.UseVisualStyleBackColor = true; + // + // buttonOrderReady + // + this.buttonOrderReady.Location = new System.Drawing.Point(655, 135); + this.buttonOrderReady.Name = "buttonOrderReady"; + this.buttonOrderReady.Size = new System.Drawing.Size(175, 26); + this.buttonOrderReady.TabIndex = 3; + this.buttonOrderReady.Text = "Заказ готов"; + this.buttonOrderReady.UseVisualStyleBackColor = true; + // + // buttonIssuedOrder + // + this.buttonIssuedOrder.Location = new System.Drawing.Point(655, 176); + this.buttonIssuedOrder.Name = "buttonIssuedOrder"; + this.buttonIssuedOrder.Size = new System.Drawing.Size(175, 26); + this.buttonIssuedOrder.TabIndex = 4; + this.buttonIssuedOrder.Text = "Заказ выдан"; + this.buttonIssuedOrder.UseVisualStyleBackColor = true; + // + // buttonRef + // + this.buttonRef.Location = new System.Drawing.Point(655, 220); + this.buttonRef.Name = "buttonRef"; + this.buttonRef.Size = new System.Drawing.Size(175, 26); + this.buttonRef.TabIndex = 5; + this.buttonRef.Text = "Обновить список"; + this.buttonRef.UseVisualStyleBackColor = true; + // + // dataGridView1 + // + this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView1.Location = new System.Drawing.Point(0, 28); + this.dataGridView1.Name = "dataGridView1"; + this.dataGridView1.RowHeadersWidth = 51; + this.dataGridView1.RowTemplate.Height = 24; + this.dataGridView1.Size = new System.Drawing.Size(630, 464); + this.dataGridView1.TabIndex = 6; + // + // toolStripDropDownButton1 + // + this.toolStripDropDownButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.компонентыToolStripMenuItem, + this.консервыToolStripMenuItem}); + this.toolStripDropDownButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton1.Image"))); + this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripDropDownButton1.Name = "toolStripDropDownButton1"; + this.toolStripDropDownButton1.Size = new System.Drawing.Size(108, 24); + this.toolStripDropDownButton1.Text = "Справочник"; + // + // компонентыToolStripMenuItem + // + this.компонентыToolStripMenuItem.Name = "компонентыToolStripMenuItem"; + this.компонентыToolStripMenuItem.Size = new System.Drawing.Size(224, 26); + this.компонентыToolStripMenuItem.Text = "Компоненты"; + // + // консервыToolStripMenuItem + // + this.консервыToolStripMenuItem.Name = "консервыToolStripMenuItem"; + this.консервыToolStripMenuItem.Size = new System.Drawing.Size(224, 26); + this.консервыToolStripMenuItem.Text = "Консервы"; + // + // FormMain + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(865, 494); + this.Controls.Add(this.dataGridView1); + this.Controls.Add(this.buttonRef); + this.Controls.Add(this.buttonIssuedOrder); + this.Controls.Add(this.buttonOrderReady); + this.Controls.Add(this.buttonTakeOrderInWork); + this.Controls.Add(this.buttonCreateOrder); + this.Controls.Add(this.toolStrip1); + this.Name = "FormMain"; + this.Text = "Рыбный завод"; + this.toolStrip1.ResumeLayout(false); + this.toolStrip1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ToolStrip toolStrip1; + private System.Windows.Forms.Button buttonCreateOrder; + private System.Windows.Forms.Button buttonTakeOrderInWork; + private System.Windows.Forms.Button buttonOrderReady; + private System.Windows.Forms.Button buttonIssuedOrder; + private System.Windows.Forms.Button buttonRef; + private System.Windows.Forms.DataGridView dataGridView1; + private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton1; + private System.Windows.Forms.ToolStripMenuItem компонентыToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem консервыToolStripMenuItem; + } +} \ No newline at end of file diff --git a/FishFactory/FormMain.cs b/FishFactory/FormMain.cs new file mode 100644 index 0000000..dbc3ffa --- /dev/null +++ b/FishFactory/FormMain.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace FishFactory.Forms +{ + public partial class FormMain : Form + { + public FormMain() + { + InitializeComponent(); + } + + } +} diff --git a/FishFactory/FormMain.resx b/FishFactory/FormMain.resx new file mode 100644 index 0000000..f5c694e --- /dev/null +++ b/FishFactory/FormMain.resx @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 17, 17 + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG + YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 + 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw + bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc + VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 + c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 + Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo + mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ + kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D + TgDQASA1MVpwzwAAAABJRU5ErkJggg== + + + \ No newline at end of file diff --git a/FishFactory/Program.cs b/FishFactory/Program.cs new file mode 100644 index 0000000..78294d3 --- /dev/null +++ b/FishFactory/Program.cs @@ -0,0 +1,17 @@ +namespace FishFactory +{ + 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 FormComponents()); + } + } +} \ No newline at end of file diff --git a/FishFactoryBusinessLogic/BusinessLogic/CannedLogic.cs b/FishFactoryBusinessLogic/BusinessLogic/CannedLogic.cs new file mode 100644 index 0000000..0461660 --- /dev/null +++ b/FishFactoryBusinessLogic/BusinessLogic/CannedLogic.cs @@ -0,0 +1,117 @@ +using FishFactoryContracts.BindingModels; +using FishFactoryContracts.SearchModels; +using FishFactoryContracts.StoragesContracts; +using FishFactoryContracts.ViewModels; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FishFactoryBusinessLogic.BusinessLogic +{ + internal class CannedLogic + { + private readonly ILogger _logger; + private readonly ICannedStorage _cannedStorage; + public CannedLogic(ILogger logger, ICannedStorage + cannedStorage) + { + _logger = logger; + _cannedStorage = cannedStorage; + } + public List? ReadList(CannedSearchModel? model) + { + _logger.LogInformation("ReadList. CannedName:{CannedName}.Id:{Id}", model?.CannedName, model?.Id); + var list = model == null ? _cannedStorage.GetFullList() : _cannedStorage.GetFilteredList(model); + if (list == null) + { + _logger.LogWarning("ReadList return null list"); + return null; + } + _logger.LogInformation("ReadList. Count:{Count}", list.Count); + return list; + } + + public CannedViewModel? ReadElement(CannedSearchModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + _logger.LogInformation("ReadElement. CannedName:{CannedName}.Id:{Id}", model.CannedName, model.Id); + var element = _cannedStorage.GetElement(model); + if (element == null) + { + _logger.LogWarning("ReadElement element not found"); + return null; + } + _logger.LogInformation("ReadElement find. Id:{Id}", element.Id); + return element; + } + + public bool Create(CannedBindingModel model) + { + CheckModel(model); + if (_cannedStorage.Insert(model) == null) + { + _logger.LogWarning("Insert operation failed"); + return false; + } + return true; + } + + public bool Update(CannedBindingModel model) + { + CheckModel(model); + if (_cannedStorage.Update(model) == null) + { + _logger.LogWarning("Update operation failed"); + return false; + } + return true; + } + + public bool Delete(CannedBindingModel model) + { + CheckModel(model, false); + _logger.LogInformation("Delete. Id:{Id}", model.Id); + if (_cannedStorage.Delete(model) == null) + { + _logger.LogWarning("Delete operation failed"); + return false; + } + return true; + } + + private void CheckModel(CannedBindingModel model, bool withParams = true) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + if (!withParams) + { + return; + } + if (string.IsNullOrEmpty(model.CannedName)) + { + throw new ArgumentNullException("Нет названия изделия", nameof(model.CannedName)); + } + if (model.Price <= 0) + { + throw new ArgumentNullException("Цена изделия должна быть больше 0", nameof(model.Price)); + } + _logger.LogInformation("Canned. CannedName:{CannedName}.Price:{Cost}. Id: {Id}", model.CannedName, model.Price, model.Id); + var element = _cannedStorage.GetElement(new CannedSearchModel + { + CannedName = model.CannedName + }); + if (element != null && element.Id != model.Id) + { + throw new InvalidOperationException("Изделие с таким названием уже есть"); + } + } + } +} diff --git a/FishFactoryBusinessLogic/BusinessLogic/ComponentLogic.cs b/FishFactoryBusinessLogic/BusinessLogic/ComponentLogic.cs new file mode 100644 index 0000000..c1395c4 --- /dev/null +++ b/FishFactoryBusinessLogic/BusinessLogic/ComponentLogic.cs @@ -0,0 +1,113 @@ +using FishFactoryContracts.BindingModels; +using FishFactoryContracts.BusinessLogicsContracts; +using FishFactoryContracts.SearchModels; +using FishFactoryContracts.StoragesContracts; +using FishFactoryContracts.ViewModels; +using Microsoft.Extensions.Logging; + +namespace FishFactoryBusinessLogic.BusinessLogic +{ + public class ComponentLogic : IComponentLogic + { + private readonly ILogger _logger; + private readonly IComponentStorage _componentStorage; + public ComponentLogic(ILogger logger, IComponentStorage + componentStorage) + { + _logger = logger; + _componentStorage = componentStorage; + } + public List? ReadList(ComponentSearchModel? model) + { + _logger.LogInformation("ReadList. ComponentName:{ComponentName}.Id:{Id}", model?.ComponentName, model?.Id); + var list = model == null ? _componentStorage.GetFullList() : _componentStorage.GetFilteredList(model); + if (list == null) + { + _logger.LogWarning("ReadList return null list"); + return null; + } + _logger.LogInformation("ReadList. Count:{Count}", list.Count); + return list; + } + + public ComponentViewModel? ReadElement(ComponentSearchModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + _logger.LogInformation("ReadElement. ComponentName:{ComponentName}.Id:{Id}", model.ComponentName, model.Id); + var element = _componentStorage.GetElement(model); + if (element == null) + { + _logger.LogWarning("ReadElement element not found"); + return null; + } + _logger.LogInformation("ReadElement find. Id:{Id}", element.Id); + return element; + } + + public bool Create(ComponentBindingModel model) + { + CheckModel(model); + if (_componentStorage.Insert(model) == null) + { + _logger.LogWarning("Insert operation failed"); + return false; + } + return true; + } + + public bool Update(ComponentBindingModel model) + { + CheckModel(model); + if (_componentStorage.Update(model) == null) + { + _logger.LogWarning("Update operation failed"); + return false; + } + return true; + } + + public bool Delete(ComponentBindingModel model) + { + CheckModel(model, false); + _logger.LogInformation("Delete. Id:{Id}", model.Id); + if (_componentStorage.Delete(model) == null) + { + _logger.LogWarning("Delete operation failed"); + return false; + } + return true; + } + + private void CheckModel(ComponentBindingModel model, bool withParams = true) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + if (!withParams) + { + return; + } + if (string.IsNullOrEmpty(model.ComponentName)) + { + throw new ArgumentNullException("Нет названия компонента", nameof(model.ComponentName)); + } + if (model.Cost <= 0) + { + throw new ArgumentNullException("Цена компонента должна быть больше 0", nameof(model.Cost)); + } + _logger.LogInformation("Component. ComponentName:{ComponentName}.Cost:{Cost}. Id: {Id}", model.ComponentName, model.Cost, model.Id); + var element = _componentStorage.GetElement(new ComponentSearchModel + { + ComponentName = model.ComponentName + }); + if (element != null && element.Id != model.Id) + { + throw new InvalidOperationException("Компонент с таким названием уже есть"); + } + } + } +} \ No newline at end of file diff --git a/FishFactoryBusinessLogic/BusinessLogic/OrderLogic.cs b/FishFactoryBusinessLogic/BusinessLogic/OrderLogic.cs new file mode 100644 index 0000000..b402f5c --- /dev/null +++ b/FishFactoryBusinessLogic/BusinessLogic/OrderLogic.cs @@ -0,0 +1,132 @@ +using FishFactoryContracts.BindingModels; +using FishFactoryContracts.SearchModels; +using FishFactoryContracts.StoragesContracts; +using FishFactoryContracts.ViewModels; +using FishFactoryDataModel.Enums; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FishFactoryBusinessLogic.BusinessLogic +{ + internal class OrderLogic + { + //Класс с логикой для заказов будет отвечать за получение списка заказов, + //создания заказа и смены его статусов. Следует учитывать, что у заказа можно + //менять статус на новый, если его текущий статус предшествует новому + + private readonly ILogger _logger; + private readonly IOrderStorage _orderStorage; + + public OrderLogic(ILogger logger, IOrderStorage orderStorage) + { + _logger = logger; + _orderStorage = orderStorage; + } + + public List? ReadList(OrderSearchModel? model) + { + _logger.LogInformation("ReadList. Id:{Id}", model?.Id); + var list = model == null ? _orderStorage.GetFullList() : _orderStorage.GetFilteredList(model); + if (list == null) + { + _logger.LogWarning("ReadList return null list"); + return null; + } + _logger.LogInformation("ReadList. Count:{Count}", list.Count); + return list; + } + + //public OrderViewModel? ReadElement(OrderSearchModel model) + //{ + // if (model == null) + // { + // throw new ArgumentNullException(nameof(model)); + // } + // _logger.LogInformation("ReadElement. OrderName:{OrderName}.Id:{Id}", model.OrderName, model.Id); + // var element = _orderStorage.GetElement(model); + // if (element == null) + // { + // _logger.LogWarning("ReadElement element not found"); + // return null; + // } + // _logger.LogInformation("ReadElement find. Id:{Id}", element.Id); + // return element; + //} + + public bool Create(OrderBindingModel model) + { + CheckModel(model); + + model.Status = OrderStatus.Принят; + + if (_orderStorage.Insert(model) == null) + { + model.Status = OrderStatus.Неизвестен; + _logger.LogWarning("Insert operation failed"); + return false; + } + return true; + } + + public bool ToNextStatus(OrderBindingModel model, OrderStatus orderStatus) + { + CheckModel(model); + if (model.Status != orderStatus - 1) + { + _logger.LogWarning("Status update to " + orderStatus + " operation failed"); + return false; + } + model.Status = orderStatus; + + if (model.Status == OrderStatus.Выдан) + { + model.DateImplement = DateTime.Now; + } + + if (_orderStorage.Update(model) == null) + { + model.Status--; + _logger.LogWarning("Update operation failed"); + return false; + } + + return true; + } + + public bool Update(OrderBindingModel model) + { + CheckModel(model); + if (_orderStorage.Update(model) == null) + { + _logger.LogWarning("Update operation failed"); + return false; + } + return true; + } + + private void CheckModel(OrderBindingModel model, bool withParams = true) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + if (!withParams) + { + return; + } + if (model.Count <= 0) + { + throw new ArgumentNullException("Количество изделий должно быть больше 0", nameof(model.Count)); + } + if (model.Sum <= 0) + { + throw new ArgumentNullException("Цена заказа должна быть больше 0", nameof(model.Sum)); + } + _logger.LogInformation("Order. OrderName: {Count}.Price: {Sum}. Id: {Id}", model.Count, model.Sum, model.Id); + } + } +} diff --git a/FishFactoryBusinessLogic/FishFactoryBusinessLogic.csproj b/FishFactoryBusinessLogic/FishFactoryBusinessLogic.csproj new file mode 100644 index 0000000..8e4ec11 --- /dev/null +++ b/FishFactoryBusinessLogic/FishFactoryBusinessLogic.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + enable + AnyCPU;x86 + + + + + + + + + + + + + + diff --git a/FishFactoryBusinessLogic/FishFactoryBusinessLogic.sln b/FishFactoryBusinessLogic/FishFactoryBusinessLogic.sln new file mode 100644 index 0000000..7af1517 --- /dev/null +++ b/FishFactoryBusinessLogic/FishFactoryBusinessLogic.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34221.43 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FishFactoryBusinessLogic", "FishFactoryBusinessLogic.csproj", "{F53A9BF5-75C6-4FF9-9ED4-BBA97FD69821}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F53A9BF5-75C6-4FF9-9ED4-BBA97FD69821}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F53A9BF5-75C6-4FF9-9ED4-BBA97FD69821}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F53A9BF5-75C6-4FF9-9ED4-BBA97FD69821}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F53A9BF5-75C6-4FF9-9ED4-BBA97FD69821}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D960332E-C650-4257-BFAE-24B1CC861696} + EndGlobalSection +EndGlobal diff --git a/FishFactoryContracts/BindingModels/CannedBindingModel.cs b/FishFactoryContracts/BindingModels/CannedBindingModel.cs new file mode 100644 index 0000000..8ac2035 --- /dev/null +++ b/FishFactoryContracts/BindingModels/CannedBindingModel.cs @@ -0,0 +1,17 @@ +using FishFactoryDataModel.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FishFactoryContracts.BindingModels +{ + public class CannedBindingModel : ICannedModel + { + public int Id { get; set; } + public string CannedName { get; set; } = string.Empty; + public double Price { get; set; } + public Dictionary CannedComponents { get; set; } = new(); + } +} diff --git a/FishFactoryContracts/BindingModels/ComponentBindingModel.cs b/FishFactoryContracts/BindingModels/ComponentBindingModel.cs new file mode 100644 index 0000000..9801150 --- /dev/null +++ b/FishFactoryContracts/BindingModels/ComponentBindingModel.cs @@ -0,0 +1,16 @@ +using FishFactoryDataModel.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FishFactoryContracts.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/FishFactoryContracts/BindingModels/OrderBindingModel.cs b/FishFactoryContracts/BindingModels/OrderBindingModel.cs new file mode 100644 index 0000000..6db918d --- /dev/null +++ b/FishFactoryContracts/BindingModels/OrderBindingModel.cs @@ -0,0 +1,21 @@ +using FishFactoryDataModel.Enums; +using FishFactoryDataModel.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FishFactoryContracts.BindingModels +{ + public class OrderBindingModel : IOrderModel + { + public int Id { get; set; } + public int CannedId { 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/FishFactoryContracts/BusinessLogicsContracts/ICannedLogic.cs b/FishFactoryContracts/BusinessLogicsContracts/ICannedLogic.cs new file mode 100644 index 0000000..c2c609d --- /dev/null +++ b/FishFactoryContracts/BusinessLogicsContracts/ICannedLogic.cs @@ -0,0 +1,20 @@ +using FishFactoryContracts.BindingModels; +using FishFactoryContracts.SearchModels; +using FishFactoryContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FishFactoryContracts.BusinessLogicsContracts +{ + public interface ICannedLogic + { + List? ReadList(CannedSearchModel? model); + CannedViewModel? ReadElement(CannedSearchModel model); + bool Create(CannedBindingModel model); + bool Update(CannedBindingModel model); + bool Delete(CannedBindingModel model); + } +} diff --git a/FishFactoryContracts/BusinessLogicsContracts/IComponentLogic.cs b/FishFactoryContracts/BusinessLogicsContracts/IComponentLogic.cs new file mode 100644 index 0000000..c2bcf3b --- /dev/null +++ b/FishFactoryContracts/BusinessLogicsContracts/IComponentLogic.cs @@ -0,0 +1,21 @@ +using FishFactoryContracts.BindingModels; +using FishFactoryContracts.SearchModels; +using FishFactoryContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FishFactoryContracts.BusinessLogicsContracts +{ + public interface IComponentLogic + { + List? ReadList(ComponentSearchModel? model); + ComponentViewModel? ReadElement(ComponentSearchModel model); + bool Create(ComponentBindingModel model); + bool Update(ComponentBindingModel model); + bool Delete(ComponentBindingModel model); + } +} diff --git a/FishFactoryContracts/BusinessLogicsContracts/IOrderLogic.cs b/FishFactoryContracts/BusinessLogicsContracts/IOrderLogic.cs new file mode 100644 index 0000000..958cdc8 --- /dev/null +++ b/FishFactoryContracts/BusinessLogicsContracts/IOrderLogic.cs @@ -0,0 +1,30 @@ +using FishFactoryContracts.BindingModels; +using FishFactoryContracts.SearchModels; +using FishFactoryContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FishFactoryContracts.BusinessLogicsContracts +{ + public interface IOrderLogic + { + List? ReadList(OrderSearchModel? model); + bool CreateOrder(OrderBindingModel model); + bool TakeOrderInWork(OrderBindingModel model); + /// + /// Готов + /// + /// + /// + bool FinishOrder(OrderBindingModel model); + /// + /// Доставлен + /// + /// + /// + bool DeliveryOrder(OrderBindingModel model); + } +} diff --git a/FishFactoryContracts/FishFactoryContracts.csproj b/FishFactoryContracts/FishFactoryContracts.csproj new file mode 100644 index 0000000..5cfa980 --- /dev/null +++ b/FishFactoryContracts/FishFactoryContracts.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + AnyCPU;x86 + + + + + + + diff --git a/FishFactoryContracts/SearchModels/CannedSearchModel.cs b/FishFactoryContracts/SearchModels/CannedSearchModel.cs new file mode 100644 index 0000000..58fdce0 --- /dev/null +++ b/FishFactoryContracts/SearchModels/CannedSearchModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FishFactoryContracts.SearchModels +{ + public class CannedSearchModel + { + public int? Id { get; set; } + public string? CannedName { get; set; } + } +} diff --git a/FishFactoryContracts/SearchModels/ComponentSearchModel.cs b/FishFactoryContracts/SearchModels/ComponentSearchModel.cs new file mode 100644 index 0000000..cdff7b4 --- /dev/null +++ b/FishFactoryContracts/SearchModels/ComponentSearchModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FishFactoryContracts.SearchModels +{ + public class ComponentSearchModel + { + public int? Id { get; set; } + public string? ComponentName { get; set; } + } +} diff --git a/FishFactoryContracts/SearchModels/OrderSearchModel.cs b/FishFactoryContracts/SearchModels/OrderSearchModel.cs new file mode 100644 index 0000000..895b7e1 --- /dev/null +++ b/FishFactoryContracts/SearchModels/OrderSearchModel.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FishFactoryContracts.SearchModels +{ + public class OrderSearchModel + { + public int? Id { get; set; } + } +} diff --git a/FishFactoryContracts/StoragesContracts/ICannedStorage.cs b/FishFactoryContracts/StoragesContracts/ICannedStorage.cs new file mode 100644 index 0000000..1d36d35 --- /dev/null +++ b/FishFactoryContracts/StoragesContracts/ICannedStorage.cs @@ -0,0 +1,21 @@ +using FishFactoryContracts.BindingModels; +using FishFactoryContracts.SearchModels; +using FishFactoryContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FishFactoryContracts.StoragesContracts +{ + public interface ICannedStorage + { + List GetFullList(); + List GetFilteredList(CannedSearchModel model); + CannedViewModel? GetElement(CannedSearchModel model); + CannedViewModel? Insert(CannedBindingModel model); + CannedViewModel? Update(CannedBindingModel model); + CannedViewModel? Delete(CannedBindingModel model); + } +} diff --git a/FishFactoryContracts/StoragesContracts/IComponentStorage.cs b/FishFactoryContracts/StoragesContracts/IComponentStorage.cs new file mode 100644 index 0000000..37b23d8 --- /dev/null +++ b/FishFactoryContracts/StoragesContracts/IComponentStorage.cs @@ -0,0 +1,22 @@ +using FishFactoryContracts.BindingModels; +using FishFactoryContracts.SearchModels; +using FishFactoryContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FishFactoryContracts.StoragesContracts +{ + public interface IComponentStorage + { + List GetFullList(); + List GetFilteredList(ComponentSearchModel model); + ComponentViewModel? GetElement(ComponentSearchModel model); + ComponentViewModel? Insert(ComponentBindingModel model); + ComponentViewModel? Update(ComponentBindingModel model); + ComponentViewModel? Delete(ComponentBindingModel model); + + } +} diff --git a/FishFactoryContracts/StoragesContracts/IOrderStorage.cs b/FishFactoryContracts/StoragesContracts/IOrderStorage.cs new file mode 100644 index 0000000..1f385c5 --- /dev/null +++ b/FishFactoryContracts/StoragesContracts/IOrderStorage.cs @@ -0,0 +1,21 @@ +using FishFactoryContracts.BindingModels; +using FishFactoryContracts.SearchModels; +using FishFactoryContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FishFactoryContracts.StoragesContracts +{ + public interface IOrderStorage + { + List GetFullList(); + List GetFilteredList(OrderSearchModel model); + OrderViewModel? GetElement(OrderSearchModel model); + OrderViewModel? Insert(OrderBindingModel model); + OrderViewModel? Update(OrderBindingModel model); + OrderViewModel? Delete(OrderBindingModel model); + } +} diff --git a/FishFactoryContracts/ViewModels/CannedViewModel.cs b/FishFactoryContracts/ViewModels/CannedViewModel.cs new file mode 100644 index 0000000..20b2012 --- /dev/null +++ b/FishFactoryContracts/ViewModels/CannedViewModel.cs @@ -0,0 +1,21 @@ +using FishFactoryDataModel.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FishFactoryContracts.ViewModels +{ + public class CannedViewModel : ICannedModel + { + public int Id { get; set; } + [DisplayName("Название изделия")] + public string CannedName { get; set; } + [DisplayName("Цена")] + public double Price { get; set; } + public Dictionary CannedComponents { get; set; } = new(); + + } +} diff --git a/FishFactoryContracts/ViewModels/ComponentViewModel.cs b/FishFactoryContracts/ViewModels/ComponentViewModel.cs new file mode 100644 index 0000000..1d54793 --- /dev/null +++ b/FishFactoryContracts/ViewModels/ComponentViewModel.cs @@ -0,0 +1,19 @@ +using FishFactoryDataModel.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FishFactoryContracts.ViewModels +{ + public class ComponentViewModel : IComponentModel + { + public int Id { get; set; } + [DisplayName("Название компонента")] + public string ComponentName { get; set; } = string.Empty; + [DisplayName("Цена")] + public double Cost { get; set; } + } +} diff --git a/FishFactoryContracts/ViewModels/OrderViewModel.cs b/FishFactoryContracts/ViewModels/OrderViewModel.cs new file mode 100644 index 0000000..dd737a8 --- /dev/null +++ b/FishFactoryContracts/ViewModels/OrderViewModel.cs @@ -0,0 +1,29 @@ +using FishFactoryDataModel.Enums; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FishFactoryContracts.ViewModels +{ + public class OrderViewModel + { + [DisplayName("Номер")] + public int Id { get; set; } + public int CannedId { get; set; } + [DisplayName("Изделие")] + public string CannedName { get; set; } = string.Empty; + [DisplayName("Количество")] + public int Count { get; set; } + [DisplayName("Сумма")] + public double Sum { get; set; } + [DisplayName("Статус")] + public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; + [DisplayName("Дата создания")] + public DateTime DateCreate { get; set; } = DateTime.Now; + [DisplayName("Дата выполнения")] + public DateTime? DateImplement { get; set; } + } +} diff --git a/FishFactoryDataModels/Enums/OrderStatus.cs b/FishFactoryDataModels/Enums/OrderStatus.cs new file mode 100644 index 0000000..8c62903 --- /dev/null +++ b/FishFactoryDataModels/Enums/OrderStatus.cs @@ -0,0 +1,11 @@ +namespace FishFactoryDataModel.Enums +{ + public enum OrderStatus + { + Неизвестен = -1, + Принят = 0, + Выполняется = 1, + Готов = 2, + Выдан = 3, + } +} \ No newline at end of file diff --git a/FishFactoryDataModels/FishFactoryDataModel.csproj b/FishFactoryDataModels/FishFactoryDataModel.csproj new file mode 100644 index 0000000..e30cfc1 --- /dev/null +++ b/FishFactoryDataModels/FishFactoryDataModel.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + AnyCPU;x86 + + + + + + + diff --git a/FishFactoryDataModels/FishFactoryDataModel.sln b/FishFactoryDataModels/FishFactoryDataModel.sln new file mode 100644 index 0000000..a2c0987 --- /dev/null +++ b/FishFactoryDataModels/FishFactoryDataModel.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34221.43 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FishFactoryDataModel", "FishFactoryDataModel.csproj", "{123815B3-D77F-448B-95D5-3305322924E8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {123815B3-D77F-448B-95D5-3305322924E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {123815B3-D77F-448B-95D5-3305322924E8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {123815B3-D77F-448B-95D5-3305322924E8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {123815B3-D77F-448B-95D5-3305322924E8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {EC740998-3164-4145-86EC-FE2BDBF8E631} + EndGlobalSection +EndGlobal diff --git a/FishFactoryDataModels/IId.cs b/FishFactoryDataModels/IId.cs new file mode 100644 index 0000000..e973e7f --- /dev/null +++ b/FishFactoryDataModels/IId.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FishFactoryDataModel +{ + public interface IId + { + int Id { get; } + } +} diff --git a/FishFactoryDataModels/Models/ICannedModel.cs b/FishFactoryDataModels/Models/ICannedModel.cs new file mode 100644 index 0000000..09e5405 --- /dev/null +++ b/FishFactoryDataModels/Models/ICannedModel.cs @@ -0,0 +1,9 @@ +namespace FishFactoryDataModel.Models +{ + public interface ICannedModel : IId + { + string CannedName { get; } + double Price { get; } + Dictionary CannedComponents { get; } + } +} \ No newline at end of file diff --git a/FishFactoryDataModels/Models/IComponentModel.cs b/FishFactoryDataModels/Models/IComponentModel.cs new file mode 100644 index 0000000..7692ca2 --- /dev/null +++ b/FishFactoryDataModels/Models/IComponentModel.cs @@ -0,0 +1,8 @@ +namespace FishFactoryDataModel.Models +{ + public interface IComponentModel : IId + { + string ComponentName { get; } + double Cost { get; } + } +} \ No newline at end of file diff --git a/FishFactoryDataModels/Models/IOrderModel.cs b/FishFactoryDataModels/Models/IOrderModel.cs new file mode 100644 index 0000000..445fdce --- /dev/null +++ b/FishFactoryDataModels/Models/IOrderModel.cs @@ -0,0 +1,14 @@ +using FishFactoryDataModel.Enums; + +namespace FishFactoryDataModel.Models +{ + public interface IOrderModel : IId + { + int CannedId { get; } + int Count { get; } + double Sum { get; } + OrderStatus Status { get; } + DateTime DateCreate { get; } + DateTime? DateImplement { get; } + } +} \ No newline at end of file diff --git a/FishFactoryListImplement/DataListSingleton.cs b/FishFactoryListImplement/DataListSingleton.cs new file mode 100644 index 0000000..fd86094 --- /dev/null +++ b/FishFactoryListImplement/DataListSingleton.cs @@ -0,0 +1,31 @@ +using FishFactoryListImplement.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FishFactoryListImplement +{ + internal class DataListSingleton + { + private static DataListSingleton? _instance; + public List Components { get; set; } + public List Orders { get; set; } + public List Canneds { get; set; } + private DataListSingleton() + { + Components = new List(); + Orders = new List(); + Canneds = new List(); + } + public static DataListSingleton GetInstance() + { + if (_instance == null) + { + _instance = new DataListSingleton(); + } + return _instance; + } + } +} diff --git a/FishFactoryListImplement/FishFactoryListImplement.csproj b/FishFactoryListImplement/FishFactoryListImplement.csproj new file mode 100644 index 0000000..a59355a --- /dev/null +++ b/FishFactoryListImplement/FishFactoryListImplement.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + AnyCPU;x86 + + + + + + + + + + + + diff --git a/FishFactoryListImplement/FishFactoryListImplement.sln b/FishFactoryListImplement/FishFactoryListImplement.sln new file mode 100644 index 0000000..12d0fc5 --- /dev/null +++ b/FishFactoryListImplement/FishFactoryListImplement.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34221.43 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FishFactoryListImplement", "FishFactoryListImplement.csproj", "{01F5CC32-83EE-4C6F-BC69-73ACD43F57A2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {01F5CC32-83EE-4C6F-BC69-73ACD43F57A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {01F5CC32-83EE-4C6F-BC69-73ACD43F57A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {01F5CC32-83EE-4C6F-BC69-73ACD43F57A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {01F5CC32-83EE-4C6F-BC69-73ACD43F57A2}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A85A2A29-7EC9-4061-8815-30C34307388F} + EndGlobalSection +EndGlobal diff --git a/FishFactoryListImplement/Models/Canned.cs b/FishFactoryListImplement/Models/Canned.cs new file mode 100644 index 0000000..511edcf --- /dev/null +++ b/FishFactoryListImplement/Models/Canned.cs @@ -0,0 +1,55 @@ +using FishFactoryContracts.BindingModels; +using FishFactoryContracts.ViewModels; +using FishFactoryDataModel.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FishFactoryListImplement.Models +{ + internal class Canned : ICannedModel + { + public int Id { get; private set; } + public string CannedName { get; private set; } = string.Empty; + public double Price { get; private set; } + public Dictionary CannedComponents + { + get; + private set; + } = new Dictionary(); + public static Canned? Create(CannedBindingModel? model) + { + if (model == null) + { + return null; + } + return new Canned() + { + Id = model.Id, + CannedName = model.CannedName, + Price = model.Price, + CannedComponents = model.CannedComponents + }; + } + public void Update(CannedBindingModel? model) + { + if (model == null) + { + return; + } + CannedName = model.CannedName; + Price = model.Price; + CannedComponents = model.CannedComponents; + } + public CannedViewModel GetViewModel => new() + { + Id = Id, + CannedName = CannedName, + Price = Price, + CannedComponents = CannedComponents + }; + + } +} diff --git a/FishFactoryListImplement/Models/Component.cs b/FishFactoryListImplement/Models/Component.cs new file mode 100644 index 0000000..5d38db3 --- /dev/null +++ b/FishFactoryListImplement/Models/Component.cs @@ -0,0 +1,41 @@ +using FishFactoryContracts.BindingModels; +using FishFactoryContracts.ViewModels; +using FishFactoryDataModel.Models; + +namespace FishFactoryListImplement.Models +{ + public class Component : IComponentModel + { + public int Id { get; private set; } + public string ComponentName { get; private set; } = string.Empty; + public double Cost { get; set; } + public static Component? Create(ComponentBindingModel? model) + { + if (model == null) + { + return null; + } + return new Component() + { + Id = model.Id, + ComponentName = model.ComponentName, + Cost = model.Cost + }; + } + public void Update(ComponentBindingModel? model) + { + if (model == null) + { + return; + } + ComponentName = model.ComponentName; + Cost = model.Cost; + } + public ComponentViewModel GetViewModel => new() + { + Id = Id, + ComponentName = ComponentName, + Cost = Cost + }; + } +} \ No newline at end of file diff --git a/FishFactoryListImplement/Models/Order.cs b/FishFactoryListImplement/Models/Order.cs new file mode 100644 index 0000000..9bd34d4 --- /dev/null +++ b/FishFactoryListImplement/Models/Order.cs @@ -0,0 +1,64 @@ +using FishFactoryContracts.BindingModels; +using FishFactoryContracts.ViewModels; +using FishFactoryDataModel.Enums; +using FishFactoryDataModel.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace FishFactoryListImplement.Models +{ + public class Order : IOrderModel + { + public int Id { get; private set; } + public int CannedId { get; private set; } + public int Count { get; private set; } + public double Sum { get; private set; } + public OrderStatus Status { get; private set; } + public DateTime DateCreate { get; private set; } + public DateTime? DateImplement { get; private set; } + public static Order? Create(OrderBindingModel? model) + { + if (model == null) + { + return null; + } + return new Order() + { + Id = model.Id, + CannedId = model.CannedId, + Count = model.Count, + Sum = model.Sum, + Status = model.Status, + DateCreate = model.DateCreate, + DateImplement = model.DateImplement, + }; + } + public void Update(OrderBindingModel? model) + { + if (model == null) + { + return; + } + CannedId = model.CannedId; + Count = model.Count; + Sum = model.Sum; + Status = model.Status; + DateCreate = model.DateCreate; + DateImplement = model.DateImplement; + } + public OrderViewModel GetViewModel => new() + { + Id = Id, + CannedId = CannedId, + Count = Count, + Sum = Sum, + Status = Status, + DateCreate = DateCreate, + DateImplement = DateImplement, + }; + } +}