Лабораторная работа №3

This commit is contained in:
dvdice 2024-10-07 22:08:55 +04:00
parent 2f15e73408
commit 113919a6ac
12 changed files with 184 additions and 118 deletions

View File

@ -12,8 +12,13 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftwareInstallationBusinessLogic", "SoftwareInstallationBusinessLogic\SoftwareInstallationBusinessLogic.csproj", "{AB30EAF3-FD89-4B1E-B826-0217877DD5FC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftwareInstallationView", "SoftwareInstallationView\SoftwareInstallationView.csproj", "{EB5E1375-60CA-40CD-9AD6-9C7B1D3C4458}"
ProjectSection(ProjectDependencies) = postProject
{DB624074-9CF3-48D9-88B4-8C8211683287} = {DB624074-9CF3-48D9-88B4-8C8211683287}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SoftwareInstallationFileImplement", "SoftwareInstallationFileImplement\SoftwareInstallationFileImplement.csproj", "{62577A1E-CE13-4232-90B4-B615A9A77DB0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftwareInstallationFileImplement", "SoftwareInstallationFileImplement\SoftwareInstallationFileImplement.csproj", "{62577A1E-CE13-4232-90B4-B615A9A77DB0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SoftwareInstallationDatabaseImplement", "SoftwareInstallationDatabaseImplement\SoftwareInstallationDatabaseImplement.csproj", "{DB624074-9CF3-48D9-88B4-8C8211683287}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -45,6 +50,10 @@ Global
{62577A1E-CE13-4232-90B4-B615A9A77DB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{62577A1E-CE13-4232-90B4-B615A9A77DB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{62577A1E-CE13-4232-90B4-B615A9A77DB0}.Release|Any CPU.Build.0 = Release|Any CPU
{DB624074-9CF3-48D9-88B4-8C8211683287}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DB624074-9CF3-48D9-88B4-8C8211683287}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DB624074-9CF3-48D9-88B4-8C8211683287}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DB624074-9CF3-48D9-88B4-8C8211683287}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -1,7 +1,7 @@
using SoftwareInstallationFileImplement.Models;
using SoftwareInstallationDatabaseImplement.Models;
using System.Xml.Linq;
namespace SoftwareInstallationFileImplement
namespace SoftwareInstallationDatabaseImplement
{
internal class DataFileSingleton
{

View File

@ -2,9 +2,9 @@
using SoftwareInstallationContracts.SearchModels;
using SoftwareInstallationContracts.StoragesContracts;
using SoftwareInstallationContracts.ViewModels;
using SoftwareInstallationFileImplement.Models;
using SoftwareInstallationDatabaseImplement.Models;
namespace SoftwareInstallationFileImplement.Implements
namespace SoftwareInstallationDatabaseImplement.Implements
{
public class ComponentStorage : IComponentStorage
{

View File

@ -2,9 +2,9 @@
using SoftwareInstallationContracts.SearchModels;
using SoftwareInstallationContracts.StoragesContracts;
using SoftwareInstallationContracts.ViewModels;
using SoftwareInstallationFileImplement.Models;
using SoftwareInstallationDatabaseImplement.Models;
namespace SoftwareInstallationFileImplement.Implements
namespace SoftwareInstallationDatabaseImplement.Implements
{
public class OrderStorage : IOrderStorage
{

View File

@ -2,9 +2,9 @@
using SoftwareInstallationContracts.SearchModels;
using SoftwareInstallationContracts.StoragesContracts;
using SoftwareInstallationContracts.ViewModels;
using SoftwareInstallationFileImplement.Models;
using SoftwareInstallationDatabaseImplement.Models;
namespace SoftwareInstallationFileImplement.Implements
namespace SoftwareInstallationDatabaseImplement.Implements
{
public class PackageStorage : IPackageStorage
{

View File

@ -3,7 +3,7 @@ using SoftwareInstallationContracts.BindingModels;
using SoftwareInstallationContracts.ViewModels;
using SoftwareInstallationDataModel.Models;
namespace SoftwareInstallationFileImplement.Models
namespace SoftwareInstallationDatabaseImplement.Models
{
public class Component : IComponentModel
{

View File

@ -4,7 +4,7 @@ using SoftwareInstallationDataModel.Enums;
using SoftwareInstallationDataModel.Models;
using System.Xml.Linq;
namespace SoftwareInstallationFileImplement.Models
namespace SoftwareInstallationDatabaseImplement.Models
{
public class Order : IOrderModel
{

View File

@ -3,7 +3,7 @@ using SoftwareInstallationContracts.ViewModels;
using SoftwareInstallationDataModel.Models;
using System.Xml.Linq;
namespace SoftwareInstallationFileImplement.Models
namespace SoftwareInstallationDatabaseImplement.Models
{
public class Package : IPackageModel
{

View File

@ -28,141 +28,135 @@
/// </summary>
private void InitializeComponent()
{
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.справочникиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.packageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.componentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ButtonRef = new System.Windows.Forms.Button();
this.ButtonIssuedOrder = new System.Windows.Forms.Button();
this.ButtonOrderReady = new System.Windows.Forms.Button();
this.buttonTakeOrderInWork = new System.Windows.Forms.Button();
this.buttonCreateOrder = new System.Windows.Forms.Button();
this.dataGridView = new System.Windows.Forms.DataGridView();
this.menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
this.SuspendLayout();
menuStrip1 = new MenuStrip();
справочникиToolStripMenuItem = new ToolStripMenuItem();
packageToolStripMenuItem = new ToolStripMenuItem();
componentToolStripMenuItem = new ToolStripMenuItem();
ButtonRef = new Button();
ButtonIssuedOrder = new Button();
ButtonOrderReady = new Button();
buttonTakeOrderInWork = new Button();
buttonCreateOrder = new Button();
dataGridView = new DataGridView();
menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
SuspendLayout();
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.справочникиToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(1125, 24);
this.menuStrip1.TabIndex = 1;
this.menuStrip1.Text = "menuStrip1";
menuStrip1.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem });
menuStrip1.Location = new Point(0, 0);
menuStrip1.Name = "menuStrip1";
menuStrip1.Size = new Size(1125, 24);
menuStrip1.TabIndex = 1;
menuStrip1.Text = "menuStrip1";
//
// справочникиToolStripMenuItem
//
this.справочникиToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.packageToolStripMenuItem,
this.componentToolStripMenuItem});
this.справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem";
this.справочникиToolStripMenuItem.Size = new System.Drawing.Size(94, 20);
this.справочникиToolStripMenuItem.Text = "Справочники";
справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { packageToolStripMenuItem, componentToolStripMenuItem });
справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem";
справочникиToolStripMenuItem.Size = new Size(94, 20);
справочникиToolStripMenuItem.Text = "Справочники";
//
// packageToolStripMenuItem
//
this.packageToolStripMenuItem.Name = "packageToolStripMenuItem";
this.packageToolStripMenuItem.Size = new System.Drawing.Size(145, 22);
this.packageToolStripMenuItem.Text = "Изделия";
this.packageToolStripMenuItem.Click += new System.EventHandler(this.PackagesToolStripMenuItem_Click);
packageToolStripMenuItem.Name = "packageToolStripMenuItem";
packageToolStripMenuItem.Size = new Size(145, 22);
packageToolStripMenuItem.Text = "Изделия";
packageToolStripMenuItem.Click += PackagesToolStripMenuItem_Click;
//
// componentToolStripMenuItem
//
this.componentToolStripMenuItem.Name = "componentToolStripMenuItem";
this.componentToolStripMenuItem.Size = new System.Drawing.Size(145, 22);
this.componentToolStripMenuItem.Text = "Компоненты";
this.componentToolStripMenuItem.Click += new System.EventHandler(this.ComponentsToolStripMenuItem_Click);
componentToolStripMenuItem.Name = "componentToolStripMenuItem";
componentToolStripMenuItem.Size = new Size(145, 22);
componentToolStripMenuItem.Text = "Компоненты";
componentToolStripMenuItem.Click += ComponentsToolStripMenuItem_Click;
//
// ButtonRef
//
this.ButtonRef.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.ButtonRef.Location = new System.Drawing.Point(966, 374);
this.ButtonRef.Name = "ButtonRef";
this.ButtonRef.Size = new System.Drawing.Size(147, 55);
this.ButtonRef.TabIndex = 12;
this.ButtonRef.Text = "Обновить список";
this.ButtonRef.UseVisualStyleBackColor = true;
this.ButtonRef.Click += new System.EventHandler(this.ButtonRef_Click);
ButtonRef.Anchor = AnchorStyles.Top | AnchorStyles.Right;
ButtonRef.Location = new Point(966, 374);
ButtonRef.Name = "ButtonRef";
ButtonRef.Size = new Size(147, 55);
ButtonRef.TabIndex = 12;
ButtonRef.Text = "Обновить список";
ButtonRef.UseVisualStyleBackColor = true;
ButtonRef.Click += ButtonRef_Click;
//
// ButtonIssuedOrder
//
this.ButtonIssuedOrder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.ButtonIssuedOrder.Location = new System.Drawing.Point(966, 284);
this.ButtonIssuedOrder.Name = "ButtonIssuedOrder";
this.ButtonIssuedOrder.Size = new System.Drawing.Size(147, 55);
this.ButtonIssuedOrder.TabIndex = 11;
this.ButtonIssuedOrder.Text = "Заказ выдан";
this.ButtonIssuedOrder.UseVisualStyleBackColor = true;
this.ButtonIssuedOrder.Click += new System.EventHandler(this.ButtonIssuedOrder_Click);
ButtonIssuedOrder.Anchor = AnchorStyles.Top | AnchorStyles.Right;
ButtonIssuedOrder.Location = new Point(966, 284);
ButtonIssuedOrder.Name = "ButtonIssuedOrder";
ButtonIssuedOrder.Size = new Size(147, 55);
ButtonIssuedOrder.TabIndex = 11;
ButtonIssuedOrder.Text = "Заказ выдан";
ButtonIssuedOrder.UseVisualStyleBackColor = true;
ButtonIssuedOrder.Click += ButtonIssuedOrder_Click;
//
// ButtonOrderReady
//
this.ButtonOrderReady.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.ButtonOrderReady.Location = new System.Drawing.Point(966, 194);
this.ButtonOrderReady.Name = "ButtonOrderReady";
this.ButtonOrderReady.Size = new System.Drawing.Size(147, 55);
this.ButtonOrderReady.TabIndex = 10;
this.ButtonOrderReady.Text = "Заказ готов";
this.ButtonOrderReady.UseVisualStyleBackColor = true;
this.ButtonOrderReady.Click += new System.EventHandler(this.ButtonOrderReady_Click);
ButtonOrderReady.Anchor = AnchorStyles.Top | AnchorStyles.Right;
ButtonOrderReady.Location = new Point(966, 194);
ButtonOrderReady.Name = "ButtonOrderReady";
ButtonOrderReady.Size = new Size(147, 55);
ButtonOrderReady.TabIndex = 10;
ButtonOrderReady.Text = "Заказ готов";
ButtonOrderReady.UseVisualStyleBackColor = true;
ButtonOrderReady.Click += ButtonOrderReady_Click;
//
// buttonTakeOrderInWork
//
this.buttonTakeOrderInWork.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonTakeOrderInWork.Location = new System.Drawing.Point(966, 112);
this.buttonTakeOrderInWork.Name = "buttonTakeOrderInWork";
this.buttonTakeOrderInWork.Size = new System.Drawing.Size(147, 55);
this.buttonTakeOrderInWork.TabIndex = 9;
this.buttonTakeOrderInWork.Text = "Отдать на выполнение";
this.buttonTakeOrderInWork.UseVisualStyleBackColor = true;
this.buttonTakeOrderInWork.Click += new System.EventHandler(this.ButtonTakeOrderInWork_Click);
buttonTakeOrderInWork.Anchor = AnchorStyles.Top | AnchorStyles.Right;
buttonTakeOrderInWork.Location = new Point(966, 112);
buttonTakeOrderInWork.Name = "buttonTakeOrderInWork";
buttonTakeOrderInWork.Size = new Size(147, 55);
buttonTakeOrderInWork.TabIndex = 9;
buttonTakeOrderInWork.Text = "Отдать на выполнение";
buttonTakeOrderInWork.UseVisualStyleBackColor = true;
buttonTakeOrderInWork.Click += ButtonTakeOrderInWork_Click;
//
// buttonCreateOrder
//
this.buttonCreateOrder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonCreateOrder.Location = new System.Drawing.Point(966, 27);
this.buttonCreateOrder.Name = "buttonCreateOrder";
this.buttonCreateOrder.Size = new System.Drawing.Size(147, 55);
this.buttonCreateOrder.TabIndex = 8;
this.buttonCreateOrder.Text = "Создать заказ";
this.buttonCreateOrder.UseVisualStyleBackColor = true;
this.buttonCreateOrder.Click += new System.EventHandler(this.ButtonCreateOrder_Click);
buttonCreateOrder.Anchor = AnchorStyles.Top | AnchorStyles.Right;
buttonCreateOrder.Location = new Point(966, 27);
buttonCreateOrder.Name = "buttonCreateOrder";
buttonCreateOrder.Size = new Size(147, 55);
buttonCreateOrder.TabIndex = 8;
buttonCreateOrder.Text = "Создать заказ";
buttonCreateOrder.UseVisualStyleBackColor = true;
buttonCreateOrder.Click += ButtonCreateOrder_Click;
//
// dataGridView
//
this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dataGridView.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight;
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView.Location = new System.Drawing.Point(12, 27);
this.dataGridView.Name = "dataGridView";
this.dataGridView.RowTemplate.Height = 25;
this.dataGridView.Size = new System.Drawing.Size(948, 402);
this.dataGridView.TabIndex = 7;
dataGridView.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
dataGridView.BackgroundColor = SystemColors.ButtonHighlight;
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView.Location = new Point(12, 27);
dataGridView.Name = "dataGridView";
dataGridView.Size = new Size(948, 402);
dataGridView.TabIndex = 7;
//
// FormMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1125, 441);
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.dataGridView);
this.Controls.Add(this.menuStrip1);
this.Name = "FormMain";
this.Text = "Установка ПО";
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1125, 441);
Controls.Add(ButtonRef);
Controls.Add(ButtonIssuedOrder);
Controls.Add(ButtonOrderReady);
Controls.Add(buttonTakeOrderInWork);
Controls.Add(buttonCreateOrder);
Controls.Add(dataGridView);
Controls.Add(menuStrip1);
Name = "FormMain";
Text = "Установка ПО";
Load += FormMain_Load;
menuStrip1.ResumeLayout(false);
menuStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion

View File

@ -1,4 +1,64 @@
<root>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">

View File

@ -4,8 +4,7 @@ using SoftwareInstallationContracts.StoragesContracts;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NLog.Extensions.Logging;
//using SoftwareInstallationListImplement.Implements;
using SoftwareInstallationFileImplement.Implements;
using SoftwareInstallationDataBaseImplement.Implements;
namespace SoftwareInstallationView
{

View File

@ -19,6 +19,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.12" />
@ -27,8 +31,8 @@
<ItemGroup>
<ProjectReference Include="..\SoftwareInstallationBusinessLogic\SoftwareInstallationBusinessLogic.csproj" />
<ProjectReference Include="..\SoftwareInstallationContracts\SoftwareInstallationContracts.csproj" />
<ProjectReference Include="..\SoftwareInstallationDatabaseImplement\SoftwareInstallationDatabaseImplement.csproj" />
<ProjectReference Include="..\SoftwareInstallationDataModel\SoftwareInstallationDataModel.csproj" />
<ProjectReference Include="..\SoftwareInstallationFileImplement\SoftwareInstallationFileImplement.csproj" />
<ProjectReference Include="..\SoftwareInstallationListImplement\SoftwareInstallationListImplement.csproj" />
</ItemGroup>