Compare commits

...

1 Commits
main ... lab1

Author SHA1 Message Date
bec5af8d32 Лабораторная работа №1 2024-11-29 15:00:05 +04:00
60 changed files with 4939 additions and 54 deletions

View File

@ -6,6 +6,30 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<LangVersion>preview</LangVersion>
</PropertyGroup> </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>
<ItemGroup>
<Folder Include="Properties\DataSources\" />
</ItemGroup>
</Project> </Project>

View File

@ -0,0 +1,19 @@
public class Client
{
public int Id { get; private set; }
public string FirstName { get; private set; } = string.Empty;
public string LastName { get; private set; } = string.Empty;
public string ContactInformation { get; private set; } = string.Empty;
public static Client CreateEntity(int id, string firstName, string
lastName, string contactInformation)
{
return new Client
{
Id = id,
FirstName = firstName ?? string.Empty,
LastName = lastName ?? string.Empty,
ContactInformation = contactInformation ?? string.Empty,
};
}
}

View File

@ -0,0 +1,13 @@
public enum Color
{
None = 0,
Black = 1,
Red = 2,
Blue = 3,
Green = 4,
Grey = 5,
Yellow = 6,
Pink = 7,
White = 8,
Purple = 9,
}

View File

@ -0,0 +1,9 @@
[Flags]
public enum FabricType
{
None = 0,
Cotton = 1,
Silk = 2,
Linen = 4,
Polyester = 8
}

View File

@ -0,0 +1,9 @@
[Flags]
public enum ModelType
{
None = 0,
Pants = 1,
Skirt = 2,
Dress = 4,
Jacket = 8
}

View File

@ -0,0 +1,7 @@
public enum Status
{
None = 0,
Waiting = 1,
InProcess = 2,
Done = 3
}

View File

@ -0,0 +1,18 @@
public class Fabric
{
public int Id { get; private set; }
public FabricType FabricType { get; private set; }
public Color Color { get; private set; }
public double Metrage { get; private set; }
public static Fabric CreateEntity(int id, FabricType fabricType, Color color, double metrage)
{
return new Fabric
{
Id = id,
FabricType = fabricType,
Color = color,
Metrage = metrage,
};
}
}

View File

@ -0,0 +1,15 @@
public class FabricModel
{
public int FabricId { get; private set; }
public int ModelId { get; private set; }
public int Count { get; private set; }
public static FabricModel CreateElement(int fabricId, int modelId, int count)
{
return new FabricModel
{
FabricId = fabricId,
ModelId = modelId,
Count = count
};
}
}

View File

@ -0,0 +1,21 @@
using Microsoft.VisualBasic.FileIO;
public class Model
{
public int Id { get; private set; }
public ModelType ModelType { get; private set; }
public double Price { get; private set; }
public IEnumerable<FabricModel> FabricModel { get;private set;} = [];
public static Model CreateEntity(int id, ModelType modelType,double price, IEnumerable<FabricModel> fabricModel)
{
return new Model
{
Id = id,
ModelType = modelType,
Price = price,
FabricModel = fabricModel
};
}
}

View File

@ -0,0 +1,15 @@
public class ModelOrder
{
public int OrderId { get; private set; }
public int ModelId { get; private set; }
public int Count { get; private set; }
public static ModelOrder CreateElement(int orderId, int modelId, int count)
{
return new ModelOrder
{
OrderId = orderId,
ModelId = modelId,
Count = count
};
}
}

View File

@ -0,0 +1,22 @@
public class Order
{
public int Id { get; private set; }
public DateTime Date { get; private set; }
public Status Status { get; private set; }
public int ClientId { get; private set; }
public FabricType FabricType { get; private set; }
public IEnumerable<ModelOrder> ModelOrder { get; private set; } = [];
public static Order CreateOperation(int id,DateTime date, Status status, int clientId, IEnumerable<ModelOrder> modelOrder)
{
return new Order
{
Id = id,
Date = DateTime.Now,
Status = status,
ClientId = clientId,
ModelOrder = modelOrder
};
}
}

View File

@ -0,0 +1,17 @@
public class Storage
{
public int Id { get; private set; }
public double StockMetrage { get; private set; }
public int FabricId { get; private set; }
public static Storage CreateOperation(int id, double stockMetrage, int fabricId)
{
return new Storage
{
Id = id,
StockMetrage = stockMetrage,
FabricId = fabricId
};
}
}

View File

@ -1,39 +0,0 @@
namespace Atelier
{
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
}
}

View File

@ -1,10 +0,0 @@
namespace Atelier
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}

139
Atelier/Atelier/FormAtelier.Designer.cs generated Normal file
View File

@ -0,0 +1,139 @@
namespace Atelier
{
partial class FormAtelier
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormAtelier));
menuStrip = new MenuStrip();
справочникиToolStripMenuItem = new ToolStripMenuItem();
ClientsToolStripMenuItem = new ToolStripMenuItem();
ModelsToolStripMenuItem = new ToolStripMenuItem();
FabricsToolStripMenuItem1 = new ToolStripMenuItem();
операцииToolStripMenuItem = new ToolStripMenuItem();
OrdersToolStripMenuItem = new ToolStripMenuItem();
StoragesToolStripMenuItem = new ToolStripMenuItem();
отчётыToolStripMenuItem = new ToolStripMenuItem();
menuStrip.SuspendLayout();
SuspendLayout();
//
// menuStrip
//
menuStrip.ImageScalingSize = new Size(20, 20);
menuStrip.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, операцииToolStripMenuItem, отчётыToolStripMenuItem });
menuStrip.Location = new Point(0, 0);
menuStrip.Name = "menuStrip";
menuStrip.Size = new Size(817, 28);
menuStrip.TabIndex = 0;
menuStrip.Text = "menuStrip1";
//
// справочникиToolStripMenuItem
//
справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { ClientsToolStripMenuItem, ModelsToolStripMenuItem, FabricsToolStripMenuItem1 });
справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem";
справочникиToolStripMenuItem.Size = new Size(117, 24);
справочникиToolStripMenuItem.Text = "Справочники";
//
// ClientsToolStripMenuItem
//
ClientsToolStripMenuItem.Name = "ClientsToolStripMenuItem";
ClientsToolStripMenuItem.Size = new Size(224, 26);
ClientsToolStripMenuItem.Text = "Клиент";
ClientsToolStripMenuItem.Click += ClientsToolStripMenuItem_Click_1;
//
// ModelsToolStripMenuItem
//
ModelsToolStripMenuItem.Name = "ModelsToolStripMenuItem";
ModelsToolStripMenuItem.Size = new Size(224, 26);
ModelsToolStripMenuItem.Text = "Модель";
ModelsToolStripMenuItem.Click += ModelsToolStripMenuItem_Click_1;
//
// FabricsToolStripMenuItem1
//
FabricsToolStripMenuItem1.Name = "FabricsToolStripMenuItem1";
FabricsToolStripMenuItem1.Size = new Size(224, 26);
FabricsToolStripMenuItem1.Text = "Ткань";
FabricsToolStripMenuItem1.Click += FabricsToolStripMenuItem1_Click;
//
// операцииToolStripMenuItem
//
операцииToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { OrdersToolStripMenuItem, StoragesToolStripMenuItem });
операцииToolStripMenuItem.Name = "операцииToolStripMenuItem";
операцииToolStripMenuItem.Size = new Size(95, 24);
операцииToolStripMenuItem.Text = "Операции";
//
// OrdersToolStripMenuItem
//
OrdersToolStripMenuItem.Name = "OrdersToolStripMenuItem";
OrdersToolStripMenuItem.Size = new Size(224, 26);
OrdersToolStripMenuItem.Text = "Заказ";
OrdersToolStripMenuItem.Click += OrdersToolStripMenuItem_Click_1;
//
// StoragesToolStripMenuItem
//
StoragesToolStripMenuItem.Name = "StoragesToolStripMenuItem";
StoragesToolStripMenuItem.Size = new Size(224, 26);
StoragesToolStripMenuItem.Text = "Склад";
StoragesToolStripMenuItem.Click += StoragesToolStripMenuItem_Click_1;
//
// отчётыToolStripMenuItem
//
отчётыToolStripMenuItem.Name = "отчётыToolStripMenuItem";
отчётыToolStripMenuItem.Size = new Size(73, 24);
отчётыToolStripMenuItem.Text = "Отчёты";
//
// FormAtelier
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
BackgroundImage = (Image)resources.GetObject("$this.BackgroundImage");
BackgroundImageLayout = ImageLayout.Zoom;
ClientSize = new Size(817, 467);
Controls.Add(menuStrip);
MainMenuStrip = menuStrip;
Name = "FormAtelier";
StartPosition = FormStartPosition.CenterScreen;
Text = "Ателье";
menuStrip.ResumeLayout(false);
menuStrip.PerformLayout();
ResumeLayout(false);
PerformLayout();
}
#endregion
private MenuStrip menuStrip;
private ToolStripMenuItem справочникиToolStripMenuItem;
private ToolStripMenuItem ClientsToolStripMenuItem;
private ToolStripMenuItem операцииToolStripMenuItem;
private ToolStripMenuItem отчётыToolStripMenuItem;
private ToolStripMenuItem ModelsToolStripMenuItem;
private ToolStripMenuItem FabricsToolStripMenuItem1;
private ToolStripMenuItem OrdersToolStripMenuItem;
private ToolStripMenuItem StoragesToolStripMenuItem;
}
}

View File

@ -0,0 +1,91 @@
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;
using Atelier.Forms;
namespace Atelier
{
public partial class FormAtelier : Form
{
private readonly IUnityContainer _container;
public FormAtelier(IUnityContainer container)
{
InitializeComponent();
_container = container ??
throw new ArgumentNullException(nameof(container));
}
private void ClientsToolStripMenuItem_Click_1(object sender, EventArgs e)
{
try
{
_container.Resolve<FormClients>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при загрузке",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ModelsToolStripMenuItem_Click_1(object sender, EventArgs e)
{
try
{
_container.Resolve<FormModels>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при загрузке",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void FabricsToolStripMenuItem1_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormFabrics>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при загрузке",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void OrdersToolStripMenuItem_Click_1(object sender, EventArgs e)
{
try
{
_container.Resolve<FormOrders>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при загрузке",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void StoragesToolStripMenuItem_Click_1(object sender, EventArgs e)
{
try
{
_container.Resolve<FormStorages>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при загрузке",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}

View File

@ -0,0 +1,329 @@
<?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>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object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rb/IPABlfi7xetUC+EbXLnoyxoCx
tXAZeUosU/YaHzd/yU90ag7BH9WSnJOQymeV+xcei/VUbgyJkcnKNhAzK9mxw+jXlv8AIPABlfi7x+tU
CzoG1y56MtdAY2rgMvKUXKfsND5u/wCUnujUHYI/qyU5JyGUzyv2Lj0X+qjcGQZHJyiEEMY9E5crV6Pt
eAxtXAZeUqnKd2jQ+bv+WlOjXwEr8lkpyTkNTPKP2XHrEsYGNq4DLylFinfsaHzd/wAxPdGvgBX6slOI
UmqZj2O9lzjfxgLA2rAbeU4jKXsND5u/5p433AH0acfqVxF8wE/8Tj//2Q==
</value>
</data>
</root>

View File

@ -0,0 +1,141 @@
namespace Atelier.Forms
{
partial class FormClient
{
/// <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()
{
textBoxFirstName = new TextBox();
labelFirstName = new Label();
textBoxLastName = new TextBox();
labelLastName = new Label();
labelContactInf = new Label();
textBoxContactInf = new TextBox();
buttonSave = new Button();
buttonCancel = new Button();
SuspendLayout();
//
// textBoxFirstName
//
textBoxFirstName.Location = new Point(171, 42);
textBoxFirstName.Name = "textBoxFirstName";
textBoxFirstName.Size = new Size(235, 27);
textBoxFirstName.TabIndex = 0;
//
// labelFirstName
//
labelFirstName.AutoSize = true;
labelFirstName.Location = new Point(12, 49);
labelFirstName.Name = "labelFirstName";
labelFirstName.Size = new Size(101, 20);
labelFirstName.TabIndex = 1;
labelFirstName.Text = "Имя клиента:";
//
// textBoxLastName
//
textBoxLastName.Location = new Point(171, 104);
textBoxLastName.Name = "textBoxLastName";
textBoxLastName.Size = new Size(235, 27);
textBoxLastName.TabIndex = 2;
//
// labelLastName
//
labelLastName.AutoSize = true;
labelLastName.Location = new Point(12, 111);
labelLastName.Name = "labelLastName";
labelLastName.Size = new Size(135, 20);
labelLastName.TabIndex = 3;
labelLastName.Text = "Фамилия клиента:";
//
// labelContactInf
//
labelContactInf.AutoSize = true;
labelContactInf.Location = new Point(114, 178);
labelContactInf.Name = "labelContactInf";
labelContactInf.Size = new Size(186, 20);
labelContactInf.TabIndex = 4;
labelContactInf.Text = "Контактная информация:";
//
// textBoxContactInf
//
textBoxContactInf.Location = new Point(59, 221);
textBoxContactInf.Name = "textBoxContactInf";
textBoxContactInf.Size = new Size(306, 27);
textBoxContactInf.TabIndex = 5;
//
// buttonSave
//
buttonSave.Location = new Point(95, 282);
buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(94, 29);
buttonSave.TabIndex = 6;
buttonSave.Text = "Сохранить";
buttonSave.UseVisualStyleBackColor = true;
buttonSave.Click += ButtonSave_Click;
//
// buttonCancel
//
buttonCancel.Location = new Point(223, 282);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(94, 29);
buttonCancel.TabIndex = 7;
buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true;
buttonCancel.Click += ButtonCancel_Click;
//
// FormClient
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(444, 348);
Controls.Add(buttonCancel);
Controls.Add(buttonSave);
Controls.Add(textBoxContactInf);
Controls.Add(labelContactInf);
Controls.Add(labelLastName);
Controls.Add(textBoxLastName);
Controls.Add(labelFirstName);
Controls.Add(textBoxFirstName);
Name = "FormClient";
StartPosition = FormStartPosition.CenterParent;
Text = "Клиент";
ResumeLayout(false);
PerformLayout();
}
#endregion
private TextBox textBoxFirstName;
private Label labelFirstName;
private TextBox textBoxLastName;
private Label labelLastName;
private Label labelContactInf;
private TextBox textBoxContactInf;
private Button buttonSave;
private Button buttonCancel;
}
}

View File

@ -0,0 +1,79 @@
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 Atelier.Forms
{
public partial class FormClient : Form
{
private readonly IClientRepository _clientRepository;
private int? _clientId;
public int Id
{
set
{
try
{
var client =
_clientRepository.ReadClientById(value);
if (client == null)
{
throw new
InvalidDataException(nameof(client));
}
textBoxFirstName.Text = client.FirstName;
textBoxLastName.Text = client.LastName;
textBoxContactInf.Text = client.ContactInformation;
_clientId = value;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
}
public FormClient(IClientRepository clientRepository)
{
InitializeComponent();
_clientRepository = clientRepository ??
throw new
ArgumentNullException(nameof(clientRepository));
}
private void ButtonSave_Click(object sender, EventArgs e)
{
try
{
if (string.IsNullOrWhiteSpace(textBoxFirstName.Text) || string.IsNullOrWhiteSpace(textBoxLastName.Text) || string.IsNullOrWhiteSpace(textBoxContactInf.Text))
{
throw new Exception("Имеются незаполненные поля");
}
if (_clientId.HasValue)
{
_clientRepository.UpdateClient(CreateClient(_clientId.Value));
}
else
{
_clientRepository.CreateClient(CreateClient(0));
}
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при сохранении",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
private Client CreateClient(int id) => Client.CreateEntity(id, textBoxFirstName.Text, textBoxLastName.Text, textBoxContactInf.Text);
}
}

View 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>

View File

@ -0,0 +1,126 @@
namespace Atelier.Forms
{
partial class FormClients
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormClients));
dataGridView1 = new DataGridView();
panel1 = new Panel();
buttonDel = new Button();
buttonUpd = new Button();
buttonAdd = new Button();
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
panel1.SuspendLayout();
SuspendLayout();
//
// dataGridView1
//
dataGridView1.AllowUserToAddRows = false;
dataGridView1.AllowUserToDeleteRows = false;
dataGridView1.AllowUserToResizeColumns = false;
dataGridView1.AllowUserToResizeRows = false;
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView1.Dock = DockStyle.Fill;
dataGridView1.Location = new Point(0, 0);
dataGridView1.MultiSelect = false;
dataGridView1.Name = "dataGridView1";
dataGridView1.ReadOnly = true;
dataGridView1.RowHeadersVisible = false;
dataGridView1.RowHeadersWidth = 51;
dataGridView1.RowTemplate.Height = 29;
dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView1.Size = new Size(1001, 604);
dataGridView1.TabIndex = 0;
//
// panel1
//
panel1.Controls.Add(buttonDel);
panel1.Controls.Add(buttonUpd);
panel1.Controls.Add(buttonAdd);
panel1.Dock = DockStyle.Right;
panel1.Location = new Point(1001, 0);
panel1.Name = "panel1";
panel1.Size = new Size(133, 604);
panel1.TabIndex = 1;
//
// buttonDel
//
buttonDel.Image = (Image)resources.GetObject("buttonDel.Image");
buttonDel.Location = new Point(14, 204);
buttonDel.Name = "buttonDel";
buttonDel.Size = new Size(107, 88);
buttonDel.TabIndex = 2;
buttonDel.UseVisualStyleBackColor = true;
buttonDel.Click += ButtonDel_Click;
//
// buttonUpd
//
buttonUpd.Image = (Image)resources.GetObject("buttonUpd.Image");
buttonUpd.Location = new Point(14, 107);
buttonUpd.Name = "buttonUpd";
buttonUpd.Size = new Size(107, 91);
buttonUpd.TabIndex = 1;
buttonUpd.UseVisualStyleBackColor = true;
buttonUpd.Click += ButtonUpd_Click;
//
// buttonAdd
//
buttonAdd.Image = (Image)resources.GetObject("buttonAdd.Image");
buttonAdd.Location = new Point(14, 12);
buttonAdd.Name = "buttonAdd";
buttonAdd.Size = new Size(107, 89);
buttonAdd.TabIndex = 0;
buttonAdd.UseVisualStyleBackColor = true;
buttonAdd.Click += ButtonAdd_Click;
//
// FormClients
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1134, 604);
Controls.Add(dataGridView1);
Controls.Add(panel1);
Name = "FormClients";
StartPosition = FormStartPosition.CenterParent;
Text = "Клиенты";
Load += FormClients_Load;
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
panel1.ResumeLayout(false);
ResumeLayout(false);
}
#endregion
private DataGridView dataGridView1;
private Panel panel1;
private Button buttonDel;
private Button buttonUpd;
private Button buttonAdd;
}
}

View File

@ -0,0 +1,119 @@
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;
using Atelier.Forms;
namespace Atelier.Forms
{
public partial class FormClients : Form
{
private readonly IUnityContainer _container;
private readonly IClientRepository _clientRepository;
public FormClients(IUnityContainer container, IClientRepository clientRepository)
{
InitializeComponent();
_container = container ??
throw new ArgumentNullException(nameof(container));
_clientRepository = clientRepository ??
throw new
ArgumentNullException(nameof(clientRepository));
}
private void FormClients_Load(object sender, EventArgs e)
{
try
{
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при загрузке",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonAdd_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormClient>().ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при добавлении",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonUpd_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFromSelectedRow(out var findId))
{
return;
}
try
{
var form = _container.Resolve<FormClient>();
form.Id = findId;
form.ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при изменении",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonDel_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFromSelectedRow(out var findId))
{
return;
}
if (MessageBox.Show("Удалить запись?", "Удаление",
MessageBoxButtons.YesNo) != DialogResult.Yes)
{
return;
}
try
{
_clientRepository.DeleteClient(findId);
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при удалении",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void LoadList() => dataGridView1.DataSource = _clientRepository.ReadClients();
private bool TryGetIdentifierFromSelectedRow(out int id)
{
id = 0;
if (dataGridView1.SelectedRows.Count < 1)
{
MessageBox.Show("Нет выбранной записи", "Ошибка",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
id =
Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["Id"].Value);
return true;
}
}
}

View File

@ -0,0 +1,226 @@
<?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.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="buttonDel.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DAAACwwBP0AiyAAABNVJREFUeF7tnL9uXHUQhZ2OKk8ANRJ5AHipNInXgCFKyuD1H/ECZJ11Eh7AViCP
ELeJaCgQHV2gIIULc0cZ0KfR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sk7Sk+ijGTnSMVum4nXmn3yjtKTKCPZOVKx
22bitWafvKP0JMpIdo5U7LaZeK3ZJ+8oPYkykp0jFbttJl5r9sk7Sk+ijGTnSMVum4nXmn3yjtKTKCPZ
OVKx22bitWafvKP0JMpIdo5U7LaZeK3ZJ+8oPYkykp0jFbttJl5r9sk7Sk+ijGTnSMVum4nXmn3yjtKT
KCPZOVKx22bitWafvKP0JMpIdo5U7LaZeK3ZJ+8oPYkykp0jFbttJl5r9sk7Sk+ijGTnSMVum4nXmn3y
jtKTKCPZOVKx22bitWafvKP0JMpIdo5U7LaZeK3ZJ+8oPYkykp0jFbttJl5r9sk7Sk+ijGTnSMVum4nX
mn3apOx1YX7AkVzJA8q3m03xq6DevJavelr/rTX7dLh78kq+mMv7j7jOnD5/fXH0zbNTrdkn+V49+Wo4
ecQpfBLlkyePd/jV+t3jnfXHWrNXH76Q8eRMvt1M/m5cZ6SDfPKu7PFmzZo1azLa2voHHNxQxvmbf3YA
AAAASUVORK5CYII=
</value>
</data>
<data name="buttonUpd.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DAAACwwBP0AiyAAAB1ZJREFUeF7tmllPG1cUx+nePrXqB6j60OdK/QRVK/Wx6lPfKlVVpUiNbZakJKSp
SpSoNE1sszsZsGfwQqEGQmIWB0zYkhAgDklYTIBAAgRQtlZN1QRSKafn3LkzDOMxmCiNl/hIfwnP2Mz5
/e+9557xOCsTmchESobV4v7IahJzrGapwGap+QSy4CV+Kr3D/6X/FZtZcqBAK6tJCh3eIbzN35aeIcOL
HgIusUgQ3OWEblSFWXzCjRhMWxO08KWoifxquF8gMC3sqYJqiyjPBpMYtuVVv8s/lh5B8DjFvUbwRiZg
XbiU8ibYTK5v7GapzWoWf0DVEVgZKpJfFQWvaGFvFVRl85mQysvBZpI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Z74oEwI+FlxjvR+0v3EPBOZyMSziays/wB+daIEvDXupgAAAABJRU5ErkJggg==
</value>
</data>
<data name="buttonAdd.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DAAACwwBP0AiyAAACDBJREFUeF7tXFlTFFcU9inbQ5JfkOU9eyqVPGT7B6kk5UsEZmkYfMFUCpnunkE2
Uy6pCotCEKa3ARQliklYRWMEyvigErSMmriRlMlDSpGSmaFUoHO/yaUmNncchpnunhnmq/qqKObc7VR3
n3PPPeeuyyOPtQtPW/VTjgD/YaFUsdGpCM3Fmu8k4ZRbFf5xKnzYEfDOg/gb/8NvkIFsUcBbWihXfIA+
aHdrA4527ztEKVtLgv5zTtl7b9P+upnagYZw46isq6f36z0Xvtd7L/Xr/VeG9eEbx6LE3/gffoMMZGtI
m03ddTPogyh10inxdQVy+dt0mNxCQXv5i0WKt5Y8RX9v7Npyd/tIy/3gxAF98NqIPjL1Y0pEH9rZA/o2
0mdpZ+Usp4p/OWS+xqHyL9DhsxeOgPAmWdCwWxUjW4ea5vadP8RUQjq579whvW5w15xbFubcqn9wg1Lx
Bp1O9gCKc6niaLHqDzWNygvpeNKSJcYkr/piseaPcKpvrFDiX6fTy1w41M+fdSuCRJ66cPO4tjB8/Shz
cVYSc9g1pi5ymjjHKb52Txv/DJ1uZsEpCeuJ8u7UDDRF+shHn7UYO/nD70N6dX9jBHN0SPyndNr2w6FW
P+GShYAnWBnaO2n+Ny5VdpE5lnZUhl3kaSxrKnucLsMewLq6VOGycPirUP/VzHvq4hFuEX94Z8StCZds
s9YFMv+qSxGnG0el+SNTx5gTzWRizg2j0gOyhttFgc2v0GVZA+wAyG5gtu1U1yJrctlErMFF1lIk8e/T
5ZkLKI+8tmE4wqwJZSPhiGNNpiuR7ElfJv7dXQzImkg2s2PiWx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QfSPHPJxc9zKXkosI2/jmqpkfDrYhDjWP2ljQYwZKxivUnAvOcIvZT9SQGUlo5zRcZvG7fU2gE
S8YKIskUCZZJXx3Aqb7R3WOabUmWRrBkrOCuMWWBGI8fqVpWDqT54luIACKrY7NpBEvGbGLt5HMWWXU5
rFMR2mr67QkwGMGSMZtV/Q0Rlyq2UHUkDxSZoNAGZfKsAXKZnZOo3hSnN3SWPU3VsToUBryfeIKVaTkv
yRaiNsbT4Q8XtvMfUTWkBpcitHsPraViwx0h8uZ9Q5efOlD6STq8hFJQ1qC5xK+PBx6Q796F9T3Vj9Hl
pwfYobhk8VbbqS5b60fM5J6fOxeJ1b214h1HsiiQyl/K1ZL/4ERP9LwXt5HQ5ZoDZGfigoZcUmL00glF
CBfK/Lt0meYC5RBkwLutJ4M5cO1J5wLeKuY5h5mAd44LGmBYstE6Y84wGPjm4dNEl2UtooZFFS7yvTtD
2eQnws/jD++IuDXfr6YZjJUCLo5LFvbg8jGUybMmnEnEDqMk6I+4NH9r2l2VVIALGrD1wRVzqPRmTd5O
IjBQ1VcfIa7YdNp2GOkG9s4uTWxFFAeV3nYWbC8RMU2EpBBVwe4i5b2tFUBAlnwbj3OqGIKRQUictTgz
iTHrRwPznOrDFaDHLb+hLR2AIos13wDOE1Bva/b1KbCsOD3DARDGJIrrM90xtgKo9HYE+CocmaJkdNuR
5vs45U/Hk4k+0BcOvXFui6NHh+zdYrt1NQuot3VKQjV5MieQZ4Las+q+hlDjqBQtYkECY7yLuPEb8vMa
Tsg62iDRB32ggtIl81VJXQyRC0CSDraGjkCFBzl3RKnjXNB3HSm0yNleugqeuEkh/A+/IbkRsmiD3UPc
RJ888lgDWLfuXyHjrOzkVJ7gAAAAAElFTkSuQmCC
</value>
</data>
</root>

View File

@ -0,0 +1,148 @@
namespace Atelier.Forms
{
partial class FormFabric
{
/// <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()
{
labelFabric = new Label();
labelColor = new Label();
labelMetrage = new Label();
checkedListBoxColor = new CheckedListBox();
comboBoxFabric = new ComboBox();
numericUpDownMetrage = new NumericUpDown();
buttonSave = new Button();
buttonCancel = new Button();
((System.ComponentModel.ISupportInitialize)numericUpDownMetrage).BeginInit();
SuspendLayout();
//
// labelFabric
//
labelFabric.AutoSize = true;
labelFabric.Location = new Point(60, 33);
labelFabric.Name = "labelFabric";
labelFabric.Size = new Size(52, 20);
labelFabric.TabIndex = 0;
labelFabric.Text = "Ткань:";
//
// labelColor
//
labelColor.AutoSize = true;
labelColor.Location = new Point(67, 77);
labelColor.Name = "labelColor";
labelColor.Size = new Size(45, 20);
labelColor.TabIndex = 1;
labelColor.Text = "Цвет:";
//
// labelMetrage
//
labelMetrage.AutoSize = true;
labelMetrage.Location = new Point(55, 229);
labelMetrage.Name = "labelMetrage";
labelMetrage.Size = new Size(67, 20);
labelMetrage.TabIndex = 2;
labelMetrage.Text = "Метраж:";
//
// checkedListBoxColor
//
checkedListBoxColor.FormattingEnabled = true;
checkedListBoxColor.Location = new Point(146, 77);
checkedListBoxColor.Name = "checkedListBoxColor";
checkedListBoxColor.Size = new Size(150, 114);
checkedListBoxColor.TabIndex = 3;
//
// comboBoxFabric
//
comboBoxFabric.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxFabric.FormattingEnabled = true;
comboBoxFabric.Location = new Point(145, 25);
comboBoxFabric.Name = "comboBoxFabric";
comboBoxFabric.Size = new Size(151, 28);
comboBoxFabric.TabIndex = 4;
//
// numericUpDownMetrage
//
numericUpDownMetrage.DecimalPlaces = 2;
numericUpDownMetrage.Location = new Point(146, 229);
numericUpDownMetrage.Minimum = new decimal(new int[] { 5, 0, 0, 65536 });
numericUpDownMetrage.Name = "numericUpDownMetrage";
numericUpDownMetrage.Size = new Size(150, 27);
numericUpDownMetrage.TabIndex = 5;
numericUpDownMetrage.Value = new decimal(new int[] { 5, 0, 0, 65536 });
//
// buttonSave
//
buttonSave.Location = new Point(67, 296);
buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(94, 29);
buttonSave.TabIndex = 6;
buttonSave.Text = "Сохранить";
buttonSave.UseVisualStyleBackColor = true;
buttonSave.Click += ButtonSave_Click;
//
// buttonCancel
//
buttonCancel.Location = new Point(215, 296);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(94, 29);
buttonCancel.TabIndex = 7;
buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true;
buttonCancel.Click += ButtonCancel_Click;
//
// FormFabric
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(367, 352);
Controls.Add(buttonCancel);
Controls.Add(buttonSave);
Controls.Add(numericUpDownMetrage);
Controls.Add(comboBoxFabric);
Controls.Add(checkedListBoxColor);
Controls.Add(labelMetrage);
Controls.Add(labelColor);
Controls.Add(labelFabric);
Name = "FormFabric";
StartPosition = FormStartPosition.CenterParent;
Text = "Ткань";
((System.ComponentModel.ISupportInitialize)numericUpDownMetrage).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private Label labelFabric;
private Label labelColor;
private Label labelMetrage;
private CheckedListBox checkedListBoxColor;
private ComboBox comboBoxFabric;
private NumericUpDown numericUpDownMetrage;
private Button buttonSave;
private Button buttonCancel;
}
}

View File

@ -0,0 +1,105 @@
using Microsoft.VisualBasic.FileIO;
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 Atelier.Forms
{
public partial class FormFabric : Form
{
private readonly IFabricRepository _fabricRepository;
private int? _fabricId;
public FormFabric(IFabricRepository fabricRepository)
{
InitializeComponent();
_fabricRepository = fabricRepository ?? throw new ArgumentNullException(nameof(fabricRepository));
comboBoxFabric.DataSource = Enum.GetValues(typeof(FabricType));
// Инициализация CheckedListBox
foreach (Color elem in Enum.GetValues(typeof(Color)))
{
checkedListBoxColor.Items.Add(elem);
}
// Отладочный вывод
foreach (var item in checkedListBoxColor.Items)
{
Console.WriteLine(item);
}
}
public int Id
{
set
{
try
{
var fabric = _fabricRepository.ReadFabricById(value);
if (fabric == null)
{
throw new InvalidDataException(nameof(fabric));
}
comboBoxFabric.SelectedItem = fabric.FabricType;
foreach (Color elem in Enum.GetValues(typeof(Color)))
{
if ((elem & fabric.Color) != 0)
{
checkedListBoxColor.SetItemChecked(checkedListBoxColor.Items.IndexOf(elem), true);
}
}
numericUpDownMetrage.Value = (decimal)fabric.Metrage;
_fabricId = value;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
}
private void ButtonSave_Click(object sender, EventArgs e)
{
try
{
if (comboBoxFabric.SelectedIndex < 0.50 || checkedListBoxColor.CheckedItems.Count == 0)
{
throw new Exception("Имеются незаполненные поля");
}
if (_fabricId.HasValue)
{
_fabricRepository.UpdateFabric(CreateFabric(_fabricId.Value));
}
else
{
_fabricRepository.CreateFabric(CreateFabric(0));
}
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при сохранении",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
private Fabric CreateFabric(int id)
{
Color color = Color.None;
foreach (var elem in checkedListBoxColor.CheckedItems)
{
color |= (Color)elem;
}
return Fabric.CreateEntity(id, (FabricType)comboBoxFabric.SelectedItem!, color, Convert.ToDouble(numericUpDownMetrage.Value)); ;
}
}
}

View 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>

View File

@ -0,0 +1,126 @@
namespace Atelier.Forms
{
partial class FormFabrics
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormFabrics));
dataGridView1 = new DataGridView();
panel1 = new Panel();
buttonDel = new Button();
buttonUpd = new Button();
buttonAdd = new Button();
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
panel1.SuspendLayout();
SuspendLayout();
//
// dataGridView1
//
dataGridView1.AllowUserToAddRows = false;
dataGridView1.AllowUserToDeleteRows = false;
dataGridView1.AllowUserToResizeColumns = false;
dataGridView1.AllowUserToResizeRows = false;
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView1.Dock = DockStyle.Fill;
dataGridView1.Location = new Point(0, 0);
dataGridView1.MultiSelect = false;
dataGridView1.Name = "dataGridView1";
dataGridView1.ReadOnly = true;
dataGridView1.RowHeadersVisible = false;
dataGridView1.RowHeadersWidth = 51;
dataGridView1.RowTemplate.Height = 29;
dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView1.Size = new Size(1001, 604);
dataGridView1.TabIndex = 0;
//
// panel1
//
panel1.Controls.Add(buttonDel);
panel1.Controls.Add(buttonUpd);
panel1.Controls.Add(buttonAdd);
panel1.Dock = DockStyle.Right;
panel1.Location = new Point(1001, 0);
panel1.Name = "panel1";
panel1.Size = new Size(133, 604);
panel1.TabIndex = 1;
//
// buttonDel
//
buttonDel.Image = (Image)resources.GetObject("buttonDel.Image");
buttonDel.Location = new Point(14, 204);
buttonDel.Name = "buttonDel";
buttonDel.Size = new Size(107, 88);
buttonDel.TabIndex = 2;
buttonDel.UseVisualStyleBackColor = true;
buttonDel.Click += ButtonDel_Click;
//
// buttonUpd
//
buttonUpd.Image = (Image)resources.GetObject("buttonUpd.Image");
buttonUpd.Location = new Point(14, 107);
buttonUpd.Name = "buttonUpd";
buttonUpd.Size = new Size(107, 91);
buttonUpd.TabIndex = 1;
buttonUpd.UseVisualStyleBackColor = true;
buttonUpd.Click += ButtonUpd_Click;
//
// buttonAdd
//
buttonAdd.Image = (Image)resources.GetObject("buttonAdd.Image");
buttonAdd.Location = new Point(14, 12);
buttonAdd.Name = "buttonAdd";
buttonAdd.Size = new Size(107, 89);
buttonAdd.TabIndex = 0;
buttonAdd.UseVisualStyleBackColor = true;
buttonAdd.Click += ButtonAdd_Click;
//
// FormFabrics
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1134, 604);
Controls.Add(dataGridView1);
Controls.Add(panel1);
Name = "FormFabrics";
StartPosition = FormStartPosition.CenterParent;
Text = "Ткани";
Load += FormFabrics_Load;
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
panel1.ResumeLayout(false);
ResumeLayout(false);
}
#endregion
private DataGridView dataGridView1;
private Panel panel1;
private Button buttonDel;
private Button buttonUpd;
private Button buttonAdd;
}
}

View File

@ -0,0 +1,108 @@
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 Atelier.Forms
{
public partial class FormFabrics : Form
{
private readonly IUnityContainer _container;
private readonly IFabricRepository _fabricRepository;
public FormFabrics(IUnityContainer container, IFabricRepository fabricRepository)
{
InitializeComponent();
_container = container ??
throw new ArgumentNullException(nameof(container));
_fabricRepository = fabricRepository ??
throw new
ArgumentNullException(nameof(fabricRepository));
}
private void FormFabrics_Load(object sender, EventArgs e)
{
try
{
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при загрузке",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonAdd_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormFabric>().ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при добавлении",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonUpd_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFromSelectedRow(out var findId))
{
return;
}
try
{
var form = _container.Resolve<FormFabric>();
form.Id = findId;
form.ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при изменении",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonDel_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFromSelectedRow(out var findId))
{
return;
}
if (MessageBox.Show("Удалить запись?", "Удаление",
MessageBoxButtons.YesNo) != DialogResult.Yes)
{
return;
}
try
{
_fabricRepository.DeleteFabric(findId);
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при удалении",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void LoadList() => dataGridView1.DataSource = _fabricRepository.ReadFabrics();
private bool TryGetIdentifierFromSelectedRow(out int id)
{
id = 0;
if (dataGridView1.SelectedRows.Count < 1)
{
MessageBox.Show("Нет выбранной записи", "Ошибка",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
id =
Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["Id"].Value);
return true;
}
}
}

View File

@ -0,0 +1,226 @@
<?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.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="buttonDel.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAA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7Sk+ijGTnSMVum4nXmn3yjtKTKCPZOVKx22bitWaf
vKP0JMpIdo5U7LaZeK3ZJ+8oPYkykp0jFbttJl5r9sk7Sk+ijGTnSMVum4nXmn3yjtKTKCPZOVKx22bi
tWafvKP0JMpIdo5U7LaZeK3ZJ+8oPYkykp0jFbttJl5r9sk7Sk+ijGTnSMVum4nXmn3yjtKTKCPZOVKx
22bitWafvKP0JMpIdo5U7LaZeK3ZJ+8oPYkykp0jFbttJl5r9sk7Sk+ijGTnSMVum4nXmn3yjtKTKCPZ
OVKx22bitWafvKP0JMpIdo5U7LaZeK3ZJ+8oPYkykp0jFbttJl5r9sk7Sk+ijGTnSMVum4nXmn3yjtKT
KCPZOVKx22bitWafvKP0JMpIdo5U7LaZeK3ZJ+8oPYkykp0jFbttJl5r9sk7Sk+ijGTnSMVum4nXmn3y
jtKTKCPZOVKx22bitWafvKP0JMpIdo5U7LaZeK3ZJ+8oPYkykp0jFbttJl5r9sk7Sk+ijGTnSMVum4nX
mn3apOx1YX7AkVzJA8q3m03xq6DevJavelr/rTX7dLh78kq+mMv7j7jOnD5/fXH0zbNTrdkn+V49+Wo4
ecQpfBLlkyePd/jV+t3jnfXHWrNXH76Q8eRMvt1M/m5cZ6SDfPKu7PFmzZo1azLa2voHHNxQxvmbf3YA
AAAASUVORK5CYII=
</value>
</data>
<data name="buttonUpd.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DgAACw4BQL7hQQAAB1ZJREFUeF7tmllPG1cUx+nePrXqB6j60OdK/QRVK/Wx6lPfKlVVpUiNbZakJKSp
SpSoNE1sszsZsGfwQqEGQmIWB0zYkhAgDklYTIBAAgRQtlZN1QRSKafn3LkzDOMxmCiNl/hIfwnP2Mz5
/e+9557xOCsTmchESobV4v7IahJzrGapwGap+QSy4CV+K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
/FQxQDVhanMTqFmiewZ7tnzTwz5rkhpSDp6CnqdrDdCa8PfKNNybi7DOcDZ8CSL9Q6xDpIapco/cBzAh
PC6lV/m/TK3ANviIFn67ws87UxaeAiH8eigmk/Qv7Q64riP4+iz18VgsRQS2YnOzD499e+S7mg/5v0nd
sFvEzxGmhZ74oEwI+FlxjvR+0v3EPBOZyMSziays/wB+daIEvDXupgAAAABJRU5ErkJggg==
</value>
</data>
<data name="buttonAdd.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DgAACw4BQL7hQQAACDBJREFUeF7tXFlTFFcU9inbQ5JfkOU9eyqVPGT7B6kk5UsEZmkYfMFUCpnunkE2
Uy6pCotCEKa3ARQliklYRWMEyvigErSMmriRlMlDSpGSmaFUoHO/yaUmNncchpnunhnmq/qqKObc7VR3
n3PPPeeuyyOPtQtPW/VTjgD/YaFUsdGpCM3Fmu8k4ZRbFf5xKnzYEfDOg/gb/8NvkIFsUcBbWihXfIA+
aHdrA4527ztEKVtLgv5zTtl7b9P+upnagYZw46isq6f36z0Xvtd7L/Xr/VeG9eEbx6LE3/gffoMMZGtI
m03ddTPogyh10inxdQVy+dt0mNxCQXv5i0WKt5Y8RX9v7Npyd/tIy/3gxAF98NqIPjL1Y0pEH9rZA/o2
0mdpZ+Usp4p/OWS+xqHyL9DhsxeOgPAmWdCwWxUjW4ea5vadP8RUQjq579whvW5w15xbFubcqn9wg1Lx
Bp1O9gCKc6niaLHqDzWNygvpeNKSJcYkr/piseaPcKpvrFDiX6fTy1w41M+fdSuCRJ66cPO4tjB8/Shz
cVYSc9g1pi5ymjjHKb52Txv/DJ1uZsEpCeuJ8u7UDDRF+shHn7UYO/nD70N6dX9jBHN0SPyndNr2w6FW
P+GShYAnWBnaO2n+Ny5VdpE5lnZUhl3kaSxrK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LfuXyHjrOzkVJ7gAAAAAElFTkSuQmCC
</value>
</data>
</root>

View File

@ -0,0 +1,182 @@
namespace Atelier.Forms
{
partial class FormModel
{
/// <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()
{
labelModel = new Label();
labelPrice = new Label();
comboBoxModel = new ComboBox();
numericUpDownPrice = new NumericUpDown();
buttonSave = new Button();
buttonCancel = new Button();
groupBox1 = new GroupBox();
dataGridView1 = new DataGridView();
ColumnFabric = new DataGridViewComboBoxColumn();
ColumnCount = new DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)numericUpDownPrice).BeginInit();
groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
SuspendLayout();
//
// labelModel
//
labelModel.AutoSize = true;
labelModel.Location = new Point(30, 52);
labelModel.Name = "labelModel";
labelModel.Size = new Size(66, 20);
labelModel.TabIndex = 0;
labelModel.Text = "Модель:";
//
// labelPrice
//
labelPrice.AutoSize = true;
labelPrice.Location = new Point(48, 118);
labelPrice.Name = "labelPrice";
labelPrice.Size = new Size(48, 20);
labelPrice.TabIndex = 1;
labelPrice.Text = "Цена:";
//
// comboBoxModel
//
comboBoxModel.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxModel.FormattingEnabled = true;
comboBoxModel.Location = new Point(119, 52);
comboBoxModel.Name = "comboBoxModel";
comboBoxModel.Size = new Size(151, 28);
comboBoxModel.TabIndex = 2;
//
// numericUpDownPrice
//
numericUpDownPrice.DecimalPlaces = 2;
numericUpDownPrice.Location = new Point(120, 118);
numericUpDownPrice.Maximum = new decimal(new int[] { 39999, 0, 0, 131072 });
numericUpDownPrice.Minimum = new decimal(new int[] { 39999, 0, 0, 131072 });
numericUpDownPrice.Name = "numericUpDownPrice";
numericUpDownPrice.Size = new Size(150, 27);
numericUpDownPrice.TabIndex = 3;
numericUpDownPrice.Value = new decimal(new int[] { 39999, 0, 0, 131072 });
//
// buttonSave
//
buttonSave.Location = new Point(48, 206);
buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(94, 29);
buttonSave.TabIndex = 4;
buttonSave.Text = "Сохранить";
buttonSave.UseVisualStyleBackColor = true;
buttonSave.Click += ButtonSave_Click;
//
// buttonCancel
//
buttonCancel.Location = new Point(176, 206);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(94, 29);
buttonCancel.TabIndex = 5;
buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true;
buttonCancel.Click += ButtonCancel_Click;
//
// groupBox1
//
groupBox1.Controls.Add(dataGridView1);
groupBox1.Location = new Point(323, 23);
groupBox1.Name = "groupBox1";
groupBox1.Size = new Size(251, 227);
groupBox1.TabIndex = 6;
groupBox1.TabStop = false;
groupBox1.Text = "Ткани";
//
// dataGridView1
//
dataGridView1.AllowUserToOrderColumns = true;
dataGridView1.AllowUserToResizeColumns = false;
dataGridView1.AllowUserToResizeRows = false;
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView1.Columns.AddRange(new DataGridViewColumn[] { ColumnFabric, ColumnCount });
dataGridView1.Dock = DockStyle.Fill;
dataGridView1.Location = new Point(3, 23);
dataGridView1.Name = "dataGridView1";
dataGridView1.RowHeadersVisible = false;
dataGridView1.RowHeadersWidth = 51;
dataGridView1.RowTemplate.Height = 29;
dataGridView1.Size = new Size(245, 201);
dataGridView1.TabIndex = 0;
//
// ColumnFabric
//
ColumnFabric.HeaderText = "Ткань";
ColumnFabric.MinimumWidth = 6;
ColumnFabric.Name = "ColumnFabric";
ColumnFabric.Resizable = DataGridViewTriState.True;
ColumnFabric.SortMode = DataGridViewColumnSortMode.Automatic;
//
// ColumnCount
//
ColumnCount.HeaderText = "Количество";
ColumnCount.MinimumWidth = 6;
ColumnCount.Name = "ColumnCount";
ColumnCount.Resizable = DataGridViewTriState.True;
ColumnCount.SortMode = DataGridViewColumnSortMode.NotSortable;
//
// FormModel
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(619, 284);
Controls.Add(groupBox1);
Controls.Add(buttonCancel);
Controls.Add(buttonSave);
Controls.Add(numericUpDownPrice);
Controls.Add(comboBoxModel);
Controls.Add(labelPrice);
Controls.Add(labelModel);
Name = "FormModel";
StartPosition = FormStartPosition.CenterParent;
Text = "Модель";
((System.ComponentModel.ISupportInitialize)numericUpDownPrice).EndInit();
groupBox1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private Label labelModel;
private Label labelPrice;
private ComboBox comboBoxModel;
private NumericUpDown numericUpDownPrice;
private Button buttonSave;
private Button buttonCancel;
private GroupBox groupBox1;
private DataGridView dataGridView1;
private DataGridViewComboBoxColumn ColumnFabric;
private DataGridViewTextBoxColumn ColumnCount;
}
}

View File

@ -0,0 +1,101 @@
using Microsoft.VisualBasic.FileIO;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection.Metadata.Ecma335;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Atelier.Forms
{
public partial class FormModel : Form
{
private readonly IModelRepository _modelRepository;
private int? _modelId;
public int Id
{
set
{
try
{
var model = _modelRepository.ReadModelById(value);
if (model == null)
{
throw new
InvalidDataException(nameof(model));
}
comboBoxModel.SelectedItem = model.ModelType;
numericUpDownPrice.Value = (decimal)model.Price;
_modelId = value;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
}
public FormModel(IModelRepository modelRepository, IFabricRepository fabricRepository)
{
InitializeComponent();
_modelRepository = modelRepository ??
throw new ArgumentNullException(nameof(modelRepository));
comboBoxModel.DataSource = Enum.GetValues(typeof(ModelType));
ColumnFabric.DataSource = fabricRepository.ReadFabrics();
ColumnFabric.DisplayMember = "FabricType";
ColumnFabric.ValueMember = "Id";
}
private void ButtonSave_Click(object sender, EventArgs e)
{
try
{
if (comboBoxModel.SelectedIndex < 399.99 || dataGridView1.RowCount < 1)
{
throw new Exception("Имеются незаполненные поля");
}
if (_modelId.HasValue)
{
_modelRepository.UpdateModel(CreateModel(_modelId.Value));
}
else
{
_modelRepository.CreateModel(CreateModel(0));
}
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при сохранении",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
private Model CreateModel(int id)
{
List<FabricModel> fabricModels = new List<FabricModel>();
foreach (DataGridViewRow row in dataGridView1.Rows)
{
if (row.Cells["ColumnFabric"].Value == null || row.Cells["ColumnCount"].Value == null || !(bool)row.Cells["CheckBoxColumn"].Value)
{
continue;
}
int fabricId = Convert.ToInt32(row.Cells["ColumnFabric"].Value);
int count = Convert.ToInt32(row.Cells["ColumnCount"].Value);
fabricModels.Add(FabricModel.CreateElement(0, fabricId, count));
}
return Model.CreateEntity(id, (ModelType)comboBoxModel.SelectedItem!, Convert.ToDouble(numericUpDownPrice.Value), fabricModels);
}
}
}

View File

@ -0,0 +1,126 @@
<?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="ColumnFabric.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ColumnCount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View File

@ -0,0 +1,128 @@
namespace Atelier.Forms
{
partial class FormModels
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormModels));
dataGridView1 = new DataGridView();
panel1 = new Panel();
buttonDel = new Button();
buttonUpd = new Button();
buttonAdd = new Button();
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
panel1.SuspendLayout();
SuspendLayout();
//
// dataGridView1
//
dataGridView1.AllowUserToAddRows = false;
dataGridView1.AllowUserToDeleteRows = false;
dataGridView1.AllowUserToResizeColumns = false;
dataGridView1.AllowUserToResizeRows = false;
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView1.Dock = DockStyle.Fill;
dataGridView1.Location = new Point(0, 0);
dataGridView1.MultiSelect = false;
dataGridView1.Name = "dataGridView1";
dataGridView1.ReadOnly = true;
dataGridView1.RowHeadersVisible = false;
dataGridView1.RowHeadersWidth = 51;
dataGridView1.RowTemplate.Height = 29;
dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView1.Size = new Size(1001, 604);
dataGridView1.TabIndex = 0;
//
// panel1
//
panel1.Controls.Add(buttonDel);
panel1.Controls.Add(buttonUpd);
panel1.Controls.Add(buttonAdd);
panel1.Dock = DockStyle.Right;
panel1.Location = new Point(1001, 0);
panel1.Name = "panel1";
panel1.Size = new Size(133, 604);
panel1.TabIndex = 1;
//
// buttonDel
//
buttonDel.Image = (Image)resources.GetObject("buttonDel.Image");
buttonDel.Location = new Point(14, 204);
buttonDel.Name = "buttonDel";
buttonDel.Size = new Size(107, 88);
buttonDel.TabIndex = 2;
buttonDel.UseVisualStyleBackColor = true;
buttonDel.Click += ButtonDel_Click;
//
// buttonUpd
//
buttonUpd.Image = (Image)resources.GetObject("buttonUpd.Image");
buttonUpd.Location = new Point(14, 107);
buttonUpd.Name = "buttonUpd";
buttonUpd.Size = new Size(107, 91);
buttonUpd.TabIndex = 1;
buttonUpd.UseVisualStyleBackColor = true;
buttonUpd.Click += ButtonUpd_Click;
//
// buttonAdd
//
buttonAdd.Image = (Image)resources.GetObject("buttonAdd.Image");
buttonAdd.Location = new Point(14, 12);
buttonAdd.Name = "buttonAdd";
buttonAdd.Size = new Size(107, 89);
buttonAdd.TabIndex = 0;
buttonAdd.UseVisualStyleBackColor = true;
buttonAdd.Click += ButtonAdd_Click;
//
// FormModels
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1134, 604);
Controls.Add(dataGridView1);
Controls.Add(panel1);
Name = "FormModels";
StartPosition = FormStartPosition.CenterParent;
Text = "Модели";
Load += FormModels_Load;
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
panel1.ResumeLayout(false);
ResumeLayout(false);
}
#endregion
private DataGridView dataGridView1;
private Panel panel1;
private Button buttonDel;
private Button buttonUpd;
private Button buttonAdd;
}
}

View File

@ -0,0 +1,109 @@
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 Atelier.Forms
{
public partial class FormModels : Form
{
private readonly IUnityContainer _container;
private readonly IModelRepository _modelRepository;
public FormModels(IUnityContainer container, IModelRepository modelRepository)
{
InitializeComponent();
_container = container ??
throw new ArgumentNullException(nameof(container));
_modelRepository = modelRepository ??
throw new
ArgumentNullException(nameof(modelRepository));
}
private void FormModels_Load(object sender, EventArgs e)
{
try
{
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при загрузке",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonAdd_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormModel>().ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при добавлении",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonUpd_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFromSelectedRow(out var findId))
{
return;
}
try
{
var form = _container.Resolve<FormModel>();
form.Id = findId;
form.ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при изменении",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonDel_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFromSelectedRow(out var findId))
{
return;
}
if (MessageBox.Show("Удалить запись?", "Удаление",
MessageBoxButtons.YesNo) != DialogResult.Yes)
{
return;
}
try
{
_modelRepository.DeleteModel(findId);
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при удалении",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void LoadList() => dataGridView1.DataSource = _modelRepository.ReadModels();
private bool TryGetIdentifierFromSelectedRow(out int id)
{
id = 0;
if (dataGridView1.SelectedRows.Count < 1)
{
MessageBox.Show("Нет выбранной записи", "Ошибка",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
id =
Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["Id"].Value);
return true;
}
}
}

View File

@ -0,0 +1,226 @@
<?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.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="buttonDel.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base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+8oPYkykp0jFbttJl5r9sk7Sk+ijGTnSMVum4nXmn3yjtKTKCPZOVKx22bitWaf
vKP0JMpIdo5U7LaZeK3ZJ+8oPYkykp0jFbttJl5r9sk7Sk+ijGTnSMVum4nXmn3yjtKTKCPZOVKx22bi
tWafvKP0JMpIdo5U7LaZeK3ZJ+8oPYkykp0jFbttJl5r9sk7Sk+ijGTnSMVum4nXmn3yjtKTKCPZOVKx
22bitWafvKP0JMpIdo5U7LaZeK3ZJ+8oPYkykp0jFbttJl5r9sk7Sk+ijGTnSMVum4nXmn3yjtKTKCPZ
OVKx22bitWafvKP0JMpIdo5U7LaZeK3ZJ+8oPYkykp0jFbttJl5r9sk7Sk+ijGTnSMVum4nXmn3yjtKT
KCPZOVKx22bitWafvKP0JMpIdo5U7LaZeK3ZJ+8oPYkykp0jFbttJl5r9sk7Sk+ijGTnSMVum4nXmn3y
jtKTKCPZOVKx22bitWafvKP0JMpIdo5U7LaZeK3ZJ+8oPYkykp0jFbttJl5r9sk7Sk+ijGTnSMVum4nX
mn3apOx1YX7AkVzJA8q3m03xq6DevJavelr/rTX7dLh78kq+mMv7j7jOnD5/fXH0zbNTrdkn+V49+Wo4
ecQpfBLlkyePd/jV+t3jnfXHWrNXH76Q8eRMvt1M/m5cZ6SDfPKu7PFmzZo1azLa2voHHNxQxvmbf3YA
AAAASUVORK5CYII=
</value>
</data>
<data name="buttonUpd.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DgAACw4BQL7hQQAAB1ZJREFUeF7tmllPG1cUx+nePrXqB6j60OdK/QRVK/Wx6lPfKlVVpUiNbZakJKSp
SpSoNE1sszsZsGfwQqEGQmIWB0zYkhAgDklYTIBAAgRQtlZN1QRSKafn3LkzDOMxmCiNl/hIfwnP2Mz5
/e+9557xOCsTmchESobV4v7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cZe+XfqKWd33kUw6e4qhZ
/FQxQDVhanMTqFmiewZ7tnzTwz5rkhpSDp6CnqdrDdCa8PfKNNybi7DOcDZ8CSL9Q6xDpIapco/cBzAh
PC6lV/m/TK3ANviIFn67ws87UxaeAiH8eigmk/Qv7Q64riP4+iz18VgsRQS2YnOzD499e+S7mg/5v0nd
sFvEzxGmhZ74oEwI+FlxjvR+0v3EPBOZyMSziays/wB+daIEvDXupgAAAABJRU5ErkJggg==
</value>
</data>
<data name="buttonAdd.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DgAACw4BQL7hQQAACDBJREFUeF7tXFlTFFcU9inbQ5JfkOU9eyqVPGT7B6kk5UsEZmkYfMFUCpnunkE2
Uy6pCotCEKa3ARQliklYRWMEyvigErSMmriRlMlDSpGSmaFUoHO/yaUmNncchpnunhnmq/qqKObc7VR3
n3PPPeeuyyOPtQtPW/VTjgD/YaFUsdGpCM3Fmu8k4ZRbFf5xKnzYEfDOg/gb/8NvkIFsUcBbWihXfIA+
aHdrA4527ztEKVtLgv5zTtl7b9P+upnagYZw46isq6f36z0Xvtd7L/Xr/VeG9eEbx6LE3/gffoMMZGtI
m03ddTPogyh10inxdQVy+dt0mNxCQXv5i0WKt5Y8RX9v7Npyd/tIy/3gxAF98NqIPjL1Y0pEH9rZA/o2
0mdpZ+Usp4p/OWS+xqHyL9DhsxeOgPAmWdCwWxUjW4ea5vadP8RUQjq579whvW5w15xbFubcqn9wg1Lx
Bp1O9gCKc6niaLHqDzWNygvpeNKSJcYkr/piseaPcKpvrFDiX6fTy1w41M+fdSuCRJ66cPO4tjB8/Shz
cVYSc9g1pi5ymjjHKb52Txv/DJ1uZsEpCeuJ8u7UDDRF+shHn7UYO/nD70N6dX9jBHN0SPyndNr2w6FW
P+GShYAnWBnaO2n+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bkRsmiD3UPc
RJ888lgDWLfuXyHjrOzkVJ7gAAAAAElFTkSuQmCC
</value>
</data>
</root>

View File

@ -0,0 +1,183 @@
namespace Atelier.Forms
{
partial class FormOrder
{
/// <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()
{
dateTimePicker1 = new DateTimePicker();
groupBox1 = new GroupBox();
dataGridView1 = new DataGridView();
ColumnModel = new DataGridViewComboBoxColumn();
ColumnCount = new DataGridViewTextBoxColumn();
labelClient = new Label();
comboBoxClient = new ComboBox();
comboBoxStatus = new ComboBox();
labelStatus = new Label();
buttonSave = new Button();
buttonCancel = new Button();
groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
SuspendLayout();
//
// dateTimePicker1
//
dateTimePicker1.Enabled = false;
dateTimePicker1.Location = new Point(20, 12);
dateTimePicker1.Name = "dateTimePicker1";
dateTimePicker1.Size = new Size(250, 27);
dateTimePicker1.TabIndex = 0;
//
// groupBox1
//
groupBox1.Controls.Add(dataGridView1);
groupBox1.Location = new Point(302, 12);
groupBox1.Name = "groupBox1";
groupBox1.Size = new Size(223, 176);
groupBox1.TabIndex = 1;
groupBox1.TabStop = false;
groupBox1.Text = "Модели";
//
// dataGridView1
//
dataGridView1.AllowUserToResizeColumns = false;
dataGridView1.AllowUserToResizeRows = false;
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView1.Columns.AddRange(new DataGridViewColumn[] { ColumnModel, ColumnCount });
dataGridView1.Dock = DockStyle.Fill;
dataGridView1.Location = new Point(3, 23);
dataGridView1.Name = "dataGridView1";
dataGridView1.RowHeadersVisible = false;
dataGridView1.RowHeadersWidth = 51;
dataGridView1.RowTemplate.Height = 29;
dataGridView1.Size = new Size(217, 150);
dataGridView1.TabIndex = 0;
//
// ColumnModel
//
ColumnModel.HeaderText = "Модель";
ColumnModel.MinimumWidth = 6;
ColumnModel.Name = "ColumnModel";
//
// ColumnCount
//
ColumnCount.HeaderText = "Количество";
ColumnCount.MinimumWidth = 6;
ColumnCount.Name = "ColumnCount";
//
// labelClient
//
labelClient.AutoSize = true;
labelClient.Location = new Point(20, 79);
labelClient.Name = "labelClient";
labelClient.Size = new Size(61, 20);
labelClient.TabIndex = 2;
labelClient.Text = "Клиент:";
//
// comboBoxClient
//
comboBoxClient.FormattingEnabled = true;
comboBoxClient.Location = new Point(95, 79);
comboBoxClient.Name = "comboBoxClient";
comboBoxClient.Size = new Size(151, 28);
comboBoxClient.TabIndex = 3;
//
// comboBoxStatus
//
comboBoxStatus.FormattingEnabled = true;
comboBoxStatus.Location = new Point(95, 139);
comboBoxStatus.Name = "comboBoxStatus";
comboBoxStatus.Size = new Size(151, 28);
comboBoxStatus.TabIndex = 6;
//
// labelStatus
//
labelStatus.AutoSize = true;
labelStatus.Location = new Point(26, 142);
labelStatus.Name = "labelStatus";
labelStatus.Size = new Size(55, 20);
labelStatus.TabIndex = 7;
labelStatus.Text = "Статус:";
//
// buttonSave
//
buttonSave.Location = new Point(152, 231);
buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(94, 29);
buttonSave.TabIndex = 8;
buttonSave.Text = "Сохранить";
buttonSave.UseVisualStyleBackColor = true;
buttonSave.Click += ButtonSave_Click;
//
// buttonCancel
//
buttonCancel.Location = new Point(302, 231);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(94, 29);
buttonCancel.TabIndex = 9;
buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true;
buttonCancel.Click += ButtonCancel_Click;
//
// FormOrder
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(556, 298);
Controls.Add(buttonCancel);
Controls.Add(buttonSave);
Controls.Add(labelStatus);
Controls.Add(comboBoxStatus);
Controls.Add(comboBoxClient);
Controls.Add(labelClient);
Controls.Add(groupBox1);
Controls.Add(dateTimePicker1);
Name = "FormOrder";
StartPosition = FormStartPosition.CenterParent;
Text = "Заказ";
groupBox1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private DateTimePicker dateTimePicker1;
private GroupBox groupBox1;
private DataGridView dataGridView1;
private DataGridViewComboBoxColumn ColumnModel;
private DataGridViewTextBoxColumn ColumnCount;
private Label labelClient;
private ComboBox comboBoxClient;
private ComboBox comboBoxStatus;
private Label labelStatus;
private Button buttonSave;
private Button buttonCancel;
}
}

View File

@ -0,0 +1,72 @@
using Microsoft.VisualBasic.FileIO;
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 Atelier.Forms
{
public partial class FormOrder : Form
{
private readonly IOrderRepository _orderRepository;
public FormOrder(IOrderRepository orderRepository, IModelRepository modelRepository, IClientRepository clientRepository)
{
InitializeComponent();
_orderRepository = orderRepository ??
throw new
ArgumentNullException(nameof(orderRepository));
comboBoxClient.DataSource = clientRepository.ReadClients();
comboBoxClient.DisplayMember = "FirstName";
comboBoxClient.ValueMember = "Id";
comboBoxStatus.DataSource = orderRepository.ReadOrders();
comboBoxStatus.DataSource = Enum.GetValues(typeof(Status));
ColumnModel.DataSource = modelRepository.ReadModels();
ColumnModel.DisplayMember = "ModelType";
ColumnModel.ValueMember = "Id";
}
private void ButtonSave_Click(object sender, EventArgs e)
{
try
{
if (dataGridView1.RowCount < 1 || comboBoxClient.SelectedIndex < 0 || comboBoxStatus.SelectedIndex < 0)
{
throw new Exception("Имеются незаполненные поля");
}
_orderRepository.CreateOrder(Order.CreateOperation(0, dateTimePicker1.Value, (Status)comboBoxStatus.SelectedValue,
(int)comboBoxClient.SelectedValue, CreateListModelOrderFromDataGrid()));
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при сохранении",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonCancel_Click(object sender, EventArgs e) =>
Close();
private List<ModelOrder>
CreateListModelOrderFromDataGrid()
{
var list = new List<ModelOrder>();
foreach (DataGridViewRow row in dataGridView1.Rows)
{
if (row.Cells["ColumnModel"].Value == null ||
row.Cells["ColumnCount"].Value == null)
{
continue;
}
list.Add(ModelOrder.CreateElement(0,
Convert.ToInt32(row.Cells["ColumnFeed"].Value),
Convert.ToInt32(row.Cells["ColumnCount"].Value)));
}
return list;
}
}
}

View File

@ -0,0 +1,132 @@
<?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="ColumnModel.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ColumnCount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ColumnModel.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ColumnCount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View File

@ -0,0 +1,113 @@
namespace Atelier.Forms
{
partial class FormOrders
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormOrders));
dataGridView1 = new DataGridView();
panel1 = new Panel();
buttonDel = new Button();
buttonAdd = new Button();
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
panel1.SuspendLayout();
SuspendLayout();
//
// dataGridView1
//
dataGridView1.AllowUserToAddRows = false;
dataGridView1.AllowUserToDeleteRows = false;
dataGridView1.AllowUserToResizeColumns = false;
dataGridView1.AllowUserToResizeRows = false;
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView1.Dock = DockStyle.Fill;
dataGridView1.Location = new Point(0, 0);
dataGridView1.MultiSelect = false;
dataGridView1.Name = "dataGridView1";
dataGridView1.ReadOnly = true;
dataGridView1.RowHeadersVisible = false;
dataGridView1.RowHeadersWidth = 51;
dataGridView1.RowTemplate.Height = 29;
dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView1.Size = new Size(1001, 604);
dataGridView1.TabIndex = 0;
//
// panel1
//
panel1.Controls.Add(buttonDel);
panel1.Controls.Add(buttonAdd);
panel1.Dock = DockStyle.Right;
panel1.Location = new Point(1001, 0);
panel1.Name = "panel1";
panel1.Size = new Size(133, 604);
panel1.TabIndex = 1;
//
// buttonDel
//
buttonDel.Image = (Image)resources.GetObject("buttonDel.Image");
buttonDel.Location = new Point(14, 204);
buttonDel.Name = "buttonDel";
buttonDel.Size = new Size(107, 88);
buttonDel.TabIndex = 2;
buttonDel.UseVisualStyleBackColor = true;
buttonDel.Click += ButtonDel_Click;
//
// buttonAdd
//
buttonAdd.Image = (Image)resources.GetObject("buttonAdd.Image");
buttonAdd.Location = new Point(14, 12);
buttonAdd.Name = "buttonAdd";
buttonAdd.Size = new Size(107, 89);
buttonAdd.TabIndex = 0;
buttonAdd.UseVisualStyleBackColor = true;
buttonAdd.Click += ButtonAdd_Click;
//
// FormOrders
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1134, 604);
Controls.Add(dataGridView1);
Controls.Add(panel1);
Name = "FormOrders";
StartPosition = FormStartPosition.CenterParent;
Text = "Заказы";
Load += FormOrders_Load;
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
panel1.ResumeLayout(false);
ResumeLayout(false);
}
#endregion
private DataGridView dataGridView1;
private Panel panel1;
private Button buttonDel;
private Button buttonAdd;
}
}

View File

@ -0,0 +1,91 @@
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;
using static Atelier.Forms.FormOrders;
namespace Atelier.Forms
{
public partial class FormOrders : Form
{
private readonly IUnityContainer _container;
private readonly IOrderRepository _orderRepository;
public FormOrders(IUnityContainer container,
IOrderRepository orderRepository)
{
InitializeComponent();
_container = container ??
throw new ArgumentNullException(nameof(container));
_orderRepository = orderRepository ??
throw new
ArgumentNullException(nameof(orderRepository));
}
private void FormOrders_Load(object sender, EventArgs e)
{
try
{
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при загрузке",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonAdd_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormOrder>().ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при добавлении",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonDel_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFromSelectedRow(out var findId))
{
return;
}
if (MessageBox.Show("Удалить запись?", "Удаление",
MessageBoxButtons.YesNo) != DialogResult.Yes)
{
return;
}
try
{
_orderRepository.DeleteOrder(findId);
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при удалении",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void LoadList() => dataGridView1.DataSource = _orderRepository.ReadOrders();
private bool TryGetIdentifierFromSelectedRow(out int id)
{
id = 0;
if (dataGridView1.SelectedRows.Count < 1)
{
MessageBox.Show("Нет выбранной записи", "Ошибка",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
id =
Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["Id"].Value);
return true;
}
}
}

View File

@ -0,0 +1,189 @@
<?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.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="buttonDel.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DAAACwwBP0AiyAAABNVJREFUeF7tnL9uXHUQhZ2OKk8ANRJ5AHipNInXgCFKyuD1H/ECZJ11Eh7AViCP
ELeJaCgQHV2gIIULc0cZ0KfRaDTaO2Ph63ukrzg+oxnOzxvT7dasWbNmzbpafX93fXtve/XTcnt1sVwc
X47iw46XslPXT1/LxerbvcXqxcOHTz7SH20s2TE84o9728cP9EfT1/B4b5f3n36udrQOdp58sbc4/kXt
tPV4Z3VnKPv75dblLf3RaMmu4Zfy2/L++jP90XQ1/L16NPz921dbpuHPwoHsVjtdVf/z/Vf/63/G+/d+
+ORo99nL/Z31+//+7zdRpOPQ9efvFutPtf44yeMdfn3y7vTF+cWb8z8uf33716SRjmdD1/0vn/4p3fUZ
Npd88mShd2zKnD4/vzjaPTnTZ9hcB8NH+iZ88izSefgUvtdn2Fzyd8E7cBOQ7voMm2t+wJGaH3CkZMlN
Rp+hTrL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zJA8q3m03xq6DevJavelr/rTX7dLh78kq+mMv7j7jOnD5/fXH0zbNTrdkn+V49+Wo4
ecQpfBLlkyePd/jV+t3jnfXHWrNXH76Q8eRMvt1M/m5cZ6SDfPKu7PFmzZo1azLa2voHHNxQxvmbf3YA
AAAASUVORK5CYII=
</value>
</data>
<data name="buttonAdd.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DAAACwwBP0AiyAAACDBJREFUeF7tXFlTFFcU9inbQ5JfkOU9eyqVPGT7B6kk5UsEZmkYfMFUCpnunkE2
Uy6pCotCEKa3ARQliklYRWMEyvigErSMmriRlMlDSpGSmaFUoHO/yaUmNncchpnunhnmq/qqKObc7VR3
n3PPPeeuyyOPtQtPW/VTjgD/YaFUsdGpCM3Fmu8k4ZRbFf5xKnzYEfDOg/gb/8NvkIFsUcBbWihXfIA+
aHdrA4527ztEKVtLgv5zTtl7b9P+upnagYZw46isq6f36z0Xvtd7L/Xr/VeG9eEbx6LE3/gffoMMZGtI
m03ddTPogyh10inxdQVy+dt0mNxCQXv5i0WKt5Y8RX9v7Npyd/tIy/3gxAF98NqIPjL1Y0pEH9rZA/o2
0mdpZ+Usp4p/OWS+xqHyL9DhsxeOgPAmWdCwWxUjW4ea5vadP8RUQjq579whvW5w15xbFubcqn9wg1Lx
Bp1O9gCKc6niaLHqDzWNygvpeNKSJcYkr/piseaPcKpvrFDiX6fTy1w41M+fdSuCRJ66cPO4tjB8/Shz
cVYSc9g1pi5ymjjHKb52Txv/DJ1uZsEpCeuJ8u7UDDRF+shHn7UYO/nD70N6dX9jBHN0SPyndNr2w6FW
P+GShYAnWBnaO2n+Ny5VdpE5lnZUhl3kaSxrKnucLsMewLq6VOGycPirUP/VzHvq4hFuEX94Z8StCZds
s9YFMv+qSxGnG0el+SNTx5gTzWRiz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Atelier.Forms
{
partial class FormStorage
{
/// <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()
{
comboBoxFabric = new ComboBox();
numericUpDownMetrage = new NumericUpDown();
labelFabric = new Label();
labelMetrage = new Label();
buttonSave = new Button();
buttonCancel = new Button();
((System.ComponentModel.ISupportInitialize)numericUpDownMetrage).BeginInit();
SuspendLayout();
//
// comboBoxFabric
//
comboBoxFabric.FormattingEnabled = true;
comboBoxFabric.Location = new Point(130, 22);
comboBoxFabric.Name = "comboBoxFabric";
comboBoxFabric.Size = new Size(151, 28);
comboBoxFabric.TabIndex = 0;
//
// numericUpDownMetrage
//
numericUpDownMetrage.DecimalPlaces = 2;
numericUpDownMetrage.Location = new Point(131, 81);
numericUpDownMetrage.Name = "numericUpDownMetrage";
numericUpDownMetrage.Size = new Size(150, 27);
numericUpDownMetrage.TabIndex = 1;
//
// labelFabric
//
labelFabric.AutoSize = true;
labelFabric.Location = new Point(40, 30);
labelFabric.Name = "labelFabric";
labelFabric.Size = new Size(52, 20);
labelFabric.TabIndex = 2;
labelFabric.Text = "Ткань:";
//
// labelMetrage
//
labelMetrage.AutoSize = true;
labelMetrage.Location = new Point(40, 88);
labelMetrage.Name = "labelMetrage";
labelMetrage.Size = new Size(67, 20);
labelMetrage.TabIndex = 3;
labelMetrage.Text = "Метраж:";
//
// buttonSave
//
buttonSave.Location = new Point(50, 148);
buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(94, 29);
buttonSave.TabIndex = 4;
buttonSave.Text = "Сохранить";
buttonSave.UseVisualStyleBackColor = true;
buttonSave.Click += ButtonSave_Click;
//
// buttonCancel
//
buttonCancel.Location = new Point(171, 148);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(94, 29);
buttonCancel.TabIndex = 5;
buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true;
buttonCancel.Click += ButtonCancel_Click;
//
// FormStorage
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(320, 213);
Controls.Add(buttonCancel);
Controls.Add(buttonSave);
Controls.Add(labelMetrage);
Controls.Add(labelFabric);
Controls.Add(numericUpDownMetrage);
Controls.Add(comboBoxFabric);
Name = "FormStorage";
StartPosition = FormStartPosition.CenterParent;
Text = "Склад";
((System.ComponentModel.ISupportInitialize)numericUpDownMetrage).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private ComboBox comboBoxFabric;
private NumericUpDown numericUpDownMetrage;
private Label labelFabric;
private Label labelMetrage;
private Button buttonSave;
private Button buttonCancel;
}
}

View File

@ -0,0 +1,48 @@
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 Atelier.Forms
{
public partial class FormStorage : Form
{
private readonly IStorageRepository _storageRepository;
public FormStorage(IStorageRepository storageRepository, IFabricRepository fabricRepository)
{
InitializeComponent();
_storageRepository = storageRepository ??
throw new
ArgumentNullException(nameof(storageRepository));
comboBoxFabric.DataSource = fabricRepository.ReadFabrics();
comboBoxFabric.DisplayMember = "FabricType";
comboBoxFabric.ValueMember = "Id";
}
private void ButtonSave_Click(object sender, EventArgs e)
{
try
{
if (comboBoxFabric.SelectedIndex < 0)
{
throw new Exception("Имеются незаполненные поля");
}
_storageRepository.CreateStorage(Storage.CreateOperation(0, (int)comboBoxFabric.SelectedValue!, Convert.ToInt32(numericUpDownMetrage.Value)));
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при сохранении",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
}
}

View 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>

View File

@ -0,0 +1,113 @@
namespace Atelier.Forms
{
partial class FormStorages
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormStorages));
dataGridView1 = new DataGridView();
panel1 = new Panel();
buttonDel = new Button();
buttonAdd = new Button();
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
panel1.SuspendLayout();
SuspendLayout();
//
// dataGridView1
//
dataGridView1.AllowUserToAddRows = false;
dataGridView1.AllowUserToDeleteRows = false;
dataGridView1.AllowUserToResizeColumns = false;
dataGridView1.AllowUserToResizeRows = false;
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView1.Dock = DockStyle.Fill;
dataGridView1.Location = new Point(0, 0);
dataGridView1.MultiSelect = false;
dataGridView1.Name = "dataGridView1";
dataGridView1.ReadOnly = true;
dataGridView1.RowHeadersVisible = false;
dataGridView1.RowHeadersWidth = 51;
dataGridView1.RowTemplate.Height = 29;
dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView1.Size = new Size(1001, 604);
dataGridView1.TabIndex = 0;
//
// panel1
//
panel1.Controls.Add(buttonDel);
panel1.Controls.Add(buttonAdd);
panel1.Dock = DockStyle.Right;
panel1.Location = new Point(1001, 0);
panel1.Name = "panel1";
panel1.Size = new Size(133, 604);
panel1.TabIndex = 1;
//
// buttonDel
//
buttonDel.Image = (Image)resources.GetObject("buttonDel.Image");
buttonDel.Location = new Point(14, 204);
buttonDel.Name = "buttonDel";
buttonDel.Size = new Size(107, 88);
buttonDel.TabIndex = 2;
buttonDel.UseVisualStyleBackColor = true;
buttonDel.Click += ButtonDel_Click;
//
// buttonAdd
//
buttonAdd.Image = (Image)resources.GetObject("buttonAdd.Image");
buttonAdd.Location = new Point(14, 12);
buttonAdd.Name = "buttonAdd";
buttonAdd.Size = new Size(107, 89);
buttonAdd.TabIndex = 0;
buttonAdd.UseVisualStyleBackColor = true;
buttonAdd.Click += ButtonAdd_Click;
//
// FormStorages
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1134, 604);
Controls.Add(dataGridView1);
Controls.Add(panel1);
Name = "FormStorages";
StartPosition = FormStartPosition.CenterParent;
Text = "Склады";
Load += FormStorages_Load;
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
panel1.ResumeLayout(false);
ResumeLayout(false);
}
#endregion
private DataGridView dataGridView1;
private Panel panel1;
private Button buttonDel;
private Button buttonAdd;
}
}

View File

@ -0,0 +1,91 @@
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 Atelier.Forms
{
public partial class FormStorages : Form
{
private readonly IUnityContainer _container;
private readonly IStorageRepository _storageRepository;
public FormStorages(IUnityContainer container, IStorageRepository storageRepository)
{
InitializeComponent();
_container = container ??
throw new ArgumentNullException(nameof(container));
_storageRepository = storageRepository ??
throw new
ArgumentNullException(nameof(storageRepository));
}
private void FormStorages_Load(object sender, EventArgs e)
{
try
{
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при загрузке",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonAdd_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormStorage>().ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при добавлении",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonDel_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFromSelectedRow(out var findId))
{
return;
}
if (MessageBox.Show("Удалить запись?", "Удаление",
MessageBoxButtons.YesNo) != DialogResult.Yes)
{
return;
}
try
{
_storageRepository.DeleteStorage(findId);
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при удалении",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void LoadList() => dataGridView1.DataSource =
_storageRepository.ReadStorage();
private bool TryGetIdentifierFromSelectedRow(out int id)
{
id = 0;
if (dataGridView1.SelectedRows.Count < 1)
{
MessageBox.Show("Нет выбранной записи", "Ошибка",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
id =
Convert.ToInt32(dataGridView1.SelectedRows[0].Cells["Id"].Value);
return true;
}
}
}

View File

@ -0,0 +1,189 @@
<?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.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="buttonDel.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DgAACw4BQL7hQQAABNVJREFUeF7tnL9uXHUQhZ2OKk8ANRJ5AHipNInXgCFKyuD1H/ECZJ11Eh7AViCP
ELeJaCgQHV2gIIULc0cZ0KfRaDTaO2Ph63ukrzg+oxnOzxvT7dasWbNmzbpafX93fXtve/XTcnt1sVwc
X47iw46XslPXT1/LxerbvcXqxcOHTz7SH20s2TE84o9728cP9EfT1/B4b5f3n36udrQOdp58sbc4/kXt
tP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KP0JMpIdo5U7LaZeK3ZJ+8oPYkykp0jFbttJl5r9sk7Sk+ijGTnSMVum4nXmn3yjtKT
KCPZOVKx22bitWafvKP0JMpIdo5U7LaZeK3ZJ+8oPYkykp0jFbttJl5r9sk7Sk+ijGTnSMVum4nXmn3y
jtKTKCPZOVKx22bitWafvKP0JMpIdo5U7LaZeK3ZJ+8oPYkykp0jFbttJl5r9sk7Sk+ijGTnSMVum4nX
mn3apOx1YX7AkVzJA8q3m03xq6DevJavelr/rTX7dLh78kq+mMv7j7jOnD5/fXH0zbNTrdkn+V49+Wo4
ecQpfBLlkyePd/jV+t3jnfXHWrNXH76Q8eRMvt1M/m5cZ6SDfPKu7PFmzZo1azLa2voHHNxQxvmbf3YA
AAAASUVORK5CYII=
</value>
</data>
<data name="buttonAdd.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DgAACw4BQL7hQQAACDBJREFUeF7tXFlTFFcU9inbQ5JfkOU9eyqVPGT7B6kk5UsEZmkYfMFUCpnunkE2
Uy6pCotCEKa3ARQliklYRWMEyvigErSMmriRlMlDSpGSmaFUoHO/yaUmNncchpnunhnmq/qqKObc7VR3
n3PPPeeuyyOPtQtPW/VTjgD/YaFUsdGpCM3Fmu8k4ZRbFf5xKnzYEfDOg/gb/8NvkIFsUcBbWihXfIA+
aHdrA4527ztEKVtLgv5zTtl7b9P+upnagYZw46isq6f36z0Xvtd7L/Xr/VeG9eEbx6LE3/gffoMMZGtI
m03ddTPogyh10inxdQVy+dt0mNxCQXv5i0WKt5Y8RX9v7Npyd/tIy/3gxAF98NqIPjL1Y0pEH9rZA/o2
0mdpZ+Usp4p/OWS+xqHyL9DhsxeOgPAmWdCwWxUjW4ea5vadP8RUQjq579whvW5w15xbFubcqn9wg1Lx
Bp1O9gCKc6niaLHqDzWNyg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CocmaJkdNuR
5vs45U/Hk4k+0BcOvXFui6NHh+zdYrt1NQuot3VKQjV5MieQZ4Las+q+hlDjqBQtYkECY7yLuPEb8vMa
Tsg62iDRB32ggtIl81VJXQyRC0CSDraGjkCFBzl3RKnjXNB3HSm0yNleugqeuEkh/A+/IbkRsmiD3UPc
RJ888lgDWLfuXyHjrOzkVJ7gAAAAAElFTkSuQmCC
</value>
</data>
</root>

View File

@ -1,6 +1,8 @@
namespace Atelier using Atelier;
{ using Unity;
internal static class Program using Unity.Lifetime;
internal static class Program
{ {
/// <summary> /// <summary>
/// The main entry point for the application. /// The main entry point for the application.
@ -11,7 +13,16 @@ namespace Atelier
// To customize application configuration such as set high DPI settings or default font, // To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration. // see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize(); ApplicationConfiguration.Initialize();
Application.Run(new Form1()); Application.Run(CreateContainer().Resolve<FormAtelier>());
} }
private static IUnityContainer CreateContainer()
{
var container = new UnityContainer();
container.RegisterType<IClientRepository,ClientRepository>(new TransientLifetimeManager());
container.RegisterType<IFabricRepository,FabricRepository>(new TransientLifetimeManager());
container.RegisterType<IModelRepository, ModelRepository>(new TransientLifetimeManager());
container.RegisterType<IOrderRepository,OrderRepository>(new TransientLifetimeManager());
container.RegisterType<IStorageRepository,StorageRepository>(new TransientLifetimeManager());
return container;
} }
} }

View File

@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Atelier.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("Atelier.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;
}
}
}
}

View File

@ -0,0 +1,9 @@
public interface IClientRepository
{
IEnumerable<Client> ReadClients();
Client ReadClientById(int id);
void CreateClient(Client client);
void UpdateClient(Client client);
void DeleteClient(int id);
}

View File

@ -0,0 +1,9 @@
public interface IFabricRepository
{
IEnumerable<Fabric> ReadFabrics();
Fabric ReadFabricById(int id);
void CreateFabric(Fabric fabric);
void UpdateFabric(Fabric fabric);
void DeleteFabric(int id);
}

View File

@ -0,0 +1,9 @@
public interface IModelRepository
{
IEnumerable<Model> ReadModels();
Model ReadModelById(int id);
void CreateModel(Model model);
void UpdateModel(Model model);
void DeleteModel(int id);
}

View File

@ -0,0 +1,7 @@
public interface IOrderRepository
{
IEnumerable<Order> ReadOrders(int? id = null, DateTime? dateFrom = null, DateTime? dateTo = null,
Status? status = null, int? clientId = null);
void CreateOrder(Order order);
void DeleteOrder(int id);
}

View File

@ -0,0 +1,6 @@
public interface IStorageRepository
{
IEnumerable<Storage> ReadStorage(double? minStockMetrage = null, double? maxStockMetrage = null, int? fabricId = null);
void CreateStorage(Storage storage);
void DeleteStorage(int id);
}

View File

@ -0,0 +1,23 @@
using Microsoft.VisualBasic.FileIO;
internal class ClientRepository : IClientRepository
{
public void CreateClient(Client client)
{
}
public void DeleteClient(int id)
{
}
public Client ReadClientById(int id)
{
return Client.CreateEntity(0, string.Empty, string.Empty, string.Empty);
}
public IEnumerable<Client> ReadClients()
{
return [];
}
public void UpdateClient(Client client)
{
}
}

View File

@ -0,0 +1,20 @@
internal class FabricRepository : IFabricRepository
{
public void CreateFabric(Fabric fabric)
{
}
public void DeleteFabric(int id)
{
}
public Fabric ReadFabricById(int id)
{
return Fabric.CreateEntity(0, FabricType.None, Color.None, 0);
}
public IEnumerable<Fabric> ReadFabrics()
{
return [];
}
public void UpdateFabric(Fabric fabric)
{
}
}

View File

@ -0,0 +1,20 @@
internal class ModelRepository : IModelRepository
{
public void CreateModel(Model model)
{
}
public void DeleteModel(int id)
{
}
public Model ReadModelById(int id)
{
return Model.CreateEntity(0, ModelType.None, 0, Enumerable.Empty<FabricModel>());
}
public IEnumerable<Model> ReadModels()
{
return [];
}
public void UpdateModel(Model model)
{
}
}

View File

@ -0,0 +1,14 @@
internal class OrderRepository : IOrderRepository
{
public void CreateOrder(Order order)
{
}
public void DeleteOrder(int id)
{
}
public IEnumerable<Order> ReadOrders(int? id = null, DateTime?dateForm = null, DateTime? dateTo = null,
Status? status = null, int? clientId = null)
{
return [];
}
}

View File

@ -0,0 +1,16 @@
internal class StorageRepository : IStorageRepository
{
public void CreateStorage(Storage storage)
{
}
public void UpdateStorage(Storage storage)
{
}
public void DeleteStorage(int id)
{
}
public IEnumerable<Storage> ReadStorage(double? minStockMetrage = null, double? maxStockMetrage = null, int? fabricId = null)
{
return [];
}
}