50%
25
ProjectWorkshop/Entities/Assembler.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using ProjectWorkshop.Entities.Enums;
|
||||
|
||||
namespace ProjectWorkshop.Entities;
|
||||
|
||||
public class Assembler
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
|
||||
public string FullName { get; private set; } = string.Empty;
|
||||
|
||||
public AssemblerRank AssemblerRank { get; private set; }
|
||||
|
||||
public DateTime WorkExperience { get; private set; }
|
||||
|
||||
public static Assembler CreateEntity(int id, string fullName, AssemblerRank assemblerRank)
|
||||
{
|
||||
return new Assembler
|
||||
{
|
||||
Id = id,
|
||||
FullName = fullName,
|
||||
WorkExperience = DateTime.Now,
|
||||
AssemblerRank = assemblerRank
|
||||
};
|
||||
}
|
||||
}
|
21
ProjectWorkshop/Entities/Assembly.cs
Normal file
@ -0,0 +1,21 @@
|
||||
namespace ProjectWorkshop.Entities;
|
||||
|
||||
public class Assembly
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
|
||||
public DateTime AssemblyDate { get; private set; }
|
||||
|
||||
public int AssemblerID { get; private set; }
|
||||
|
||||
public static Assembly CreateEntity(int id, int assemblerID)
|
||||
{
|
||||
return new Assembly()
|
||||
{
|
||||
Id = id,
|
||||
AssemblyDate = DateTime.Now,
|
||||
AssemblerID = assemblerID
|
||||
};
|
||||
}
|
||||
}
|
||||
|
12
ProjectWorkshop/Entities/Enums/AssemblerRank.cs
Normal file
@ -0,0 +1,12 @@
|
||||
namespace ProjectWorkshop.Entities.Enums;
|
||||
|
||||
public enum AssemblerRank
|
||||
{
|
||||
None = 0,
|
||||
|
||||
Ordinary = 1,
|
||||
|
||||
Senior = 2,
|
||||
|
||||
Head = 3
|
||||
}
|
13
ProjectWorkshop/Entities/Enums/ProductType.cs
Normal file
@ -0,0 +1,13 @@
|
||||
namespace ProjectWorkshop.Entities.Enums;
|
||||
|
||||
[Flags]
|
||||
public enum ProductType
|
||||
{
|
||||
None = 0,
|
||||
|
||||
Electronics = 1,
|
||||
|
||||
Furniture = 2,
|
||||
|
||||
CarParts = 4
|
||||
}
|
23
ProjectWorkshop/Entities/Product.cs
Normal file
@ -0,0 +1,23 @@
|
||||
namespace ProjectWorkshop.Entities;
|
||||
|
||||
public class Product
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
|
||||
public string ProductName { get; private set; } = string.Empty;
|
||||
|
||||
public double Price { get; private set; }
|
||||
|
||||
public int ProductTypeID { get; private set; }
|
||||
|
||||
public static Product CreateEntity(int id, string productName, double price, int productTypeID)
|
||||
{
|
||||
return new Product
|
||||
{
|
||||
Id = id,
|
||||
ProductName = productName ?? string.Empty,
|
||||
Price = price,
|
||||
ProductTypeID = productTypeID
|
||||
};
|
||||
}
|
||||
}
|
20
ProjectWorkshop/Entities/ProductAssembly.cs
Normal file
@ -0,0 +1,20 @@
|
||||
namespace ProjectWorkshop.Entities;
|
||||
|
||||
public class ProductAssembly
|
||||
{
|
||||
public int ProductId { get; private set; }
|
||||
|
||||
public int AssemblyID { get; private set; }
|
||||
|
||||
public int Count { get; private set; }
|
||||
|
||||
public static ProductAssembly CreateElement (int productID, int assemblyID, int count)
|
||||
{
|
||||
return new ProductAssembly()
|
||||
{
|
||||
ProductId = productID,
|
||||
AssemblyID = assemblyID,
|
||||
Count = count
|
||||
};
|
||||
}
|
||||
}
|
21
ProjectWorkshop/Entities/ProductTypeEntity.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using ProjectWorkshop.Entities.Enums;
|
||||
namespace ProjectWorkshop.Entities;
|
||||
|
||||
public class ProductTypeEntity
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
|
||||
public string Name { get; private set; } = string.Empty;
|
||||
|
||||
public ProductType ProductType { get; private set; }
|
||||
|
||||
public static ProductTypeEntity CreateElement(int id, string name, ProductType productType)
|
||||
{
|
||||
return new ProductTypeEntity
|
||||
{
|
||||
Id = id,
|
||||
Name = name ?? string.Empty,
|
||||
ProductType = productType
|
||||
};
|
||||
}
|
||||
}
|
39
ProjectWorkshop/Form1.Designer.cs
generated
@ -1,39 +0,0 @@
|
||||
namespace ProjectWorkshop
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Text = "Form1";
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
namespace ProjectWorkshop
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
132
ProjectWorkshop/FormWorkshop.Designer.cs
generated
Normal file
@ -0,0 +1,132 @@
|
||||
namespace ProjectWorkshop
|
||||
{
|
||||
partial class FormWorkshop
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
menuStrip = new MenuStrip();
|
||||
справочникиToolStripMenuItem = new ToolStripMenuItem();
|
||||
операцииToolStripMenuItem = new ToolStripMenuItem();
|
||||
отчетыToolStripMenuItem = new ToolStripMenuItem();
|
||||
сборщикиToolStripMenuItem = new ToolStripMenuItem();
|
||||
сборкиToolStripMenuItem = new ToolStripMenuItem();
|
||||
изделияToolStripMenuItem = new ToolStripMenuItem();
|
||||
сборкаToolStripMenuItem = new ToolStripMenuItem();
|
||||
назначитьСборщикаToolStripMenuItem = new ToolStripMenuItem();
|
||||
menuStrip.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// menuStrip
|
||||
//
|
||||
menuStrip.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, операцииToolStripMenuItem, отчетыToolStripMenuItem });
|
||||
menuStrip.Location = new Point(0, 0);
|
||||
menuStrip.Name = "menuStrip";
|
||||
menuStrip.Size = new Size(784, 24);
|
||||
menuStrip.TabIndex = 0;
|
||||
menuStrip.Text = "menuStrip";
|
||||
//
|
||||
// справочникиToolStripMenuItem
|
||||
//
|
||||
справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { сборщикиToolStripMenuItem, сборкиToolStripMenuItem, изделияToolStripMenuItem });
|
||||
справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem";
|
||||
справочникиToolStripMenuItem.Size = new Size(94, 20);
|
||||
справочникиToolStripMenuItem.Text = "Справочники";
|
||||
//
|
||||
// операцииToolStripMenuItem
|
||||
//
|
||||
операцииToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { сборкаToolStripMenuItem, назначитьСборщикаToolStripMenuItem });
|
||||
операцииToolStripMenuItem.Name = "операцииToolStripMenuItem";
|
||||
операцииToolStripMenuItem.Size = new Size(75, 20);
|
||||
операцииToolStripMenuItem.Text = "Операции";
|
||||
//
|
||||
// отчетыToolStripMenuItem
|
||||
//
|
||||
отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem";
|
||||
отчетыToolStripMenuItem.Size = new Size(60, 20);
|
||||
отчетыToolStripMenuItem.Text = "Отчеты";
|
||||
//
|
||||
// сборщикиToolStripMenuItem
|
||||
//
|
||||
сборщикиToolStripMenuItem.Name = "сборщикиToolStripMenuItem";
|
||||
сборщикиToolStripMenuItem.Size = new Size(180, 22);
|
||||
сборщикиToolStripMenuItem.Text = "Сборщики";
|
||||
//
|
||||
// сборкиToolStripMenuItem
|
||||
//
|
||||
сборкиToolStripMenuItem.Name = "сборкиToolStripMenuItem";
|
||||
сборкиToolStripMenuItem.Size = new Size(180, 22);
|
||||
сборкиToolStripMenuItem.Text = "Сборки";
|
||||
//
|
||||
// изделияToolStripMenuItem
|
||||
//
|
||||
изделияToolStripMenuItem.Name = "изделияToolStripMenuItem";
|
||||
изделияToolStripMenuItem.Size = new Size(180, 22);
|
||||
изделияToolStripMenuItem.Text = "Изделия";
|
||||
//
|
||||
// сборкаToolStripMenuItem
|
||||
//
|
||||
сборкаToolStripMenuItem.Name = "сборкаToolStripMenuItem";
|
||||
сборкаToolStripMenuItem.Size = new Size(180, 22);
|
||||
сборкаToolStripMenuItem.Text = "Сборка";
|
||||
//
|
||||
// назначитьСборщикаToolStripMenuItem
|
||||
//
|
||||
назначитьСборщикаToolStripMenuItem.Name = "назначитьСборщикаToolStripMenuItem";
|
||||
назначитьСборщикаToolStripMenuItem.Size = new Size(192, 22);
|
||||
назначитьСборщикаToolStripMenuItem.Text = "Назначить сборщика";
|
||||
//
|
||||
// FormWorkshop
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
BackgroundImage = Properties.Resources.цех;
|
||||
BackgroundImageLayout = ImageLayout.Stretch;
|
||||
ClientSize = new Size(784, 411);
|
||||
Controls.Add(menuStrip);
|
||||
MainMenuStrip = menuStrip;
|
||||
Name = "FormWorkshop";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Цех";
|
||||
menuStrip.ResumeLayout(false);
|
||||
menuStrip.PerformLayout();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private MenuStrip menuStrip;
|
||||
private ToolStripMenuItem справочникиToolStripMenuItem;
|
||||
private ToolStripMenuItem сборщикиToolStripMenuItem;
|
||||
private ToolStripMenuItem сборкиToolStripMenuItem;
|
||||
private ToolStripMenuItem изделияToolStripMenuItem;
|
||||
private ToolStripMenuItem операцииToolStripMenuItem;
|
||||
private ToolStripMenuItem отчетыToolStripMenuItem;
|
||||
private ToolStripMenuItem сборкаToolStripMenuItem;
|
||||
private ToolStripMenuItem назначитьСборщикаToolStripMenuItem;
|
||||
}
|
||||
}
|
13
ProjectWorkshop/FormWorkshop.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using ProjectWorkshop.Repositories;
|
||||
|
||||
namespace ProjectWorkshop
|
||||
{
|
||||
public partial class FormWorkshop : Form
|
||||
{
|
||||
|
||||
public FormWorkshop()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
123
ProjectWorkshop/FormWorkshop.resx
Normal file
@ -0,0 +1,123 @@
|
||||
<?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">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
141
ProjectWorkshop/Forms/FormAssembler.Designer.cs
generated
Normal file
@ -0,0 +1,141 @@
|
||||
namespace ProjectWorkshop.Forms
|
||||
{
|
||||
partial class FormAssembler
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
labelFullName = new Label();
|
||||
textBoxFullName = new TextBox();
|
||||
labelRank = new Label();
|
||||
labelWorkExperience = new Label();
|
||||
dateTimePickerWorkExperience = new DateTimePicker();
|
||||
buttonSave = new Button();
|
||||
buttonCancel = new Button();
|
||||
comboBoxRank = new ComboBox();
|
||||
SuspendLayout();
|
||||
//
|
||||
// labelFullName
|
||||
//
|
||||
labelFullName.AutoSize = true;
|
||||
labelFullName.Location = new Point(31, 25);
|
||||
labelFullName.Name = "labelFullName";
|
||||
labelFullName.Size = new Size(96, 15);
|
||||
labelFullName.TabIndex = 0;
|
||||
labelFullName.Text = "ФИО Сборщика";
|
||||
//
|
||||
// textBoxFullName
|
||||
//
|
||||
textBoxFullName.Location = new Point(133, 22);
|
||||
textBoxFullName.Name = "textBoxFullName";
|
||||
textBoxFullName.Size = new Size(128, 23);
|
||||
textBoxFullName.TabIndex = 1;
|
||||
//
|
||||
// labelRank
|
||||
//
|
||||
labelRank.AutoSize = true;
|
||||
labelRank.Location = new Point(31, 85);
|
||||
labelRank.Name = "labelRank";
|
||||
labelRank.Size = new Size(44, 15);
|
||||
labelRank.TabIndex = 2;
|
||||
labelRank.Text = "Разряд";
|
||||
//
|
||||
// labelWorkExperience
|
||||
//
|
||||
labelWorkExperience.AutoSize = true;
|
||||
labelWorkExperience.Location = new Point(31, 152);
|
||||
labelWorkExperience.Name = "labelWorkExperience";
|
||||
labelWorkExperience.Size = new Size(82, 15);
|
||||
labelWorkExperience.TabIndex = 4;
|
||||
labelWorkExperience.Text = "Стаж работы ";
|
||||
//
|
||||
// dateTimePickerWorkExperience
|
||||
//
|
||||
dateTimePickerWorkExperience.Location = new Point(133, 152);
|
||||
dateTimePickerWorkExperience.Name = "dateTimePickerWorkExperience";
|
||||
dateTimePickerWorkExperience.Size = new Size(128, 23);
|
||||
dateTimePickerWorkExperience.TabIndex = 5;
|
||||
//
|
||||
// buttonSave
|
||||
//
|
||||
buttonSave.Location = new Point(52, 234);
|
||||
buttonSave.Name = "buttonSave";
|
||||
buttonSave.Size = new Size(75, 23);
|
||||
buttonSave.TabIndex = 6;
|
||||
buttonSave.Text = "Сохранить";
|
||||
buttonSave.UseVisualStyleBackColor = true;
|
||||
buttonSave.Click += buttonSave_Click;
|
||||
//
|
||||
// buttonCancel
|
||||
//
|
||||
buttonCancel.Location = new Point(186, 234);
|
||||
buttonCancel.Name = "buttonCancel";
|
||||
buttonCancel.Size = new Size(75, 23);
|
||||
buttonCancel.TabIndex = 7;
|
||||
buttonCancel.Text = "Отмена";
|
||||
buttonCancel.UseVisualStyleBackColor = true;
|
||||
buttonCancel.Click += buttonCancel_Click;
|
||||
//
|
||||
// comboBoxRank
|
||||
//
|
||||
comboBoxRank.FormattingEnabled = true;
|
||||
comboBoxRank.Location = new Point(133, 85);
|
||||
comboBoxRank.Name = "comboBoxRank";
|
||||
comboBoxRank.Size = new Size(128, 23);
|
||||
comboBoxRank.TabIndex = 8;
|
||||
//
|
||||
// FormAssembler
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(316, 290);
|
||||
Controls.Add(comboBoxRank);
|
||||
Controls.Add(buttonCancel);
|
||||
Controls.Add(buttonSave);
|
||||
Controls.Add(dateTimePickerWorkExperience);
|
||||
Controls.Add(labelWorkExperience);
|
||||
Controls.Add(labelRank);
|
||||
Controls.Add(textBoxFullName);
|
||||
Controls.Add(labelFullName);
|
||||
Name = "FormAssembler";
|
||||
StartPosition = FormStartPosition.CenterParent;
|
||||
Text = "Сборщик";
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Label labelFullName;
|
||||
private TextBox textBoxFullName;
|
||||
private Label labelRank;
|
||||
private Label labelWorkExperience;
|
||||
private DateTimePicker dateTimePickerWorkExperience;
|
||||
private Button buttonSave;
|
||||
private Button buttonCancel;
|
||||
private ComboBox comboBoxRank;
|
||||
}
|
||||
}
|
91
ProjectWorkshop/Forms/FormAssembler.cs
Normal file
@ -0,0 +1,91 @@
|
||||
using ProjectWorkshop.Entities;
|
||||
using ProjectWorkshop.Entities.Enums;
|
||||
using ProjectWorkshop.Repositories;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ProjectWorkshop.Forms
|
||||
{
|
||||
public partial class FormAssembler : Form
|
||||
{
|
||||
private readonly IAssemblerRepository _assemblerRepository;
|
||||
|
||||
private int? _assemblerID;
|
||||
|
||||
public int Id
|
||||
{
|
||||
set
|
||||
{
|
||||
try
|
||||
{
|
||||
var assembler = _assemblerRepository.ReadAssemblerByID(value);
|
||||
if (assembler != null)
|
||||
{
|
||||
throw new InvalidDataException(nameof(assembler));
|
||||
}
|
||||
|
||||
textBoxFullName.Text = assembler.FullName;
|
||||
comboBoxRank.SelectedItem = assembler.AssemblerRank;
|
||||
dateTimePickerWorkExperience.Value = assembler.WorkExperience;
|
||||
_assemblerID = value;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
public FormAssembler(IAssemblerRepository assemblerRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
comboBoxRank.DataSource = Enum.GetValues(typeof(AssemblerRank));
|
||||
_assemblerRepository = assemblerRepository ??
|
||||
throw new ArgumentNullException(nameof(assemblerRepository));
|
||||
}
|
||||
|
||||
private void buttonSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(textBoxFullName.Text))
|
||||
{
|
||||
throw new Exception("Имеется незаполненное поле");
|
||||
}
|
||||
|
||||
if (_assemblerID.HasValue)
|
||||
{
|
||||
_assemblerRepository.UpdateAssembler(CreateAssembler(_assemblerID.Value));
|
||||
}
|
||||
else
|
||||
{
|
||||
_assemblerRepository.CreateAssembler(CreateAssembler(0));
|
||||
}
|
||||
|
||||
Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибкв при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void buttonCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private Assembler CreateAssembler(int id) => Assembler.CreateEntity(id,
|
||||
textBoxFullName.Text, (AssemblerRank)comboBoxRank.SelectedItem!);
|
||||
}
|
||||
}
|
@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
<!--
|
||||
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
|
||||
|
||||
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>
|
||||
@ -26,36 +26,36 @@
|
||||
<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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
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
|
||||
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
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
125
ProjectWorkshop/Forms/FormAssemblers.Designer.cs
generated
Normal file
@ -0,0 +1,125 @@
|
||||
namespace ProjectWorkshop.Forms
|
||||
{
|
||||
partial class FormAssemblers
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
panel1 = new Panel();
|
||||
buttonPencil = new Button();
|
||||
buttonMinus = new Button();
|
||||
buttonPlus = new Button();
|
||||
dataGridView = new DataGridView();
|
||||
panel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
panel1.Controls.Add(buttonPencil);
|
||||
panel1.Controls.Add(buttonMinus);
|
||||
panel1.Controls.Add(buttonPlus);
|
||||
panel1.Dock = DockStyle.Right;
|
||||
panel1.Location = new Point(618, 0);
|
||||
panel1.Name = "panel1";
|
||||
panel1.Size = new Size(153, 441);
|
||||
panel1.TabIndex = 0;
|
||||
//
|
||||
// buttonPencil
|
||||
//
|
||||
buttonPencil.BackgroundImage = Properties.Resources.pencil;
|
||||
buttonPencil.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
buttonPencil.Location = new Point(28, 148);
|
||||
buttonPencil.Name = "buttonPencil";
|
||||
buttonPencil.Size = new Size(100, 93);
|
||||
buttonPencil.TabIndex = 1;
|
||||
buttonPencil.UseVisualStyleBackColor = true;
|
||||
buttonPencil.Click += buttonPencil_Click;
|
||||
//
|
||||
// buttonMinus
|
||||
//
|
||||
buttonMinus.BackgroundImage = Properties.Resources.minus;
|
||||
buttonMinus.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
buttonMinus.Location = new Point(28, 278);
|
||||
buttonMinus.Name = "buttonMinus";
|
||||
buttonMinus.Size = new Size(100, 95);
|
||||
buttonMinus.TabIndex = 1;
|
||||
buttonMinus.UseVisualStyleBackColor = true;
|
||||
buttonMinus.Click += buttonMinus_Click;
|
||||
//
|
||||
// buttonPlus
|
||||
//
|
||||
buttonPlus.BackgroundImage = Properties.Resources.plus1;
|
||||
buttonPlus.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
buttonPlus.Location = new Point(28, 25);
|
||||
buttonPlus.Name = "buttonPlus";
|
||||
buttonPlus.Size = new Size(100, 86);
|
||||
buttonPlus.TabIndex = 0;
|
||||
buttonPlus.UseVisualStyleBackColor = true;
|
||||
buttonPlus.Click += buttonPlus_Click;
|
||||
//
|
||||
// dataGridView
|
||||
//
|
||||
dataGridView.AllowUserToAddRows = false;
|
||||
dataGridView.AllowUserToDeleteRows = false;
|
||||
dataGridView.AllowUserToResizeColumns = false;
|
||||
dataGridView.AllowUserToResizeRows = false;
|
||||
dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dataGridView.Dock = DockStyle.Fill;
|
||||
dataGridView.Location = new Point(0, 0);
|
||||
dataGridView.MultiSelect = false;
|
||||
dataGridView.Name = "dataGridView";
|
||||
dataGridView.ReadOnly = true;
|
||||
dataGridView.RowHeadersVisible = false;
|
||||
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dataGridView.Size = new Size(618, 441);
|
||||
dataGridView.TabIndex = 1;
|
||||
//
|
||||
// FormAssemblers
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(771, 441);
|
||||
Controls.Add(dataGridView);
|
||||
Controls.Add(panel1);
|
||||
Name = "FormAssemblers";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "FormAssemblers";
|
||||
panel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Panel panel1;
|
||||
private Button buttonPencil;
|
||||
private Button buttonMinus;
|
||||
private Button buttonPlus;
|
||||
private DataGridView dataGridView;
|
||||
}
|
||||
}
|
45
ProjectWorkshop/Forms/FormAssemblers.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using ProjectWorkshop.Repositories;
|
||||
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 Unity;
|
||||
|
||||
namespace ProjectWorkshop.Forms
|
||||
{
|
||||
public partial class FormAssemblers : Form
|
||||
{
|
||||
private readonly IUnityContainer _container;
|
||||
|
||||
private readonly IAssemblerRepository _assemblerRepository;
|
||||
|
||||
public FormAssemblers(IUnityContainer container, IAssemblerRepository assemblerRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_container = container ??
|
||||
throw new ArgumentNullException(nameof(container));
|
||||
_assemblerRepository = assemblerRepository ??
|
||||
throw new ArgumentNullException(nameof(assemblerRepository));
|
||||
}
|
||||
|
||||
private void ButtonPlus_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void ButtonPencil_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void ButtonMinus_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
120
ProjectWorkshop/Forms/FormAssemblers.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?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">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
@ -1,3 +1,7 @@
|
||||
using ProjectWorkshop.Repositories;
|
||||
using ProjectWorkshop.Repositories.Implementation;
|
||||
using Unity;
|
||||
|
||||
namespace ProjectWorkshop
|
||||
{
|
||||
internal static class Program
|
||||
@ -11,7 +15,20 @@ namespace ProjectWorkshop
|
||||
// To customize application configuration such as set high DPI settings or default font,
|
||||
// see https://aka.ms/applicationconfiguration.
|
||||
ApplicationConfiguration.Initialize();
|
||||
Application.Run(new Form1());
|
||||
Application.Run(CreateContainer().Resolve<FormWorkshop>());
|
||||
}
|
||||
|
||||
private static IUnityContainer CreateContainer()
|
||||
{
|
||||
var container = new UnityContainer();
|
||||
|
||||
container.RegisterType<IAssemblerRepository, AssemblerRepository>();
|
||||
container.RegisterType<IAssemblyRepository, AssemblyRepository>();
|
||||
container.RegisterType<IProductAssemblyRepository, ProductAssemblyRepository>();
|
||||
container.RegisterType<IProductRepository, ProductRepository>();
|
||||
container.RegisterType<IProductTypeRepository, ProductTypeRepository>();
|
||||
|
||||
return container;
|
||||
}
|
||||
}
|
||||
}
|
@ -8,4 +8,23 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Unity" Version="5.11.10" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
113
ProjectWorkshop/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,113 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Этот код создан программой.
|
||||
// Исполняемая версия:4.0.30319.42000
|
||||
//
|
||||
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
|
||||
// повторной генерации кода.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ProjectWorkshop.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
|
||||
/// </summary>
|
||||
// Этот класс создан автоматически классом StronglyTypedResourceBuilder
|
||||
// с помощью такого средства, как ResGen или Visual Studio.
|
||||
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
|
||||
// с параметром /str или перестройте свой проект VS.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ProjectWorkshop.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Перезаписывает свойство CurrentUICulture текущего потока для всех
|
||||
/// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap minus {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("minus", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap pencil {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("pencil", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap plus {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("plus", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap plus1 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("plus1", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap цех {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("цех", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
136
ProjectWorkshop/Properties/Resources.resx
Normal file
@ -0,0 +1,136 @@
|
||||
<?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">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="цех" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\цех.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="plus" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\plus1.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="minus" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\minus1.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="pencil" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\pencil1.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="plus1" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\plus2.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
16
ProjectWorkshop/Repositories/IAssemblerRepository.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using ProjectWorkshop.Entities;
|
||||
|
||||
namespace ProjectWorkshop.Repositories;
|
||||
|
||||
public interface IAssemblerRepository
|
||||
{
|
||||
IEnumerable<Assembler> ReadAssemblers();
|
||||
|
||||
Assembler ReadAssemblerByID(int id);
|
||||
|
||||
void CreateAssembler(Assembler assembler);
|
||||
|
||||
void UpdateAssembler(Assembler assembler);
|
||||
|
||||
void DeleteAssembler(int id);
|
||||
}
|
15
ProjectWorkshop/Repositories/IAssemblyRepository.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using ProjectWorkshop.Entities;
|
||||
namespace ProjectWorkshop.Repositories;
|
||||
|
||||
public interface IAssemblyRepository
|
||||
{
|
||||
IEnumerable<Assembly> ReadAssemblies();
|
||||
|
||||
Assembly ReadAssemblyByID(int id);
|
||||
|
||||
void CreateAssembly(Assembly assembly);
|
||||
|
||||
void UpdateAssembly(Assembly assembly);
|
||||
|
||||
void DeleteAssembly(int id);
|
||||
}
|
15
ProjectWorkshop/Repositories/IProductAssemblyRepository.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using ProjectWorkshop.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectWorkshop.Repositories;
|
||||
|
||||
public interface IProductAssemblyRepository
|
||||
{
|
||||
IEnumerable<ProductAssembly> ReadProductAssembly(int? productID = null, int? assemblyID = null, int? count = null);
|
||||
|
||||
void CreateProductAssembly(ProductAssembly productAssembly);
|
||||
}
|
21
ProjectWorkshop/Repositories/IProductRepository.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using ProjectWorkshop.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectWorkshop.Repositories;
|
||||
|
||||
public interface IProductRepository
|
||||
{
|
||||
IEnumerable<Product> ReadProducts();
|
||||
|
||||
Product ReadProductByID(int id);
|
||||
|
||||
void CreateProduct(Product product);
|
||||
|
||||
void UpdateProduct(Product product);
|
||||
|
||||
void DeleteProduct(int id);
|
||||
}
|
16
ProjectWorkshop/Repositories/IProductTypeRepository.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using ProjectWorkshop.Entities;
|
||||
using ProjectWorkshop.Entities.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectWorkshop.Repositories;
|
||||
|
||||
public interface IProductTypeRepository
|
||||
{
|
||||
IEnumerable<ProductTypeEntity> ReadProductAssembly(int? id = null, string? name = null, ProductType? productType = null);
|
||||
|
||||
void CreateProductAssembly(ProductTypeEntity productAssembly);
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
using ProjectWorkshop.Entities;
|
||||
using ProjectWorkshop.Entities.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectWorkshop.Repositories.Implementation;
|
||||
|
||||
public class AssemblerRepository : IAssemblerRepository
|
||||
{
|
||||
public void CreateAssembler(Assembler assembler)
|
||||
{
|
||||
}
|
||||
|
||||
public void DeleteAssembler(int id)
|
||||
{
|
||||
}
|
||||
|
||||
public Assembler ReadAssemblerByID(int id)
|
||||
{
|
||||
return Assembler.CreateEntity(0, string.Empty, 0);
|
||||
}
|
||||
|
||||
public IEnumerable<Assembler> ReadAssemblers()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public void UpdateAssembler(Assembler assembler)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
using ProjectWorkshop.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectWorkshop.Repositories.Implementation;
|
||||
|
||||
public class AssemblyRepository : IAssemblyRepository
|
||||
{
|
||||
public void CreateAssembly(Assembly assembly)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void DeleteAssembly(int id)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IEnumerable<Assembly> ReadAssemblies()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Assembly ReadAssemblyByID(int id)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void UpdateAssembly(Assembly assembly)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
using ProjectWorkshop.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectWorkshop.Repositories.Implementation;
|
||||
|
||||
public class ProductAssemblyRepository : IProductAssemblyRepository
|
||||
{
|
||||
public void CreateProductAssembly(ProductAssembly productAssembly)
|
||||
{
|
||||
}
|
||||
|
||||
public IEnumerable<ProductAssembly> ReadProductAssembly(int? productID = null, int? assemblyID = null, int? count = null)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
using ProjectWorkshop.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectWorkshop.Repositories.Implementation;
|
||||
|
||||
public class ProductRepository : IProductRepository
|
||||
{
|
||||
public void CreateProduct(Product product)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void DeleteProduct(int id)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Product ReadProductByID(int id)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IEnumerable<Product> ReadProducts()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void UpdateProduct(Product product)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
using ProjectWorkshop.Entities;
|
||||
using ProjectWorkshop.Entities.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectWorkshop.Repositories.Implementation;
|
||||
|
||||
public class ProductTypeRepository : IProductTypeRepository
|
||||
{
|
||||
public void CreateProductAssembly(ProductTypeEntity productAssembly)
|
||||
{
|
||||
}
|
||||
|
||||
public IEnumerable<ProductTypeEntity> ReadProductAssembly(int? id = null, string? name = null, ProductType? productType = null)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
BIN
ProjectWorkshop/Resources/minus.jpg
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
ProjectWorkshop/Resources/minus1.jpg
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
ProjectWorkshop/Resources/pencil.jpg
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
ProjectWorkshop/Resources/pencil1.jpg
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
ProjectWorkshop/Resources/plus.jpg
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
ProjectWorkshop/Resources/plus1.jpg
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
ProjectWorkshop/Resources/plus2.jpg
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
ProjectWorkshop/Resources/цех.jpg
Normal file
After Width: | Height: | Size: 54 KiB |