initial mega big commit
This commit is contained in:
parent
57ab609a8c
commit
acdf703e9b
@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPublishing.Entities
|
||||
{
|
||||
public class ContactPerson
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
|
||||
public string Name { get; private set; }
|
||||
|
||||
public string PhoneNumber { get; private set; }
|
||||
|
||||
public string Email { get; private set; }
|
||||
|
||||
public static ContactPerson CreateContactPerson(int id, string name, string phoneNumber, string email)
|
||||
{
|
||||
return new ContactPerson
|
||||
{
|
||||
Id = id,
|
||||
Name = name,
|
||||
PhoneNumber = phoneNumber,
|
||||
Email = email
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
30
ProjectPublishing/ProjectPublishing/Entities/Customer.cs
Normal file
30
ProjectPublishing/ProjectPublishing/Entities/Customer.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPublishing.Entities
|
||||
{
|
||||
public class Customer
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
|
||||
public string PhoneNumber { get; private set; }
|
||||
|
||||
public string Email { get; private set; }
|
||||
|
||||
public int PublisherId { get; private set; }
|
||||
|
||||
public static Customer CreateCustomer(int id, string phoneNumber, string email, int publisherId)
|
||||
{
|
||||
return new Customer
|
||||
{
|
||||
Id = id,
|
||||
PhoneNumber = phoneNumber,
|
||||
Email = email,
|
||||
PublisherId = publisherId
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPublishing.Entities.Enums
|
||||
{
|
||||
public enum MaterialType
|
||||
{
|
||||
Paper = 0,
|
||||
Cardboard = 1,
|
||||
Ink = 2,
|
||||
Cover = 3
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPublishing.Entities.Enums
|
||||
{
|
||||
public enum OrderStatus
|
||||
{
|
||||
Waiting = 0,
|
||||
InProgress = 1,
|
||||
Done = 2
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPublishing.Entities.Enums
|
||||
{
|
||||
public enum ProductType
|
||||
{
|
||||
Book = 0,
|
||||
Brochure = 1,
|
||||
Booklet = 2,
|
||||
Advertisement = 3,
|
||||
Bulletin = 4
|
||||
}
|
||||
}
|
21
ProjectPublishing/ProjectPublishing/Entities/Material.cs
Normal file
21
ProjectPublishing/ProjectPublishing/Entities/Material.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using ProjectPublishing.Entities.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPublishing.Entities
|
||||
{
|
||||
public class Material
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
|
||||
public MaterialType MaterialType { get; private set; }
|
||||
|
||||
public static Material CreateMaterial(int id, MaterialType materialType)
|
||||
{
|
||||
return new Material { Id = id, MaterialType = materialType };
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPublishing.Entities
|
||||
{
|
||||
public class MaterialsAdmission
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
|
||||
public int Amount { get; private set; }
|
||||
|
||||
public DateTime DateTime { get; private set; }
|
||||
|
||||
public int MaterialId { get; private set; }
|
||||
|
||||
public static MaterialsAdmission CreateOperation(int id, int amount, int materialId)
|
||||
{
|
||||
return new MaterialsAdmission { Id = id, Amount = amount, DateTime = DateTime.Now, MaterialId = materialId };
|
||||
}
|
||||
}
|
||||
}
|
34
ProjectPublishing/ProjectPublishing/Entities/Order.cs
Normal file
34
ProjectPublishing/ProjectPublishing/Entities/Order.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using ProjectPublishing.Entities.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPublishing.Entities
|
||||
{
|
||||
public class Order
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
public DateTime OrderDate { get; private set; }
|
||||
|
||||
public string Description { get; private set; }
|
||||
|
||||
public ProductType ProductType { get; private set; }
|
||||
|
||||
public int Amount { get; private set; }
|
||||
|
||||
public OrderStatus Status { get; private set; }
|
||||
|
||||
public int CustomerId { get; private set; }
|
||||
|
||||
public int PrintingId { get; private set; }
|
||||
|
||||
public int MaterialsId { get; private set; }
|
||||
|
||||
public static Order CreateOrder(int id, string description, ProductType productType, int amount, OrderStatus status, int customerId, int printingId, int materialsId)
|
||||
{
|
||||
return new Order { ProductType = productType, Id = id, Amount = amount, Status = status, CustomerId = customerId, PrintingId = printingId, MaterialsId = materialsId, OrderDate = DateTime.Now, Description = description ?? string.Empty };
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPublishing.Entities
|
||||
{
|
||||
public class PrintingHouse
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
|
||||
public string Name { get; private set; }
|
||||
|
||||
public string Address { get; private set; }
|
||||
|
||||
public string PhoneNumber { get; private set; }
|
||||
|
||||
public string Email { get; private set; }
|
||||
|
||||
public static PrintingHouse CreatePrintingHouse(int Id, string name, string address, string phoneNumber, string email)
|
||||
{
|
||||
return new PrintingHouse { Id = Id, Name = name, Address = address, PhoneNumber = phoneNumber, Email = email };
|
||||
}
|
||||
}
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
namespace ProjectPublishing
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Text = "Form1";
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
namespace ProjectPublishing
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
144
ProjectPublishing/ProjectPublishing/FormPublishing.Designer.cs
generated
Normal file
144
ProjectPublishing/ProjectPublishing/FormPublishing.Designer.cs
generated
Normal file
@ -0,0 +1,144 @@
|
||||
namespace ProjectPublishing
|
||||
{
|
||||
partial class FormPublishing
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
menuStrip1 = new MenuStrip();
|
||||
справочникиToolStripMenuItem = new ToolStripMenuItem();
|
||||
покупательToolStripMenuItem = new ToolStripMenuItem();
|
||||
контактнаяПерсонаToolStripMenuItem = new ToolStripMenuItem();
|
||||
заказToolStripMenuItem = new ToolStripMenuItem();
|
||||
материалыToolStripMenuItem = new ToolStripMenuItem();
|
||||
типографияToolStripMenuItem = new ToolStripMenuItem();
|
||||
операцииToolStripMenuItem = new ToolStripMenuItem();
|
||||
получениеМатериаловToolStripMenuItem = new ToolStripMenuItem();
|
||||
отчетыToolStripMenuItem = new ToolStripMenuItem();
|
||||
menuStrip1.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// menuStrip1
|
||||
//
|
||||
menuStrip1.ImageScalingSize = new Size(20, 20);
|
||||
menuStrip1.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, операцииToolStripMenuItem, отчетыToolStripMenuItem });
|
||||
menuStrip1.Location = new Point(0, 0);
|
||||
menuStrip1.Name = "menuStrip1";
|
||||
menuStrip1.Size = new Size(800, 28);
|
||||
menuStrip1.TabIndex = 0;
|
||||
menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
// справочникиToolStripMenuItem
|
||||
//
|
||||
справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { покупательToolStripMenuItem, контактнаяПерсонаToolStripMenuItem, заказToolStripMenuItem, материалыToolStripMenuItem, типографияToolStripMenuItem });
|
||||
справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem";
|
||||
справочникиToolStripMenuItem.Size = new Size(117, 24);
|
||||
справочникиToolStripMenuItem.Text = "Справочники";
|
||||
//
|
||||
// покупательToolStripMenuItem
|
||||
//
|
||||
покупательToolStripMenuItem.Name = "покупательToolStripMenuItem";
|
||||
покупательToolStripMenuItem.Size = new Size(234, 26);
|
||||
покупательToolStripMenuItem.Text = "Покупатель";
|
||||
покупательToolStripMenuItem.Click += покупательToolStripMenuItem_Click;
|
||||
//
|
||||
// контактнаяПерсонаToolStripMenuItem
|
||||
//
|
||||
контактнаяПерсонаToolStripMenuItem.Name = "контактнаяПерсонаToolStripMenuItem";
|
||||
контактнаяПерсонаToolStripMenuItem.Size = new Size(234, 26);
|
||||
контактнаяПерсонаToolStripMenuItem.Text = "Контактная персона";
|
||||
контактнаяПерсонаToolStripMenuItem.Click += контактнаяПерсонаToolStripMenuItem_Click;
|
||||
//
|
||||
// заказToolStripMenuItem
|
||||
//
|
||||
заказToolStripMenuItem.Name = "заказToolStripMenuItem";
|
||||
заказToolStripMenuItem.Size = new Size(234, 26);
|
||||
заказToolStripMenuItem.Text = "Заказ";
|
||||
заказToolStripMenuItem.Click += заказToolStripMenuItem_Click;
|
||||
//
|
||||
// материалыToolStripMenuItem
|
||||
//
|
||||
материалыToolStripMenuItem.Name = "материалыToolStripMenuItem";
|
||||
материалыToolStripMenuItem.Size = new Size(234, 26);
|
||||
материалыToolStripMenuItem.Text = "Материалы";
|
||||
материалыToolStripMenuItem.Click += материалыToolStripMenuItem_Click;
|
||||
//
|
||||
// типографияToolStripMenuItem
|
||||
//
|
||||
типографияToolStripMenuItem.Name = "типографияToolStripMenuItem";
|
||||
типографияToolStripMenuItem.Size = new Size(234, 26);
|
||||
типографияToolStripMenuItem.Text = "Типография";
|
||||
типографияToolStripMenuItem.Click += типографияToolStripMenuItem_Click;
|
||||
//
|
||||
// операцииToolStripMenuItem
|
||||
//
|
||||
операцииToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { получениеМатериаловToolStripMenuItem });
|
||||
операцииToolStripMenuItem.Name = "операцииToolStripMenuItem";
|
||||
операцииToolStripMenuItem.Size = new Size(95, 24);
|
||||
операцииToolStripMenuItem.Text = "Операции";
|
||||
//
|
||||
// получениеМатериаловToolStripMenuItem
|
||||
//
|
||||
получениеМатериаловToolStripMenuItem.Name = "получениеМатериаловToolStripMenuItem";
|
||||
получениеМатериаловToolStripMenuItem.Size = new Size(257, 26);
|
||||
получениеМатериаловToolStripMenuItem.Text = "Получение материалов";
|
||||
получениеМатериаловToolStripMenuItem.Click += получениеМатериаловToolStripMenuItem_Click;
|
||||
//
|
||||
// отчетыToolStripMenuItem
|
||||
//
|
||||
отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem";
|
||||
отчетыToolStripMenuItem.Size = new Size(73, 24);
|
||||
отчетыToolStripMenuItem.Text = "Отчеты";
|
||||
//
|
||||
// FormPublishing
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 450);
|
||||
Controls.Add(menuStrip1);
|
||||
MainMenuStrip = menuStrip1;
|
||||
Name = "FormPublishing";
|
||||
Text = "Издательство";
|
||||
menuStrip1.ResumeLayout(false);
|
||||
menuStrip1.PerformLayout();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private MenuStrip menuStrip1;
|
||||
private ToolStripMenuItem справочникиToolStripMenuItem;
|
||||
private ToolStripMenuItem покупательToolStripMenuItem;
|
||||
private ToolStripMenuItem контактнаяПерсонаToolStripMenuItem;
|
||||
private ToolStripMenuItem заказToolStripMenuItem;
|
||||
private ToolStripMenuItem материалыToolStripMenuItem;
|
||||
private ToolStripMenuItem типографияToolStripMenuItem;
|
||||
private ToolStripMenuItem операцииToolStripMenuItem;
|
||||
private ToolStripMenuItem получениеМатериаловToolStripMenuItem;
|
||||
private ToolStripMenuItem отчетыToolStripMenuItem;
|
||||
}
|
||||
}
|
87
ProjectPublishing/ProjectPublishing/FormPublishing.cs
Normal file
87
ProjectPublishing/ProjectPublishing/FormPublishing.cs
Normal file
@ -0,0 +1,87 @@
|
||||
using ProjectPublishing.Forms;
|
||||
using Unity;
|
||||
|
||||
namespace ProjectPublishing
|
||||
{
|
||||
public partial class FormPublishing : Form
|
||||
{
|
||||
private readonly IUnityContainer _container;
|
||||
public FormPublishing(IUnityContainer container)
|
||||
{
|
||||
InitializeComponent();
|
||||
_container = container ?? throw new ArgumentNullException(nameof(container));
|
||||
}
|
||||
|
||||
private void ïîêóïàòåëüToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormCustomers>().ShowDialog();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void êîíòàêòíàÿÏåðñîíàToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormContactPeople>().ShowDialog();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void çàêàçToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormOrders>().ShowDialog();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void ìàòåðèàëûToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormMaterials>().ShowDialog();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void òèïîãðàôèÿToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormPrintingHouses>().ShowDialog();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void ïîëó÷åíèåÌàòåðèàëîâToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormMaterialAdmissions>().ShowDialog();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
123
ProjectPublishing/ProjectPublishing/FormPublishing.resx
Normal file
123
ProjectPublishing/ProjectPublishing/FormPublishing.resx
Normal file
@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
123
ProjectPublishing/ProjectPublishing/Forms/FormContactPeople.Designer.cs
generated
Normal file
123
ProjectPublishing/ProjectPublishing/Forms/FormContactPeople.Designer.cs
generated
Normal file
@ -0,0 +1,123 @@
|
||||
namespace ProjectPublishing.Forms
|
||||
{
|
||||
partial class FormContactPeople
|
||||
{
|
||||
/// <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(FormContactPeople));
|
||||
dataGridView = new DataGridView();
|
||||
panelButtons = new Panel();
|
||||
buttonRemove = new Button();
|
||||
buttonEdit = new Button();
|
||||
buttonAdd = new Button();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
panelButtons.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// dataGridView
|
||||
//
|
||||
dataGridView.AllowUserToAddRows = false;
|
||||
dataGridView.AllowUserToDeleteRows = false;
|
||||
dataGridView.AllowUserToResizeColumns = false;
|
||||
dataGridView.AllowUserToResizeRows = false;
|
||||
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dataGridView.Dock = DockStyle.Fill;
|
||||
dataGridView.Location = new Point(0, 0);
|
||||
dataGridView.MultiSelect = false;
|
||||
dataGridView.Name = "dataGridView";
|
||||
dataGridView.ReadOnly = true;
|
||||
dataGridView.RowHeadersVisible = false;
|
||||
dataGridView.RowHeadersWidth = 51;
|
||||
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dataGridView.Size = new Size(648, 450);
|
||||
dataGridView.TabIndex = 3;
|
||||
//
|
||||
// panelButtons
|
||||
//
|
||||
panelButtons.Controls.Add(buttonRemove);
|
||||
panelButtons.Controls.Add(buttonEdit);
|
||||
panelButtons.Controls.Add(buttonAdd);
|
||||
panelButtons.Dock = DockStyle.Right;
|
||||
panelButtons.Location = new Point(648, 0);
|
||||
panelButtons.Name = "panelButtons";
|
||||
panelButtons.Size = new Size(152, 450);
|
||||
panelButtons.TabIndex = 2;
|
||||
//
|
||||
// buttonRemove
|
||||
//
|
||||
buttonRemove.Image = (Image)resources.GetObject("buttonRemove.Image");
|
||||
buttonRemove.Location = new Point(23, 254);
|
||||
buttonRemove.Name = "buttonRemove";
|
||||
buttonRemove.Size = new Size(115, 115);
|
||||
buttonRemove.TabIndex = 2;
|
||||
buttonRemove.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// buttonEdit
|
||||
//
|
||||
buttonEdit.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
buttonEdit.Image = (Image)resources.GetObject("buttonEdit.Image");
|
||||
buttonEdit.Location = new Point(23, 133);
|
||||
buttonEdit.Name = "buttonEdit";
|
||||
buttonEdit.Size = new Size(115, 115);
|
||||
buttonEdit.TabIndex = 1;
|
||||
buttonEdit.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// buttonAdd
|
||||
//
|
||||
buttonAdd.BackgroundImageLayout = ImageLayout.Center;
|
||||
buttonAdd.Image = (Image)resources.GetObject("buttonAdd.Image");
|
||||
buttonAdd.Location = new Point(23, 12);
|
||||
buttonAdd.Name = "buttonAdd";
|
||||
buttonAdd.Size = new Size(115, 115);
|
||||
buttonAdd.TabIndex = 0;
|
||||
buttonAdd.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// FormContactPeople
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 450);
|
||||
Controls.Add(dataGridView);
|
||||
Controls.Add(panelButtons);
|
||||
Name = "FormContactPeople";
|
||||
StartPosition = FormStartPosition.CenterParent;
|
||||
Text = "Контактные личности издательств";
|
||||
Load += FormContactPeople_Load;
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
panelButtons.ResumeLayout(false);
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DataGridView dataGridView;
|
||||
private Panel panelButtons;
|
||||
private Button buttonRemove;
|
||||
private Button buttonEdit;
|
||||
private Button buttonAdd;
|
||||
}
|
||||
}
|
106
ProjectPublishing/ProjectPublishing/Forms/FormContactPeople.cs
Normal file
106
ProjectPublishing/ProjectPublishing/Forms/FormContactPeople.cs
Normal file
@ -0,0 +1,106 @@
|
||||
using ProjectPublishing.Repositories;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Unity;
|
||||
|
||||
namespace ProjectPublishing.Forms
|
||||
{
|
||||
public partial class FormContactPeople : Form
|
||||
{
|
||||
private readonly IUnityContainer _container;
|
||||
private readonly IContactPersonRepository _contactPersonRepository;
|
||||
public FormContactPeople(IUnityContainer container, IContactPersonRepository contactPersonRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_container = container ?? throw new ArgumentException(nameof(container));
|
||||
_contactPersonRepository = contactPersonRepository ?? throw new ArgumentException(nameof(contactPersonRepository));
|
||||
}
|
||||
|
||||
private void buttonAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormContactPerson>().ShowDialog();
|
||||
loadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!tryGetIDFromRow(out var findId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
var form = _container.Resolve<FormContactPerson>();
|
||||
form.Id = findId;
|
||||
form.ShowDialog();
|
||||
loadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonRemove_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!tryGetIDFromRow(out var findId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
_contactPersonRepository.DeleteContactPerson(findId);
|
||||
loadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void FormContactPeople_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
loadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void loadList() => dataGridView.DataSource = _contactPersonRepository.ReadContactPeople();
|
||||
|
||||
private bool tryGetIDFromRow(out int id)
|
||||
{
|
||||
id = 0;
|
||||
if (dataGridView.SelectedRows.Count < 1)
|
||||
{
|
||||
MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return false;
|
||||
}
|
||||
id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
233
ProjectPublishing/ProjectPublishing/Forms/FormContactPeople.resx
Normal file
233
ProjectPublishing/ProjectPublishing/Forms/FormContactPeople.resx
Normal file
@ -0,0 +1,233 @@
|
||||
<?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="buttonRemove.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
|
||||
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAB3RJTUUH6AcSDjMPELkl4AAACdZJREFU
|
||||
eF7tnUWsJUUUhh8Ed3d3h+CaQHBfsSH4gg0e3II7JDhhga5wHSDBQ3DXDcEXOAR3+79kXhiKc9871bf6
|
||||
3u7b50u+ZDLzprq7+nV3yalTY0EQBEEQBEHQi+nlsnJ7eZi8Uj4gn5Gvy3fl1/LXqfJn/o5/e1reL6+Q
|
||||
h0rKWEZSZjAkZpXbyLMkN+hn+XdhKfMpeabcWnLMoEaWlsfLx+Uv0ropdcoxH5PHyaVkUACemj3kvfIP
|
||||
aVX8MPxTPikPlHPKIJPV5PXyJ2lVcJP8UV4nV5XBJKwlb5RNelq98lTzptlABgnrS1qyVsW1zb/kFLmu
|
||||
7DzzyEtkG5/YyeSJ5m00v+wc08l95GfSqpxR8ktJY4xr7gR0d56QVmWMsnSxRr57tbtkFMmqgH79Tb4m
|
||||
b5UMTuwtN5FryuXkvHKmqfJnRr7WkPwMP8v/4f9SBmVZx+jXr+SucuS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map, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||
vQAADr0BR/uQrQAAA9dJREFUeF7tnS2QE0EQRuOQSCQSiUSeRCKRSCTy5LmTSOTJk0gkEolEIpHIs9Af
|
||||
VV0V0eSS7fnpSd6regJzlZrvY7IzO5vdAQAAAAAAAAAAAAAAAABAkivzxvxq/jL/mN/Ne/PafGrCGfLE
|
||||
vDUV+CFVitcmnBGvzB9mFPj/vDNVGlgc/W9+MKOQH/OLSQkWJhO+SwkWpUX4LiVYjJbhu5RgEXqE71KC
|
||||
4vQM36UERRkRvksJijEyfJcSFGFG+C4lmIz29WeF71KCiejGjW7kRMGM9JMJk6hSAs1GMIkKJfhp8lUw
|
||||
kQoleGvCRGaX4KMJHdBST/fzn//712FmlkArAmjM/jpf37OVS6DPBw2JNnkql0DnDKERh3b4qpaAa4BG
|
||||
HLO9W7EE70xowEvztxkN8r6VSqDTxM9MaMRqJWAPoAOrlEAPlUAnqpdAf0t/EzpStQSEn0RX+5/NY26i
|
||||
VCsB4SfZX+ode6iiSgkIP0m0zl+lBISf5NAmT/USEH6SY3b4qpaA8JMcE75brQSEn+SU8N0qJSD8JFvC
|
||||
d2eXgPCTZMJ3Z5aA8BO0CN+dVQLYSMvwXUqwCD3CdylBcXqG71KCoowI321dAt2QggQjw3dblYClXpIZ
|
||||
4bvZEhB+kpnhu1tLQPhJKoTvnloCwk9SKXz3lBIQfoKK4bvHlgA2Ujl8lxJ0YoXwXUrQmJXCdylBI1YM
|
||||
3+Vp3SQrh89SL8nK4esGD0/qJlg9fO7uJVg5fO3yEX6C1cPXLh9shPAvGMK/YFYOX59bL4WEjawevj4/
|
||||
bITwL5iVw5eEn0DfmSuHz48xJtD2qL8zf0UJP4nOv0cDu4LvTUigtXI0sCt4Y0ISvdkqGtzqEn4DdDJG
|
||||
O2bRAFeWAx2N0A8ZRwNc2TsTGqHzcdEgV5XwG6Kl30rrfpUVGqLlUzTQFeUkbwf0IqNosKtJ+B3Q9B8N
|
||||
djU5wduJD2Y04JUk/I58M6NBryLhd0SnY6NBryLHtztzbUYDX0HCH4Cm12jwZ0v4A3hhRoM/Wx7cGITu
|
||||
oEUBzJTj2wPRu/ajEGZJ+AOpdvCD8Adza0ZBzFA3oXhwYzBVDn1ydn8CV2YUxmgJfxIVzv3pO59pfwIV
|
||||
zv3pJA8/zTIJTblRKL3VdK/gudKfjEKIAuql7jTqSR3u5hVA0/+Ic39aYWiZqa1mKETPY98+xXNVX5h7
|
||||
Mwovo6Z4HShlii9Oy+lfU7yexmGKX4g3ZhTmKWoG0dcILMjWzR8dGGGKPwNOWf4xxZ8hjx391vWBpniu
|
||||
4s8UXQRGv/zBFH9hKGjdDZRM8QAAAAAAAAAAAAAAAAA12O3+AseEEu6imt+zAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="buttonAdd.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAABGdBTUEAALGPC/xhBQAACEJJREFUeF7t
|
||||
nWWoNVUUhq/d3d1id3djgigoiojgDxFFRPwjqD/8oSCIiolidyCIhd3d3Y3d3fE8l6vcb1j3nD33nn1q
|
||||
zwsP38e5M3Nmr3Vmx9pr7xkZEM0Km8DxcCe8Dz/D3/AX/DT22e1wLGwMntNoipoZdoSr4VPQ2P+0wWM+
|
||||
gSthB/AajSahZeFs+BYiQ6fwDXgNr9WohjaDxyAy6mR4HLaARgnaHt6AyJBT4U2wOmvUQja0r0NkwE6g
|
||||
Y326GgVaCh6CyHCd5GFYGhqN04xwKkQGy8Hp4Hc2GtPW8CVExsqB3+V3NkIzwSUQGSonF0PzFKDV4SOI
|
||||
jDQR38H9cAFcCA/A9xAd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ad/LEBmnSg4HuC6i6E37mm0reyzjKL3euNUgY7Fqti7usZrNu3usZvv6HqvOCxzM
|
||||
3kuJtzt5dC1E16jiRJLtULGq0wtyWazR03ZybJE6ui7+FSbOiKWGo41cutVZOzltmpqf7xRp0S/xsb6u
|
||||
8xY9Q9etBk7mW6Y+UVL8a6zUYRAZZyKcIN8TjKRa34vViL/81DcySfMitzEZjaybe+RcrvMIrk9wbzbr
|
||||
fCfYo2MnonmV4ZjMjnAxRWSknNirypY6MmjyNebOTkWGyoFrIZp3zI+Tq3RM+IqMlQPXQth2NBont3ZM
|
||||
naCfCo4nih58tZI5OqnR0cng3MP60KiF3IsohxM0ftFZcHVkspRJs53YKtlrWO00v/yaMkx8GrhpdmTY
|
||||
FOzt2OA2df4kZe/IauMicOCUsqLfNQxGWM3Pd7lV09fvgBysubjtKLgBjPf4ZDj6FROsDEO4y/sR4B7/
|
||||
Oq/PNTLyL00LnOXokiBjAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
139
ProjectPublishing/ProjectPublishing/Forms/FormContactPerson.Designer.cs
generated
Normal file
139
ProjectPublishing/ProjectPublishing/Forms/FormContactPerson.Designer.cs
generated
Normal file
@ -0,0 +1,139 @@
|
||||
namespace ProjectPublishing.Forms
|
||||
{
|
||||
partial class FormContactPerson
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
buttonCancel = new Button();
|
||||
buttonSave = new Button();
|
||||
textBoxEmail = new TextBox();
|
||||
textBoxPhone = new TextBox();
|
||||
label2 = new Label();
|
||||
label1 = new Label();
|
||||
textBoxName = new TextBox();
|
||||
label3 = new Label();
|
||||
SuspendLayout();
|
||||
//
|
||||
// buttonCancel
|
||||
//
|
||||
buttonCancel.Location = new Point(217, 195);
|
||||
buttonCancel.Name = "buttonCancel";
|
||||
buttonCancel.Size = new Size(94, 29);
|
||||
buttonCancel.TabIndex = 13;
|
||||
buttonCancel.Text = "Отмена";
|
||||
buttonCancel.UseVisualStyleBackColor = true;
|
||||
buttonCancel.Click += buttonCancel_Click;
|
||||
//
|
||||
// buttonSave
|
||||
//
|
||||
buttonSave.Location = new Point(18, 195);
|
||||
buttonSave.Name = "buttonSave";
|
||||
buttonSave.Size = new Size(94, 29);
|
||||
buttonSave.TabIndex = 12;
|
||||
buttonSave.Text = "Сохранить";
|
||||
buttonSave.UseVisualStyleBackColor = true;
|
||||
buttonSave.Click += buttonSave_Click;
|
||||
//
|
||||
// textBoxEmail
|
||||
//
|
||||
textBoxEmail.Location = new Point(150, 118);
|
||||
textBoxEmail.Name = "textBoxEmail";
|
||||
textBoxEmail.Size = new Size(161, 27);
|
||||
textBoxEmail.TabIndex = 11;
|
||||
//
|
||||
// textBoxPhone
|
||||
//
|
||||
textBoxPhone.Location = new Point(150, 68);
|
||||
textBoxPhone.Name = "textBoxPhone";
|
||||
textBoxPhone.Size = new Size(161, 27);
|
||||
textBoxPhone.TabIndex = 10;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Location = new Point(18, 121);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(51, 20);
|
||||
label2.TabIndex = 9;
|
||||
label2.Text = "Почта";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Location = new Point(18, 71);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(69, 20);
|
||||
label1.TabIndex = 8;
|
||||
label1.Text = "Телефон";
|
||||
//
|
||||
// textBoxName
|
||||
//
|
||||
textBoxName.Location = new Point(150, 22);
|
||||
textBoxName.Name = "textBoxName";
|
||||
textBoxName.Size = new Size(161, 27);
|
||||
textBoxName.TabIndex = 14;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.AutoSize = true;
|
||||
label3.Location = new Point(18, 25);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new Size(39, 20);
|
||||
label3.TabIndex = 8;
|
||||
label3.Text = "Имя";
|
||||
//
|
||||
// FormContactPerson
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(341, 249);
|
||||
Controls.Add(textBoxName);
|
||||
Controls.Add(buttonCancel);
|
||||
Controls.Add(buttonSave);
|
||||
Controls.Add(textBoxEmail);
|
||||
Controls.Add(textBoxPhone);
|
||||
Controls.Add(label2);
|
||||
Controls.Add(label3);
|
||||
Controls.Add(label1);
|
||||
Name = "FormContactPerson";
|
||||
Text = "FormContactPerson";
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Button buttonCancel;
|
||||
private Button buttonSave;
|
||||
private TextBox textBoxEmail;
|
||||
private TextBox textBoxPhone;
|
||||
private Label label2;
|
||||
private Label label1;
|
||||
private TextBox textBoxName;
|
||||
private Label label3;
|
||||
}
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
using ProjectPublishing.Entities;
|
||||
using ProjectPublishing.Repositories;
|
||||
using ProjectPublishing.Repositories.Implementations;
|
||||
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 ProjectPublishing.Forms
|
||||
{
|
||||
public partial class FormContactPerson : Form
|
||||
{
|
||||
private readonly IContactPersonRepository _contactPersonRepository;
|
||||
private int? _contactPersonId;
|
||||
|
||||
public int Id
|
||||
{
|
||||
set
|
||||
{
|
||||
try
|
||||
{
|
||||
var contact = _contactPersonRepository.ReadContactPersonById(value);
|
||||
if (contact == null)
|
||||
{
|
||||
throw new InvalidDataException(nameof(contact));
|
||||
}
|
||||
textBoxPhone.Text = contact.PhoneNumber;
|
||||
textBoxEmail.Text = contact.Email;
|
||||
textBoxName.Text = contact.Name;
|
||||
_contactPersonId = value;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
public FormContactPerson(IContactPersonRepository contactPersonRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_contactPersonRepository = contactPersonRepository ?? throw new ArgumentException(nameof(contactPersonRepository));
|
||||
}
|
||||
|
||||
private void buttonSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(textBoxPhone.Text) || string.IsNullOrWhiteSpace(textBoxEmail.Text) || string.IsNullOrWhiteSpace(textBoxName.Text))
|
||||
{
|
||||
throw new Exception("Имеются незаполненные поля!");
|
||||
}
|
||||
|
||||
if (_contactPersonId.HasValue)
|
||||
{
|
||||
_contactPersonRepository.UpdateContactPerson(CreateContactPerson(_contactPersonId.Value));
|
||||
}
|
||||
else
|
||||
{
|
||||
_contactPersonRepository.CreateContactPerson(CreateContactPerson(0));
|
||||
}
|
||||
Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonCancel_Click(object sender, EventArgs e) => Close();
|
||||
|
||||
private ContactPerson CreateContactPerson(int id) => ContactPerson.CreateContactPerson(id, textBoxName.Text, textBoxPhone.Text, textBoxEmail.Text);
|
||||
}
|
||||
}
|
120
ProjectPublishing/ProjectPublishing/Forms/FormContactPerson.resx
Normal file
120
ProjectPublishing/ProjectPublishing/Forms/FormContactPerson.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
142
ProjectPublishing/ProjectPublishing/Forms/FormCustomer.Designer.cs
generated
Normal file
142
ProjectPublishing/ProjectPublishing/Forms/FormCustomer.Designer.cs
generated
Normal file
@ -0,0 +1,142 @@
|
||||
namespace ProjectPublishing.Forms
|
||||
{
|
||||
partial class FormCustomer
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
label1 = new Label();
|
||||
label2 = new Label();
|
||||
label3 = new Label();
|
||||
textBoxCustomerPhone = new TextBox();
|
||||
textBoxCustomerEmail = new TextBox();
|
||||
buttonSave = new Button();
|
||||
buttonCancel = new Button();
|
||||
comboBoxPublisherID = new ComboBox();
|
||||
SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Location = new Point(19, 24);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(69, 20);
|
||||
label1.TabIndex = 0;
|
||||
label1.Text = "Телефон";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Location = new Point(19, 74);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(51, 20);
|
||||
label2.TabIndex = 1;
|
||||
label2.Text = "Почта";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.AutoSize = true;
|
||||
label3.Location = new Point(19, 121);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new Size(90, 20);
|
||||
label3.TabIndex = 2;
|
||||
label3.Text = "ID издателя";
|
||||
//
|
||||
// textBoxCustomerPhone
|
||||
//
|
||||
textBoxCustomerPhone.Location = new Point(151, 21);
|
||||
textBoxCustomerPhone.Name = "textBoxCustomerPhone";
|
||||
textBoxCustomerPhone.Size = new Size(161, 27);
|
||||
textBoxCustomerPhone.TabIndex = 3;
|
||||
//
|
||||
// textBoxCustomerEmail
|
||||
//
|
||||
textBoxCustomerEmail.Location = new Point(151, 71);
|
||||
textBoxCustomerEmail.Name = "textBoxCustomerEmail";
|
||||
textBoxCustomerEmail.Size = new Size(161, 27);
|
||||
textBoxCustomerEmail.TabIndex = 4;
|
||||
//
|
||||
// buttonSave
|
||||
//
|
||||
buttonSave.Location = new Point(19, 170);
|
||||
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(218, 170);
|
||||
buttonCancel.Name = "buttonCancel";
|
||||
buttonCancel.Size = new Size(94, 29);
|
||||
buttonCancel.TabIndex = 7;
|
||||
buttonCancel.Text = "Отмена";
|
||||
buttonCancel.UseVisualStyleBackColor = true;
|
||||
buttonCancel.Click += buttonCancel_Click;
|
||||
//
|
||||
// comboBoxPublisherID
|
||||
//
|
||||
comboBoxPublisherID.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
comboBoxPublisherID.FormattingEnabled = true;
|
||||
comboBoxPublisherID.Location = new Point(151, 113);
|
||||
comboBoxPublisherID.Name = "comboBoxPublisherID";
|
||||
comboBoxPublisherID.Size = new Size(151, 28);
|
||||
comboBoxPublisherID.TabIndex = 15;
|
||||
//
|
||||
// FormCustomer
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(328, 224);
|
||||
Controls.Add(comboBoxPublisherID);
|
||||
Controls.Add(buttonCancel);
|
||||
Controls.Add(buttonSave);
|
||||
Controls.Add(textBoxCustomerEmail);
|
||||
Controls.Add(textBoxCustomerPhone);
|
||||
Controls.Add(label3);
|
||||
Controls.Add(label2);
|
||||
Controls.Add(label1);
|
||||
Name = "FormCustomer";
|
||||
StartPosition = FormStartPosition.CenterParent;
|
||||
Text = "Заказчик";
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Label label1;
|
||||
private Label label2;
|
||||
private Label label3;
|
||||
private TextBox textBoxCustomerPhone;
|
||||
private TextBox textBoxCustomerEmail;
|
||||
private Button buttonSave;
|
||||
private Button buttonCancel;
|
||||
private ComboBox comboBoxPublisherID;
|
||||
}
|
||||
}
|
83
ProjectPublishing/ProjectPublishing/Forms/FormCustomer.cs
Normal file
83
ProjectPublishing/ProjectPublishing/Forms/FormCustomer.cs
Normal file
@ -0,0 +1,83 @@
|
||||
using ProjectPublishing.Entities;
|
||||
using ProjectPublishing.Repositories;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ProjectPublishing.Forms
|
||||
{
|
||||
public partial class FormCustomer : Form
|
||||
{
|
||||
private readonly ICustomerRepository _customerRepository;
|
||||
private int? _customerId;
|
||||
|
||||
public int Id
|
||||
{
|
||||
set
|
||||
{
|
||||
try
|
||||
{
|
||||
var customer = _customerRepository.ReadCustomerById(value);
|
||||
if (customer == null)
|
||||
{
|
||||
throw new InvalidDataException(nameof(customer));
|
||||
}
|
||||
textBoxCustomerPhone.Text = customer.PhoneNumber;
|
||||
textBoxCustomerEmail.Text = customer.Email;
|
||||
comboBoxPublisherID.SelectedValue = customer.PublisherId;
|
||||
_customerId = value;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public FormCustomer(ICustomerRepository customerRepository, IContactPersonRepository contactPersonRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_customerRepository = customerRepository ?? throw new ArgumentException(nameof(customerRepository));
|
||||
|
||||
comboBoxPublisherID.DataSource = contactPersonRepository.ReadContactPeople();
|
||||
comboBoxPublisherID.DisplayMember = "Name";
|
||||
comboBoxPublisherID.ValueMember = "Id";
|
||||
}
|
||||
|
||||
private void buttonSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(textBoxCustomerPhone.Text) || string.IsNullOrWhiteSpace(textBoxCustomerEmail.Text))
|
||||
{
|
||||
throw new Exception("Имеются незаполненные поля!");
|
||||
}
|
||||
|
||||
if (_customerId.HasValue)
|
||||
{
|
||||
_customerRepository.UpdateCustomer(CreateCustomer(_customerId.Value));
|
||||
}
|
||||
else
|
||||
{
|
||||
_customerRepository.CreateCustomer(CreateCustomer(0));
|
||||
}
|
||||
Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonCancel_Click(object sender, EventArgs e) => Close();
|
||||
|
||||
private Customer CreateCustomer(int id) => Customer.CreateCustomer(id, textBoxCustomerPhone.Text, textBoxCustomerEmail.Text, (int)comboBoxPublisherID.SelectedValue!);
|
||||
}
|
||||
}
|
120
ProjectPublishing/ProjectPublishing/Forms/FormCustomer.resx
Normal file
120
ProjectPublishing/ProjectPublishing/Forms/FormCustomer.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
126
ProjectPublishing/ProjectPublishing/Forms/FormCustomers.Designer.cs
generated
Normal file
126
ProjectPublishing/ProjectPublishing/Forms/FormCustomers.Designer.cs
generated
Normal file
@ -0,0 +1,126 @@
|
||||
namespace ProjectPublishing.Forms
|
||||
{
|
||||
partial class FormCustomers
|
||||
{
|
||||
/// <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(FormCustomers));
|
||||
panelButtons = new Panel();
|
||||
buttonRemove = new Button();
|
||||
buttonEdit = new Button();
|
||||
buttonAdd = new Button();
|
||||
dataGridView = new DataGridView();
|
||||
panelButtons.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// panelButtons
|
||||
//
|
||||
panelButtons.Controls.Add(buttonRemove);
|
||||
panelButtons.Controls.Add(buttonEdit);
|
||||
panelButtons.Controls.Add(buttonAdd);
|
||||
panelButtons.Dock = DockStyle.Right;
|
||||
panelButtons.Location = new Point(648, 0);
|
||||
panelButtons.Name = "panelButtons";
|
||||
panelButtons.Size = new Size(152, 450);
|
||||
panelButtons.TabIndex = 0;
|
||||
//
|
||||
// buttonRemove
|
||||
//
|
||||
buttonRemove.Image = (Image)resources.GetObject("buttonRemove.Image");
|
||||
buttonRemove.Location = new Point(23, 254);
|
||||
buttonRemove.Name = "buttonRemove";
|
||||
buttonRemove.Size = new Size(115, 115);
|
||||
buttonRemove.TabIndex = 2;
|
||||
buttonRemove.UseVisualStyleBackColor = true;
|
||||
buttonRemove.Click += buttonRemove_Click;
|
||||
//
|
||||
// buttonEdit
|
||||
//
|
||||
buttonEdit.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
buttonEdit.Image = (Image)resources.GetObject("buttonEdit.Image");
|
||||
buttonEdit.Location = new Point(23, 133);
|
||||
buttonEdit.Name = "buttonEdit";
|
||||
buttonEdit.Size = new Size(115, 115);
|
||||
buttonEdit.TabIndex = 1;
|
||||
buttonEdit.UseVisualStyleBackColor = true;
|
||||
buttonEdit.Click += buttonEdit_Click;
|
||||
//
|
||||
// buttonAdd
|
||||
//
|
||||
buttonAdd.BackgroundImageLayout = ImageLayout.Center;
|
||||
buttonAdd.Image = (Image)resources.GetObject("buttonAdd.Image");
|
||||
buttonAdd.Location = new Point(23, 12);
|
||||
buttonAdd.Name = "buttonAdd";
|
||||
buttonAdd.Size = new Size(115, 115);
|
||||
buttonAdd.TabIndex = 0;
|
||||
buttonAdd.UseVisualStyleBackColor = true;
|
||||
buttonAdd.Click += buttonAdd_Click;
|
||||
//
|
||||
// dataGridView
|
||||
//
|
||||
dataGridView.AllowUserToAddRows = false;
|
||||
dataGridView.AllowUserToDeleteRows = false;
|
||||
dataGridView.AllowUserToResizeColumns = false;
|
||||
dataGridView.AllowUserToResizeRows = false;
|
||||
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dataGridView.Dock = DockStyle.Fill;
|
||||
dataGridView.Location = new Point(0, 0);
|
||||
dataGridView.MultiSelect = false;
|
||||
dataGridView.Name = "dataGridView";
|
||||
dataGridView.ReadOnly = true;
|
||||
dataGridView.RowHeadersVisible = false;
|
||||
dataGridView.RowHeadersWidth = 51;
|
||||
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dataGridView.Size = new Size(648, 450);
|
||||
dataGridView.TabIndex = 1;
|
||||
//
|
||||
// FormCustomers
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 450);
|
||||
Controls.Add(dataGridView);
|
||||
Controls.Add(panelButtons);
|
||||
Name = "FormCustomers";
|
||||
StartPosition = FormStartPosition.CenterParent;
|
||||
Text = "Клиенты";
|
||||
Load += FormCustomers_Load;
|
||||
panelButtons.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Panel panelButtons;
|
||||
private Button buttonAdd;
|
||||
private Button buttonRemove;
|
||||
private Button buttonEdit;
|
||||
private DataGridView dataGridView;
|
||||
}
|
||||
}
|
106
ProjectPublishing/ProjectPublishing/Forms/FormCustomers.cs
Normal file
106
ProjectPublishing/ProjectPublishing/Forms/FormCustomers.cs
Normal file
@ -0,0 +1,106 @@
|
||||
using ProjectPublishing.Repositories;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Unity;
|
||||
|
||||
namespace ProjectPublishing.Forms
|
||||
{
|
||||
public partial class FormCustomers : Form
|
||||
{
|
||||
private readonly IUnityContainer _container;
|
||||
private readonly ICustomerRepository _customerRepository;
|
||||
public FormCustomers(IUnityContainer container, ICustomerRepository customerRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_container = container ?? throw new ArgumentException(nameof(container));
|
||||
_customerRepository = customerRepository ?? throw new ArgumentException(nameof(customerRepository));
|
||||
}
|
||||
|
||||
private void buttonAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormCustomer>().ShowDialog();
|
||||
loadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!tryGetIDFromRow(out var findId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
var form = _container.Resolve<FormCustomer>();
|
||||
form.Id = findId;
|
||||
form.ShowDialog();
|
||||
loadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonRemove_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!tryGetIDFromRow(out var findId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
_customerRepository.DeleteCustomer(findId);
|
||||
loadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void FormCustomers_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
loadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void loadList() => dataGridView.DataSource = _customerRepository.ReadCustomers();
|
||||
|
||||
private bool tryGetIDFromRow(out int id)
|
||||
{
|
||||
id = 0;
|
||||
if (dataGridView.SelectedRows.Count < 1)
|
||||
{
|
||||
MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return false;
|
||||
}
|
||||
id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
233
ProjectPublishing/ProjectPublishing/Forms/FormCustomers.resx
Normal file
233
ProjectPublishing/ProjectPublishing/Forms/FormCustomers.resx
Normal file
@ -0,0 +1,233 @@
|
||||
<?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="buttonRemove.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
|
||||
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAB3RJTUUH6AcSDjMPELkl4AAACdZJREFU
|
||||
eF7tnUWsJUUUhh8Ed3d3h+CaQHBfsSH4gg0e3II7JDhhga5wHSDBQ3DXDcEXOAR3+79kXhiKc9871bf6
|
||||
3u7b50u+ZDLzprq7+nV3yalTY0EQBEEQBEHQi+nlsnJ7eZi8Uj4gn5Gvy3fl1/LXqfJn/o5/e1reL6+Q
|
||||
h0rKWEZSZjAkZpXbyLMkN+hn+XdhKfMpeabcWnLMoEaWlsfLx+Uv0ropdcoxH5PHyaVkUACemj3kvfIP
|
||||
aVX8MPxTPikPlHPKIJPV5PXyJ2lVcJP8UV4nV5XBJKwlb5RNelq98lTzptlABgnrS1qyVsW1zb/kFLmu
|
||||
7DzzyEtkG5/YyeSJ5m00v+wc08l95GfSqpxR8ktJY4xr7gR0d56QVmWMsnSxRr57tbtkFMmqgH79Tb4m
|
||||
b5UMTuwtN5FryuXkvHKmqfJnRr7WkPwMP8v/4f9SBmVZx+jXr+SucuSYQZ4raYBYF15Fvts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Xubul7yoHBt8Ob
|
||||
iXZcGl2Lya5DfuecRhU+IgcOHXPvKsRxCbPtcsuaFrM3DHZc3n5D22+ZqL/cDaLfkl3dIPpVadVJL6nb
|
||||
3eRQuUhaJzeRLE/t0nazBEPkvpaxERGrM0pvZtpp5dXDFqujDqmm2G7IqoOJJIMsddsIFpJvS+tEJ/J3
|
||||
yUZaozgYwjWxxsubDmNa2diTqMpGsbzM3dV6XIbfSqeDGCb0V3MmZ6b1c7mSbCTsL1w1kQrdqFHYsZRJ
|
||||
lirfW6TuatlZtCSkta3yWhqX5ZJs1Ng2yFeSM+WXSpacrBWCw4Sb3E/6BSa+iQxpwz6IhNkQieHd39GS
|
||||
J7c1N3ccXjW5w3GpRGrSVWji95lNO2kg5g72pNLCbm1vgsYC6X2sC8uRG81KuzqSn+ZCUDpxyyWSttFa
|
||||
XkG2GkZwqvSTe8lWM3Q/2FdoUNBlYa2QdzmJR/q5jesKVWUGSbyvN3DPI2Ux7Hm13EOW3PmUjUb4JvJ5
|
||||
eFGWPG+GHy+RjRnEKMmussqojkcGTRjIJ+CPzDSkH2IUiURiy0m+4+TWRP7M3/Fv/Aw/y/+hBU8ZlGUd
|
||||
o18ZvWP8fqRhFsq7anGUZMqvU5MsvFarjny1yU8kARKdjE1jSI/vUU4gX1vku037YGBhNk2GaM17Ze7c
|
||||
chPlGhhbJ448SFhT3ijb+ETzxPJL2vix5CZAgN610rtWZ5hyjiwE61IAQzHY2ZrGGE9GXV2XKvK0kpvq
|
||||
QBnLZQtBF+NoSXfDm/2npGT+I+EJOTH6TpsQTAxpg9jWnL0TGfLzpl3MkdkhnlJ21yYPFZtjBEOCPibz
|
||||
seTNZBdOltfcL7lBRDIyqM+sD/PUyJ/5O/6Nn+Fn2dyRlLxMdVJWJ/utQRAEQRAEwaSMjf0DMjsRo5UV
|
||||
a8gAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="buttonEdit.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||
wQAADsEBuJFr7QAAA9dJREFUeF7tnS2QE0EQRuOQSCQSiUSeRCKRSCTy5LmTSOTJk0gkEolEIpHIs9Af
|
||||
VV0V0eSS7fnpSd6regJzlZrvY7IzO5vdAQAAAAAAAAAAAAAAAABAkivzxvxq/jL/mN/Ne/PafGrCGfLE
|
||||
vDUV+CFVitcmnBGvzB9mFPj/vDNVGlgc/W9+MKOQH/OLSQkWJhO+SwkWpUX4LiVYjJbhu5RgEXqE71KC
|
||||
4vQM36UERRkRvksJijEyfJcSFGFG+C4lmIz29WeF71KCiejGjW7kRMGM9JMJk6hSAs1GMIkKJfhp8lUw
|
||||
kQoleGvCRGaX4KMJHdBST/fzn//712FmlkArAmjM/jpf37OVS6DPBw2JNnkql0DnDKERh3b4qpaAa4BG
|
||||
HLO9W7EE70xowEvztxkN8r6VSqDTxM9MaMRqJWAPoAOrlEAPlUAnqpdAf0t/EzpStQSEn0RX+5/NY26i
|
||||
VCsB4SfZX+ode6iiSgkIP0m0zl+lBISf5NAmT/USEH6SY3b4qpaA8JMcE75brQSEn+SU8N0qJSD8JFvC
|
||||
d2eXgPCTZMJ3Z5aA8BO0CN+dVQLYSMvwXUqwCD3CdylBcXqG71KCoowI321dAt2QggQjw3dblYClXpIZ
|
||||
4bvZEhB+kpnhu1tLQPhJKoTvnloCwk9SKXz3lBIQfoKK4bvHlgA2Ujl8lxJ0YoXwXUrQmJXCdylBI1YM
|
||||
3+Vp3SQrh89SL8nK4esGD0/qJlg9fO7uJVg5fO3yEX6C1cPXLh9shPAvGMK/YFYOX59bL4WEjawevj4/
|
||||
bITwL5iVw5eEn0DfmSuHz48xJtD2qL8zf0UJP4nOv0cDu4LvTUigtXI0sCt4Y0ISvdkqGtzqEn4DdDJG
|
||||
O2bRAFeWAx2N0A8ZRwNc2TsTGqHzcdEgV5XwG6Kl30rrfpUVGqLlUzTQFeUkbwf0IqNosKtJ+B3Q9B8N
|
||||
djU5wduJD2Y04JUk/I58M6NBryLhd0SnY6NBryLHtztzbUYDX0HCH4Cm12jwZ0v4A3hhRoM/Wx7cGITu
|
||||
oEUBzJTj2wPRu/ajEGZJ+AOpdvCD8Adza0ZBzFA3oXhwYzBVDn1ydn8CV2YUxmgJfxIVzv3pO59pfwIV
|
||||
zv3pJA8/zTIJTblRKL3VdK/gudKfjEKIAuql7jTqSR3u5hVA0/+Ic39aYWiZqa1mKETPY98+xXNVX5h7
|
||||
Mwovo6Z4HShlii9Oy+lfU7yexmGKX4g3ZhTmKWoG0dcILMjWzR8dGGGKPwNOWf4xxZ8hjx391vWBpniu
|
||||
4s8UXQRGv/zBFH9hKGjdDZRM8QAAAAAAAAAAAAAAAAA12O3+AseEEu6imt+zAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="buttonAdd.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAABGdBTUEAALGPC/xhBQAACEJJREFUeF7t
|
||||
nWWoNVUUhq/d3d1id3djgigoiojgDxFFRPwjqD/8oSCIiolidyCIhd3d3Y3d3fE8l6vcb1j3nD33nn1q
|
||||
zwsP38e5M3Nmr3Vmx9pr7xkZEM0Km8DxcCe8Dz/D3/AX/DT22e1wLGwMntNoipoZdoSr4VPQ2P+0wWM+
|
||||
gSthB/AajSahZeFs+BYiQ6fwDXgNr9WohjaDxyAy6mR4HLaARgnaHt6AyJBT4U2wOmvUQja0r0NkwE6g
|
||||
Y326GgVaCh6CyHCd5GFYGhqN04xwKkQGy8Hp4Hc2GtPW8CVExsqB3+V3NkIzwSUQGSonF0PzFKDV4SOI
|
||||
jDQR38H9cAFcCA/A9xAdOxEfwqpQvA4BQwq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6E37mm0reyzjKL3euNUgY7Fqti7usZrNu3usZvv6HqvOCxzM
|
||||
3kuJtzt5dC1E16jiRJLtULGq0wtyWazR03ZybJE6ui7+FSbOiKWGo41cutVZOzltmpqf7xRp0S/xsb6u
|
||||
8xY9Q9etBk7mW6Y+UVL8a6zUYRAZZyKcIN8TjKRa34vViL/81DcySfMitzEZjaybe+RcrvMIrk9wbzbr
|
||||
fCfYo2MnonmV4ZjMjnAxRWSknNirypY6MmjyNebOTkWGyoFrIZp3zI+Tq3RM+IqMlQPXQth2NBont3ZM
|
||||
naCfCo4nih58tZI5OqnR0cng3MP60KiF3IsohxM0ftFZcHVkspRJs53YKtlrWO00v/yaMkx8GrhpdmTY
|
||||
FOzt2OA2df4kZe/IauMicOCUsqLfNQxGWM3Pd7lV09fvgBysubjtKLgBjPf4ZDj6FROsDEO4y/sR4B7/
|
||||
Oq/PNTLyL00LnOXokiBjAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
97
ProjectPublishing/ProjectPublishing/Forms/FormMaterial.Designer.cs
generated
Normal file
97
ProjectPublishing/ProjectPublishing/Forms/FormMaterial.Designer.cs
generated
Normal file
@ -0,0 +1,97 @@
|
||||
namespace ProjectPublishing.Forms
|
||||
{
|
||||
partial class FormMaterial
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
buttonCancel = new Button();
|
||||
buttonSave = new Button();
|
||||
label2 = new Label();
|
||||
comboBoxMaterialType = new ComboBox();
|
||||
SuspendLayout();
|
||||
//
|
||||
// buttonCancel
|
||||
//
|
||||
buttonCancel.Location = new Point(195, 74);
|
||||
buttonCancel.Name = "buttonCancel";
|
||||
buttonCancel.Size = new Size(94, 29);
|
||||
buttonCancel.TabIndex = 13;
|
||||
buttonCancel.Text = "Отмена";
|
||||
buttonCancel.UseVisualStyleBackColor = true;
|
||||
buttonCancel.Click += buttonCancel_Click;
|
||||
//
|
||||
// buttonSave
|
||||
//
|
||||
buttonSave.Location = new Point(12, 74);
|
||||
buttonSave.Name = "buttonSave";
|
||||
buttonSave.Size = new Size(94, 29);
|
||||
buttonSave.TabIndex = 12;
|
||||
buttonSave.Text = "Сохранить";
|
||||
buttonSave.UseVisualStyleBackColor = true;
|
||||
buttonSave.Click += buttonSave_Click;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Location = new Point(12, 15);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(114, 20);
|
||||
label2.TabIndex = 9;
|
||||
label2.Text = "Тип материала";
|
||||
//
|
||||
// comboBoxMaterialType
|
||||
//
|
||||
comboBoxMaterialType.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
comboBoxMaterialType.FormattingEnabled = true;
|
||||
comboBoxMaterialType.Location = new Point(138, 12);
|
||||
comboBoxMaterialType.Name = "comboBoxMaterialType";
|
||||
comboBoxMaterialType.Size = new Size(151, 28);
|
||||
comboBoxMaterialType.TabIndex = 14;
|
||||
//
|
||||
// FormMaterial
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(301, 124);
|
||||
Controls.Add(comboBoxMaterialType);
|
||||
Controls.Add(buttonCancel);
|
||||
Controls.Add(buttonSave);
|
||||
Controls.Add(label2);
|
||||
Name = "FormMaterial";
|
||||
Text = "FormMaterial";
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Button buttonCancel;
|
||||
private Button buttonSave;
|
||||
private Label label2;
|
||||
private ComboBox comboBoxMaterialType;
|
||||
}
|
||||
}
|
76
ProjectPublishing/ProjectPublishing/Forms/FormMaterial.cs
Normal file
76
ProjectPublishing/ProjectPublishing/Forms/FormMaterial.cs
Normal file
@ -0,0 +1,76 @@
|
||||
using ProjectPublishing.Entities;
|
||||
using ProjectPublishing.Entities.Enums;
|
||||
using ProjectPublishing.Repositories;
|
||||
using ProjectPublishing.Repositories.Implementations;
|
||||
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 ProjectPublishing.Forms
|
||||
{
|
||||
public partial class FormMaterial : Form
|
||||
{
|
||||
private readonly IMaterialRepository _materialRepository;
|
||||
private int? _materialId;
|
||||
|
||||
public int Id
|
||||
{
|
||||
set
|
||||
{
|
||||
try
|
||||
{
|
||||
var material = _materialRepository.ReadMaterialById(value);
|
||||
if (material == null)
|
||||
{
|
||||
throw new InvalidDataException(nameof(material));
|
||||
}
|
||||
comboBoxMaterialType.SelectedItem = material.MaterialType;
|
||||
_materialId = value;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public FormMaterial(IMaterialRepository materialRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_materialRepository = materialRepository ?? throw new ArgumentException(nameof(materialRepository));
|
||||
comboBoxMaterialType.DataSource = Enum.GetValues(typeof(MaterialType));
|
||||
}
|
||||
|
||||
private void buttonSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
if (_materialId.HasValue)
|
||||
{
|
||||
_materialRepository.UpdateMaterial(CreateMaterial(_materialId.Value));
|
||||
}
|
||||
else
|
||||
{
|
||||
_materialRepository.UpdateMaterial(CreateMaterial(0));
|
||||
}
|
||||
Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonCancel_Click(object sender, EventArgs e) => Close();
|
||||
|
||||
private Material CreateMaterial(int id) => Material.CreateMaterial(id, (MaterialType)comboBoxMaterialType.SelectedItem!);
|
||||
}
|
||||
}
|
120
ProjectPublishing/ProjectPublishing/Forms/FormMaterial.resx
Normal file
120
ProjectPublishing/ProjectPublishing/Forms/FormMaterial.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
124
ProjectPublishing/ProjectPublishing/Forms/FormMaterialAdmission.Designer.cs
generated
Normal file
124
ProjectPublishing/ProjectPublishing/Forms/FormMaterialAdmission.Designer.cs
generated
Normal file
@ -0,0 +1,124 @@
|
||||
namespace ProjectPublishing.Forms
|
||||
{
|
||||
partial class FormMaterialAdmission
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
comboBoxMaterialId = new ComboBox();
|
||||
label4 = new Label();
|
||||
numericUpDownAmount = new NumericUpDown();
|
||||
label3 = new Label();
|
||||
buttonCancel = new Button();
|
||||
buttonSave = new Button();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDownAmount).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// comboBoxMaterialId
|
||||
//
|
||||
comboBoxMaterialId.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
comboBoxMaterialId.FormattingEnabled = true;
|
||||
comboBoxMaterialId.Location = new Point(140, 54);
|
||||
comboBoxMaterialId.Name = "comboBoxMaterialId";
|
||||
comboBoxMaterialId.Size = new Size(161, 28);
|
||||
comboBoxMaterialId.TabIndex = 26;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
label4.AutoSize = true;
|
||||
label4.Location = new Point(8, 57);
|
||||
label4.Name = "label4";
|
||||
label4.Size = new Size(103, 20);
|
||||
label4.TabIndex = 25;
|
||||
label4.Text = "ID материала";
|
||||
//
|
||||
// numericUpDownAmount
|
||||
//
|
||||
numericUpDownAmount.Location = new Point(140, 12);
|
||||
numericUpDownAmount.Maximum = new decimal(new int[] { 10000, 0, 0, 0 });
|
||||
numericUpDownAmount.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
|
||||
numericUpDownAmount.Name = "numericUpDownAmount";
|
||||
numericUpDownAmount.Size = new Size(161, 27);
|
||||
numericUpDownAmount.TabIndex = 24;
|
||||
numericUpDownAmount.Value = new decimal(new int[] { 1, 0, 0, 0 });
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.AutoSize = true;
|
||||
label3.Location = new Point(8, 14);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new Size(58, 20);
|
||||
label3.TabIndex = 23;
|
||||
label3.Text = "Кол-во";
|
||||
//
|
||||
// buttonCancel
|
||||
//
|
||||
buttonCancel.Location = new Point(207, 217);
|
||||
buttonCancel.Name = "buttonCancel";
|
||||
buttonCancel.Size = new Size(94, 29);
|
||||
buttonCancel.TabIndex = 22;
|
||||
buttonCancel.Text = "Отмена";
|
||||
buttonCancel.UseVisualStyleBackColor = true;
|
||||
buttonCancel.Click += buttonCancel_Click;
|
||||
//
|
||||
// buttonSave
|
||||
//
|
||||
buttonSave.Location = new Point(8, 217);
|
||||
buttonSave.Name = "buttonSave";
|
||||
buttonSave.Size = new Size(94, 29);
|
||||
buttonSave.TabIndex = 21;
|
||||
buttonSave.Text = "Сохранить";
|
||||
buttonSave.UseVisualStyleBackColor = true;
|
||||
buttonSave.Click += buttonSave_Click;
|
||||
//
|
||||
// FormMaterialAdmission
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(313, 262);
|
||||
Controls.Add(comboBoxMaterialId);
|
||||
Controls.Add(label4);
|
||||
Controls.Add(numericUpDownAmount);
|
||||
Controls.Add(label3);
|
||||
Controls.Add(buttonCancel);
|
||||
Controls.Add(buttonSave);
|
||||
Name = "FormMaterialAdmission";
|
||||
Text = "Прием материалов";
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDownAmount).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ComboBox comboBoxMaterialId;
|
||||
private Label label4;
|
||||
private NumericUpDown numericUpDownAmount;
|
||||
private Label label3;
|
||||
private Button buttonCancel;
|
||||
private Button buttonSave;
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
using ProjectPublishing.Entities;
|
||||
using ProjectPublishing.Repositories;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ProjectPublishing.Forms
|
||||
{
|
||||
public partial class FormMaterialAdmission : Form
|
||||
{
|
||||
private readonly IMaterialAdmissionRepository _materialAdmissionRepository;
|
||||
|
||||
|
||||
public FormMaterialAdmission(IMaterialAdmissionRepository materialAdmissionRepository, IMaterialRepository materialRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_materialAdmissionRepository = materialAdmissionRepository ?? throw new ArgumentException(nameof(materialAdmissionRepository));
|
||||
|
||||
comboBoxMaterialId.DataSource = materialRepository.ReadMaterials();
|
||||
comboBoxMaterialId.DisplayMember = "MaterialType";
|
||||
comboBoxMaterialId.ValueMember = "Id";
|
||||
}
|
||||
|
||||
private void buttonSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_materialAdmissionRepository.CreateMaterialsAdmission(MaterialsAdmission.CreateOperation(0, (int)numericUpDownAmount.Value, (int)comboBoxMaterialId.SelectedValue!));
|
||||
|
||||
Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonCancel_Click(object sender, EventArgs e) => Close();
|
||||
|
||||
}
|
||||
}
|
@ -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>
|
98
ProjectPublishing/ProjectPublishing/Forms/FormMaterialAdmissions.Designer.cs
generated
Normal file
98
ProjectPublishing/ProjectPublishing/Forms/FormMaterialAdmissions.Designer.cs
generated
Normal file
@ -0,0 +1,98 @@
|
||||
namespace ProjectPublishing.Forms
|
||||
{
|
||||
partial class FormMaterialAdmissions
|
||||
{
|
||||
/// <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(FormMaterialAdmissions));
|
||||
dataGridView = new DataGridView();
|
||||
panelButtons = new Panel();
|
||||
buttonAdd = new Button();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
panelButtons.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// dataGridView
|
||||
//
|
||||
dataGridView.AllowUserToAddRows = false;
|
||||
dataGridView.AllowUserToDeleteRows = false;
|
||||
dataGridView.AllowUserToResizeColumns = false;
|
||||
dataGridView.AllowUserToResizeRows = false;
|
||||
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dataGridView.Dock = DockStyle.Fill;
|
||||
dataGridView.Location = new Point(0, 0);
|
||||
dataGridView.MultiSelect = false;
|
||||
dataGridView.Name = "dataGridView";
|
||||
dataGridView.ReadOnly = true;
|
||||
dataGridView.RowHeadersVisible = false;
|
||||
dataGridView.RowHeadersWidth = 51;
|
||||
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dataGridView.Size = new Size(648, 450);
|
||||
dataGridView.TabIndex = 5;
|
||||
//
|
||||
// panelButtons
|
||||
//
|
||||
panelButtons.Controls.Add(buttonAdd);
|
||||
panelButtons.Dock = DockStyle.Right;
|
||||
panelButtons.Location = new Point(648, 0);
|
||||
panelButtons.Name = "panelButtons";
|
||||
panelButtons.Size = new Size(152, 450);
|
||||
panelButtons.TabIndex = 4;
|
||||
//
|
||||
// buttonAdd
|
||||
//
|
||||
buttonAdd.BackgroundImageLayout = ImageLayout.Center;
|
||||
buttonAdd.Image = (Image)resources.GetObject("buttonAdd.Image");
|
||||
buttonAdd.Location = new Point(23, 12);
|
||||
buttonAdd.Name = "buttonAdd";
|
||||
buttonAdd.Size = new Size(115, 115);
|
||||
buttonAdd.TabIndex = 0;
|
||||
buttonAdd.UseVisualStyleBackColor = true;
|
||||
buttonAdd.Click += buttonAdd_Click;
|
||||
//
|
||||
// FormMaterialAdmissions
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 450);
|
||||
Controls.Add(dataGridView);
|
||||
Controls.Add(panelButtons);
|
||||
Name = "FormMaterialAdmissions";
|
||||
Text = "FormMaterialAdmissions";
|
||||
Load += FormMaterial_admissions_Load;
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
panelButtons.ResumeLayout(false);
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DataGridView dataGridView;
|
||||
private Panel panelButtons;
|
||||
private Button buttonAdd;
|
||||
}
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
using ProjectPublishing.Repositories;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Unity;
|
||||
|
||||
namespace ProjectPublishing.Forms
|
||||
{
|
||||
public partial class FormMaterialAdmissions : Form
|
||||
{
|
||||
private readonly IUnityContainer _container;
|
||||
private readonly IMaterialAdmissionRepository _materialAdmissionRepository;
|
||||
public FormMaterialAdmissions(IUnityContainer container, IMaterialAdmissionRepository materialAdmissionRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_container = container ?? throw new ArgumentException(nameof(container));
|
||||
_materialAdmissionRepository = materialAdmissionRepository ?? throw new ArgumentException(nameof(materialAdmissionRepository));
|
||||
}
|
||||
|
||||
private void buttonAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormMaterialAdmission>().ShowDialog();
|
||||
loadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void FormMaterial_admissions_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
loadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void loadList() => dataGridView.DataSource = _materialAdmissionRepository.ReadMaterialsAdmission();
|
||||
|
||||
private bool tryGetIDFromRow(out int id)
|
||||
{
|
||||
id = 0;
|
||||
if (dataGridView.SelectedRows.Count < 1)
|
||||
{
|
||||
MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return false;
|
||||
}
|
||||
id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,162 @@
|
||||
<?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="buttonAdd.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAABGdBTUEAALGPC/xhBQAACEJJREFUeF7t
|
||||
nWWoNVUUhq/d3d1id3djgigoiojgDxFFRPwjqD/8oSCIiolidyCIhd3d3Y3d3fE8l6vcb1j3nD33nn1q
|
||||
zwsP38e5M3Nmr3Vmx9pr7xkZEM0Km8DxcCe8Dz/D3/AX/DT22e1wLGwMntNoipoZdoSr4VPQ2P+0wWM+
|
||||
gSthB/AajSahZeFs+BYiQ6fwDXgNr9WohjaDxyAy6mR4HLaARgnaHt6AyJBT4U2wOmvUQja0r0NkwE6g
|
||||
Y326GgVaCh6CyHCd5GFYGhqN04xwKkQGy8Hp4Hc2GtPW8CVExsqB3+V3NkIzwSUQGSonF0PzFKDV4SOI
|
||||
jDQR38H9cAFcCA/A9xAdOxEfwqpQvA4BQwqRkSLs0+8Gc8F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euNUgY7Fqti7usZrNu3usZvv6HqvOCxzM
|
||||
3kuJtzt5dC1E16jiRJLtULGq0wtyWazR03ZybJE6ui7+FSbOiKWGo41cutVZOzltmpqf7xRp0S/xsb6u
|
||||
8xY9Q9etBk7mW6Y+UVL8a6zUYRAZZyKcIN8TjKRa34vViL/81DcySfMitzEZjaybe+RcrvMIrk9wbzbr
|
||||
fCfYo2MnonmV4ZjMjnAxRWSknNirypY6MmjyNebOTkWGyoFrIZp3zI+Tq3RM+IqMlQPXQth2NBont3ZM
|
||||
naCfCo4nih58tZI5OqnR0cng3MP60KiF3IsohxM0ftFZcHVkspRJs53YKtlrWO00v/yaMkx8GrhpdmTY
|
||||
FOzt2OA2df4kZe/IauMicOCUsqLfNQxGWM3Pd7lV09fvgBysubjtKLgBjPf4ZDj6FROsDEO4y/sR4B7/
|
||||
Oq/PNTLyL00LnOXokiBjAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
125
ProjectPublishing/ProjectPublishing/Forms/FormMaterials.Designer.cs
generated
Normal file
125
ProjectPublishing/ProjectPublishing/Forms/FormMaterials.Designer.cs
generated
Normal file
@ -0,0 +1,125 @@
|
||||
namespace ProjectPublishing.Forms
|
||||
{
|
||||
partial class FormMaterials
|
||||
{
|
||||
/// <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(FormMaterials));
|
||||
dataGridView = new DataGridView();
|
||||
panelButtons = new Panel();
|
||||
buttonRemove = new Button();
|
||||
buttonEdit = new Button();
|
||||
buttonAdd = new Button();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
panelButtons.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// dataGridView
|
||||
//
|
||||
dataGridView.AllowUserToAddRows = false;
|
||||
dataGridView.AllowUserToDeleteRows = false;
|
||||
dataGridView.AllowUserToResizeColumns = false;
|
||||
dataGridView.AllowUserToResizeRows = false;
|
||||
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dataGridView.Dock = DockStyle.Fill;
|
||||
dataGridView.Location = new Point(0, 0);
|
||||
dataGridView.MultiSelect = false;
|
||||
dataGridView.Name = "dataGridView";
|
||||
dataGridView.ReadOnly = true;
|
||||
dataGridView.RowHeadersVisible = false;
|
||||
dataGridView.RowHeadersWidth = 51;
|
||||
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dataGridView.Size = new Size(648, 450);
|
||||
dataGridView.TabIndex = 3;
|
||||
//
|
||||
// panelButtons
|
||||
//
|
||||
panelButtons.Controls.Add(buttonRemove);
|
||||
panelButtons.Controls.Add(buttonEdit);
|
||||
panelButtons.Controls.Add(buttonAdd);
|
||||
panelButtons.Dock = DockStyle.Right;
|
||||
panelButtons.Location = new Point(648, 0);
|
||||
panelButtons.Name = "panelButtons";
|
||||
panelButtons.Size = new Size(152, 450);
|
||||
panelButtons.TabIndex = 2;
|
||||
//
|
||||
// buttonRemove
|
||||
//
|
||||
buttonRemove.Image = (Image)resources.GetObject("buttonRemove.Image");
|
||||
buttonRemove.Location = new Point(23, 254);
|
||||
buttonRemove.Name = "buttonRemove";
|
||||
buttonRemove.Size = new Size(115, 115);
|
||||
buttonRemove.TabIndex = 2;
|
||||
buttonRemove.UseVisualStyleBackColor = true;
|
||||
buttonRemove.Click += buttonRemove_Click;
|
||||
//
|
||||
// buttonEdit
|
||||
//
|
||||
buttonEdit.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
buttonEdit.Image = (Image)resources.GetObject("buttonEdit.Image");
|
||||
buttonEdit.Location = new Point(23, 133);
|
||||
buttonEdit.Name = "buttonEdit";
|
||||
buttonEdit.Size = new Size(115, 115);
|
||||
buttonEdit.TabIndex = 1;
|
||||
buttonEdit.UseVisualStyleBackColor = true;
|
||||
buttonEdit.Click += buttonEdit_Click;
|
||||
//
|
||||
// buttonAdd
|
||||
//
|
||||
buttonAdd.BackgroundImageLayout = ImageLayout.Center;
|
||||
buttonAdd.Image = (Image)resources.GetObject("buttonAdd.Image");
|
||||
buttonAdd.Location = new Point(23, 12);
|
||||
buttonAdd.Name = "buttonAdd";
|
||||
buttonAdd.Size = new Size(115, 115);
|
||||
buttonAdd.TabIndex = 0;
|
||||
buttonAdd.UseVisualStyleBackColor = true;
|
||||
buttonAdd.Click += buttonAdd_Click;
|
||||
//
|
||||
// FormMaterials
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 450);
|
||||
Controls.Add(dataGridView);
|
||||
Controls.Add(panelButtons);
|
||||
Name = "FormMaterials";
|
||||
StartPosition = FormStartPosition.CenterParent;
|
||||
Text = "FormMaterials";
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
panelButtons.ResumeLayout(false);
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DataGridView dataGridView;
|
||||
private Panel panelButtons;
|
||||
private Button buttonRemove;
|
||||
private Button buttonEdit;
|
||||
private Button buttonAdd;
|
||||
}
|
||||
}
|
106
ProjectPublishing/ProjectPublishing/Forms/FormMaterials.cs
Normal file
106
ProjectPublishing/ProjectPublishing/Forms/FormMaterials.cs
Normal file
@ -0,0 +1,106 @@
|
||||
using ProjectPublishing.Repositories;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Unity;
|
||||
|
||||
namespace ProjectPublishing.Forms
|
||||
{
|
||||
public partial class FormMaterials : Form
|
||||
{
|
||||
private readonly IUnityContainer _container;
|
||||
private readonly IMaterialRepository _materialRepository;
|
||||
public FormMaterials(IUnityContainer container, IMaterialRepository materialRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_container = container ?? throw new ArgumentException(nameof(container));
|
||||
_materialRepository = materialRepository ?? throw new ArgumentException(nameof(materialRepository));
|
||||
}
|
||||
|
||||
private void buttonAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormMaterial>().ShowDialog();
|
||||
loadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!tryGetIDFromRow(out var findId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
var form = _container.Resolve<FormMaterial>();
|
||||
form.Id = findId;
|
||||
form.ShowDialog();
|
||||
loadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonRemove_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!tryGetIDFromRow(out var findId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
_materialRepository.DeleteMaterial(findId);
|
||||
loadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void FormMaterials_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
loadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void loadList() => dataGridView.DataSource = _materialRepository.ReadMaterials();
|
||||
|
||||
private bool tryGetIDFromRow(out int id)
|
||||
{
|
||||
id = 0;
|
||||
if (dataGridView.SelectedRows.Count < 1)
|
||||
{
|
||||
MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return false;
|
||||
}
|
||||
id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
233
ProjectPublishing/ProjectPublishing/Forms/FormMaterials.resx
Normal file
233
ProjectPublishing/ProjectPublishing/Forms/FormMaterials.resx
Normal file
@ -0,0 +1,233 @@
|
||||
<?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="buttonRemove.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
|
||||
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAB3RJTUUH6AcSDjMPELkl4AAACdZJREFU
|
||||
eF7tnUWsJUUUhh8Ed3d3h+CaQHBfsSH4gg0e3II7JDhhga5wHSDBQ3DXDcEXOAR3+79kXhiKc9871bf6
|
||||
3u7b50u+ZDLzprq7+nV3yalTY0EQBEEQBEHQi+nlsnJ7eZi8Uj4gn5Gvy3fl1/LXqfJn/o5/e1reL6+Q
|
||||
h0rKWEZSZjAkZpXbyLMkN+hn+XdhKfMpeabcWnLMoEaWlsfLx+Uv0ropdcoxH5PHyaVkUACemj3kvfIP
|
||||
aVX8MPxTPikPlHPKIJPV5PXyJ2lVcJP8UV4nV5XBJKwlb5RNelq98lTzptlABgnrS1qyVsW1zb/kFLmu
|
||||
7DzzyEtkG5/YyeSJ5m00v+wc08l95GfSqpxR8ktJY4xr7gR0d56QVmWMsnSxRr57tbtkFM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||
a8gAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="buttonEdit.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||
vQAADr0BR/uQrQAAA9dJREFUeF7tnS2QE0EQRuOQSCQSiUSeRCKRSCTy5LmTSOTJk0gkEolEIpHIs9Af
|
||||
VV0V0eSS7fnpSd6regJzlZrvY7IzO5vdAQAAAAAAAAAAAAAAAABAkivzxvxq/jL/mN/Ne/PafGrCGfLE
|
||||
vDUV+CFVitcmnBGvzB9mFPj/vDNVGlgc/W9+MKOQH/OLSQkWJhO+SwkWpUX4LiVYjJbhu5RgEXqE71KC
|
||||
4vQM36UERRkRvksJijEyfJcSFGFG+C4lmIz29WeF71KCiejGjW7kRMGM9JMJk6hSAs1GMIkKJfhp8lUw
|
||||
kQoleGvCRGaX4KMJHdBST/fzn//712FmlkArAmjM/jpf37OVS6DPBw2JNnkql0DnDKERh3b4qpaAa4BG
|
||||
HLO9W7EE70xowEvztxkN8r6VSqDTxM9MaMRqJWAPoAOrlEAPlUAnqpdAf0t/EzpStQSEn0RX+5/NY26i
|
||||
VCsB4SfZX+ode6iiSgkIP0m0zl+lBISf5NAmT/USEH6SY3b4qpaA8JMcE75brQSEn+SU8N0qJSD8JFvC
|
||||
d2eXgPCTZMJ3Z5aA8BO0CN+dVQLYSMvwXUqwCD3CdylBcXqG71KCoowI321dAt2QggQjw3dblYClXpIZ
|
||||
4bvZEhB+kpnhu1tLQPhJKoTvnloCwk9SKXz3lBIQfoKK4bvHlgA2Ujl8lxJ0YoXwXUrQmJXCdylBI1YM
|
||||
3+Vp3SQrh89SL8nK4esGD0/qJlg9fO7uJVg5fO3yEX6C1cPXLh9shPAvGMK/YFYOX59bL4WEjawevj4/
|
||||
bITwL5iVw5eEn0DfmSuHz48xJtD2qL8zf0UJP4nOv0cDu4LvTUigtXI0sCt4Y0ISvdkqGtzqEn4DdDJG
|
||||
O2bRAFeWAx2N0A8ZRwNc2TsTGqHzcdEgV5XwG6Kl30rrfpUVGqLlUzTQFeUkbwf0IqNosKtJ+B3Q9B8N
|
||||
djU5wduJD2Y04JUk/I58M6NBryLhd0SnY6NBryLHtztzbUYDX0HCH4Cm12jwZ0v4A3hhRoM/Wx7cGITu
|
||||
oEUBzJTj2wPRu/ajEGZJ+AOpdvCD8Adza0ZBzFA3oXhwYzBVDn1ydn8CV2YUxmgJfxIVzv3pO59pfwIV
|
||||
zv3pJA8/zTIJTblRKL3VdK/gudKfjEKIAuql7jTqSR3u5hVA0/+Ic39aYWiZqa1mKETPY98+xXNVX5h7
|
||||
Mwovo6Z4HShlii9Oy+lfU7yexmGKX4g3ZhTmKWoG0dcILMjWzR8dGGGKPwNOWf4xxZ8hjx391vWBpniu
|
||||
4s8UXQRGv/zBFH9hKGjdDZRM8QAAAAAAAAAAAAAAAAA12O3+AseEEu6imt+zAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="buttonAdd.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAABGdBTUEAALGPC/xhBQAACEJJREFUeF7t
|
||||
nWWoNVUUhq/d3d1id3djgigoiojgDxFFRPwjqD/8oSCIiolidyCIhd3d3Y3d3fE8l6vcb1j3nD33nn1q
|
||||
zwsP38e5M3Nmr3Vmx9pr7xkZEM0Km8DxcCe8Dz/D3/AX/DT22e1wLGwMntNoipoZdoSr4VPQ2P+0wWM+
|
||||
gSthB/AajSahZeFs+BYiQ6fwDXgNr9WohjaDxyAy6mR4HLaARgnaHt6AyJBT4U2wOmvUQja0r0NkwE6g
|
||||
Y326GgVaCh6CyHCd5GFYGhqN04xwKkQGy8H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sXfRysw53US96itVpzachMk6VHA4wTdx1zcXK/nPqPGoOBxgqGM1Q
|
||||
LlW93rLMOFfRW5a5ad/LEBmnSg4HuC6i6E37mm0reyzjKL3euNUgY7Fqti7usZrNu3usZvv6HqvOCxzM
|
||||
3kuJtzt5dC1E16jiRJLtULGq0wtyWazR03ZybJE6ui7+FSbOiKWGo41cutVZOzltmpqf7xRp0S/xsb6u
|
||||
8xY9Q9etBk7mW6Y+UVL8a6zUYRAZZyKcIN8TjKRa34vViL/81DcySfMitzEZjaybe+RcrvMIrk9wbzbr
|
||||
fCfYo2MnonmV4ZjMjnAxRWSknNirypY6MmjyNebOTkWGyoFrIZp3zI+Tq3RM+IqMlQPXQth2NBont3ZM
|
||||
naCfCo4nih58tZI5OqnR0cng3MP60KiF3IsohxM0ftFZcHVkspRJs53YKtlrWO00v/yaMkx8GrhpdmTY
|
||||
FOzt2OA2df4kZe/IauMicOCUsqLfNQxGWM3Pd7lV09fvgBysubjtKLgBjPf4ZDj6FROsDEO4y/sR4B7/
|
||||
Oq/PNTLyL00LnOXokiBjAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
244
ProjectPublishing/ProjectPublishing/Forms/FormOrder.Designer.cs
generated
Normal file
244
ProjectPublishing/ProjectPublishing/Forms/FormOrder.Designer.cs
generated
Normal file
@ -0,0 +1,244 @@
|
||||
namespace ProjectPublishing.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()
|
||||
{
|
||||
buttonCancel = new Button();
|
||||
buttonSave = new Button();
|
||||
textBoxDesc = new TextBox();
|
||||
label1 = new Label();
|
||||
comboBoxOrderType = new ComboBox();
|
||||
label2 = new Label();
|
||||
numericUpDownAmount = new NumericUpDown();
|
||||
label3 = new Label();
|
||||
comboBoxStatus = new ComboBox();
|
||||
label4 = new Label();
|
||||
label5 = new Label();
|
||||
label6 = new Label();
|
||||
label7 = new Label();
|
||||
comboBoxCustomerID = new ComboBox();
|
||||
comboBoxPrintingUD = new ComboBox();
|
||||
comboBoxMaterialsID = new ComboBox();
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDownAmount).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// buttonCancel
|
||||
//
|
||||
buttonCancel.Location = new Point(211, 401);
|
||||
buttonCancel.Name = "buttonCancel";
|
||||
buttonCancel.Size = new Size(94, 29);
|
||||
buttonCancel.TabIndex = 13;
|
||||
buttonCancel.Text = "Отмена";
|
||||
buttonCancel.UseVisualStyleBackColor = true;
|
||||
buttonCancel.Click += buttonCancel_Click;
|
||||
//
|
||||
// buttonSave
|
||||
//
|
||||
buttonSave.Location = new Point(12, 401);
|
||||
buttonSave.Name = "buttonSave";
|
||||
buttonSave.Size = new Size(94, 29);
|
||||
buttonSave.TabIndex = 12;
|
||||
buttonSave.Text = "Сохранить";
|
||||
buttonSave.UseVisualStyleBackColor = true;
|
||||
buttonSave.Click += buttonSave_Click;
|
||||
//
|
||||
// textBoxDesc
|
||||
//
|
||||
textBoxDesc.Location = new Point(144, 12);
|
||||
textBoxDesc.Multiline = true;
|
||||
textBoxDesc.Name = "textBoxDesc";
|
||||
textBoxDesc.Size = new Size(161, 129);
|
||||
textBoxDesc.TabIndex = 10;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Location = new Point(12, 15);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(79, 20);
|
||||
label1.TabIndex = 8;
|
||||
label1.Text = "Описание";
|
||||
//
|
||||
// comboBoxOrderType
|
||||
//
|
||||
comboBoxOrderType.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
comboBoxOrderType.FormattingEnabled = true;
|
||||
comboBoxOrderType.Location = new Point(144, 147);
|
||||
comboBoxOrderType.Name = "comboBoxOrderType";
|
||||
comboBoxOrderType.Size = new Size(161, 28);
|
||||
comboBoxOrderType.TabIndex = 16;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Location = new Point(12, 150);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(102, 20);
|
||||
label2.TabIndex = 15;
|
||||
label2.Text = "Тип продукта";
|
||||
//
|
||||
// numericUpDownAmount
|
||||
//
|
||||
numericUpDownAmount.Location = new Point(144, 196);
|
||||
numericUpDownAmount.Maximum = new decimal(new int[] { 10000, 0, 0, 0 });
|
||||
numericUpDownAmount.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
|
||||
numericUpDownAmount.Name = "numericUpDownAmount";
|
||||
numericUpDownAmount.Size = new Size(161, 27);
|
||||
numericUpDownAmount.TabIndex = 18;
|
||||
numericUpDownAmount.Value = new decimal(new int[] { 1, 0, 0, 0 });
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.AutoSize = true;
|
||||
label3.Location = new Point(12, 198);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new Size(58, 20);
|
||||
label3.TabIndex = 17;
|
||||
label3.Text = "Кол-во";
|
||||
//
|
||||
// comboBoxStatus
|
||||
//
|
||||
comboBoxStatus.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
comboBoxStatus.FormattingEnabled = true;
|
||||
comboBoxStatus.Location = new Point(144, 238);
|
||||
comboBoxStatus.Name = "comboBoxStatus";
|
||||
comboBoxStatus.Size = new Size(161, 28);
|
||||
comboBoxStatus.TabIndex = 20;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
label4.AutoSize = true;
|
||||
label4.Location = new Point(12, 241);
|
||||
label4.Name = "label4";
|
||||
label4.Size = new Size(52, 20);
|
||||
label4.TabIndex = 19;
|
||||
label4.Text = "Статус";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
label5.AutoSize = true;
|
||||
label5.Location = new Point(12, 275);
|
||||
label5.Name = "label5";
|
||||
label5.Size = new Size(97, 20);
|
||||
label5.TabIndex = 21;
|
||||
label5.Text = "ID заказчика";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
label6.AutoSize = true;
|
||||
label6.Location = new Point(12, 309);
|
||||
label6.Name = "label6";
|
||||
label6.Size = new Size(112, 20);
|
||||
label6.TabIndex = 23;
|
||||
label6.Text = "ID типографии";
|
||||
//
|
||||
// label7
|
||||
//
|
||||
label7.AutoSize = true;
|
||||
label7.Location = new Point(12, 343);
|
||||
label7.Name = "label7";
|
||||
label7.Size = new Size(112, 20);
|
||||
label7.TabIndex = 25;
|
||||
label7.Text = "ID материалов";
|
||||
//
|
||||
// comboBoxCustomerID
|
||||
//
|
||||
comboBoxCustomerID.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
comboBoxCustomerID.FormattingEnabled = true;
|
||||
comboBoxCustomerID.Location = new Point(144, 272);
|
||||
comboBoxCustomerID.Name = "comboBoxCustomerID";
|
||||
comboBoxCustomerID.Size = new Size(161, 28);
|
||||
comboBoxCustomerID.TabIndex = 26;
|
||||
//
|
||||
// comboBoxPrintingUD
|
||||
//
|
||||
comboBoxPrintingUD.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
comboBoxPrintingUD.FormattingEnabled = true;
|
||||
comboBoxPrintingUD.Location = new Point(144, 306);
|
||||
comboBoxPrintingUD.Name = "comboBoxPrintingUD";
|
||||
comboBoxPrintingUD.Size = new Size(161, 28);
|
||||
comboBoxPrintingUD.TabIndex = 27;
|
||||
//
|
||||
// comboBoxMaterialsID
|
||||
//
|
||||
comboBoxMaterialsID.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
comboBoxMaterialsID.FormattingEnabled = true;
|
||||
comboBoxMaterialsID.Location = new Point(144, 340);
|
||||
comboBoxMaterialsID.Name = "comboBoxMaterialsID";
|
||||
comboBoxMaterialsID.Size = new Size(161, 28);
|
||||
comboBoxMaterialsID.TabIndex = 28;
|
||||
//
|
||||
// FormOrder
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(317, 450);
|
||||
Controls.Add(comboBoxMaterialsID);
|
||||
Controls.Add(comboBoxPrintingUD);
|
||||
Controls.Add(comboBoxCustomerID);
|
||||
Controls.Add(label7);
|
||||
Controls.Add(label6);
|
||||
Controls.Add(label5);
|
||||
Controls.Add(comboBoxStatus);
|
||||
Controls.Add(label4);
|
||||
Controls.Add(numericUpDownAmount);
|
||||
Controls.Add(label3);
|
||||
Controls.Add(comboBoxOrderType);
|
||||
Controls.Add(label2);
|
||||
Controls.Add(buttonCancel);
|
||||
Controls.Add(buttonSave);
|
||||
Controls.Add(textBoxDesc);
|
||||
Controls.Add(label1);
|
||||
Name = "FormOrder";
|
||||
StartPosition = FormStartPosition.CenterParent;
|
||||
Text = "FormOrder";
|
||||
((System.ComponentModel.ISupportInitialize)numericUpDownAmount).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Button buttonCancel;
|
||||
private Button buttonSave;
|
||||
private TextBox textBoxDesc;
|
||||
private Label label1;
|
||||
private ComboBox comboBoxOrderType;
|
||||
private Label label2;
|
||||
private NumericUpDown numericUpDownAmount;
|
||||
private Label label3;
|
||||
private ComboBox comboBoxStatus;
|
||||
private Label label4;
|
||||
private Label label5;
|
||||
private Label label6;
|
||||
private Label label7;
|
||||
private ComboBox comboBoxCustomerID;
|
||||
private ComboBox comboBoxPrintingUD;
|
||||
private ComboBox comboBoxMaterialsID;
|
||||
}
|
||||
}
|
104
ProjectPublishing/ProjectPublishing/Forms/FormOrder.cs
Normal file
104
ProjectPublishing/ProjectPublishing/Forms/FormOrder.cs
Normal file
@ -0,0 +1,104 @@
|
||||
using ProjectPublishing.Entities.Enums;
|
||||
using ProjectPublishing.Entities;
|
||||
using ProjectPublishing.Repositories;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ProjectPublishing.Forms
|
||||
{
|
||||
public partial class FormOrder : Form
|
||||
{
|
||||
private readonly IOrderRepository _orderRepository;
|
||||
private int? _orderId;
|
||||
|
||||
public int Id
|
||||
{
|
||||
set
|
||||
{
|
||||
try
|
||||
{
|
||||
var material = _orderRepository.ReadOrderById(value);
|
||||
if (material == null)
|
||||
{
|
||||
throw new InvalidDataException(nameof(material));
|
||||
}
|
||||
textBoxDesc.Text = material.Description;
|
||||
numericUpDownAmount.Value = material.Amount;
|
||||
comboBoxOrderType.SelectedItem = material.ProductType;
|
||||
comboBoxStatus.SelectedItem = material.Status;
|
||||
comboBoxCustomerID.SelectedItem = material.CustomerId;
|
||||
comboBoxPrintingUD.SelectedItem = material.PrintingId;
|
||||
comboBoxMaterialsID.SelectedItem = material.MaterialsId;
|
||||
_orderId = value;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public FormOrder(IOrderRepository orderRepository, ICustomerRepository customerRepository, IPrintingHouseRepository printingHouseRepository, IMaterialRepository materialRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_orderRepository = orderRepository ?? throw new ArgumentException(nameof(orderRepository));
|
||||
comboBoxOrderType.DataSource = Enum.GetValues(typeof(ProductType));
|
||||
comboBoxStatus.DataSource = Enum.GetValues(typeof(OrderStatus));
|
||||
comboBoxCustomerID.DataSource = customerRepository.ReadCustomers();
|
||||
comboBoxPrintingUD.DataSource = printingHouseRepository.ReadPrintingHouses();
|
||||
comboBoxMaterialsID.DataSource = materialRepository.ReadMaterials();
|
||||
|
||||
comboBoxCustomerID.DisplayMember = "Name";
|
||||
comboBoxCustomerID.ValueMember = "Id";
|
||||
|
||||
comboBoxPrintingUD.DisplayMember = "Name";
|
||||
comboBoxPrintingUD.ValueMember = "Id";
|
||||
|
||||
comboBoxMaterialsID.DisplayMember = "MaterialType";
|
||||
comboBoxMaterialsID.ValueMember= "Id";
|
||||
}
|
||||
|
||||
private void buttonSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
if (_orderId.HasValue)
|
||||
{
|
||||
_orderRepository.UpdateOrder(CreateOrder(_orderId.Value));
|
||||
}
|
||||
else
|
||||
{
|
||||
_orderRepository.UpdateOrder(CreateOrder(0));
|
||||
}
|
||||
Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonCancel_Click(object sender, EventArgs e) => Close();
|
||||
|
||||
private Order CreateOrder(int id) => Order.CreateOrder
|
||||
(
|
||||
id,
|
||||
textBoxDesc.Text,
|
||||
(ProductType)comboBoxOrderType.SelectedItem!,
|
||||
(int)numericUpDownAmount.Value,
|
||||
(OrderStatus)comboBoxStatus.SelectedItem!,
|
||||
(int)comboBoxCustomerID.SelectedValue!,
|
||||
(int)comboBoxPrintingUD.SelectedValue!,
|
||||
(int)comboBoxMaterialsID.SelectedValue!
|
||||
);
|
||||
}
|
||||
}
|
120
ProjectPublishing/ProjectPublishing/Forms/FormOrder.resx
Normal file
120
ProjectPublishing/ProjectPublishing/Forms/FormOrder.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
126
ProjectPublishing/ProjectPublishing/Forms/FormOrders.Designer.cs
generated
Normal file
126
ProjectPublishing/ProjectPublishing/Forms/FormOrders.Designer.cs
generated
Normal file
@ -0,0 +1,126 @@
|
||||
namespace ProjectPublishing.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));
|
||||
dataGridView = new DataGridView();
|
||||
panelButtons = new Panel();
|
||||
buttonRemove = new Button();
|
||||
buttonEdit = new Button();
|
||||
buttonAdd = new Button();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
panelButtons.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// dataGridView
|
||||
//
|
||||
dataGridView.AllowUserToAddRows = false;
|
||||
dataGridView.AllowUserToDeleteRows = false;
|
||||
dataGridView.AllowUserToResizeColumns = false;
|
||||
dataGridView.AllowUserToResizeRows = false;
|
||||
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dataGridView.Dock = DockStyle.Fill;
|
||||
dataGridView.Location = new Point(0, 0);
|
||||
dataGridView.MultiSelect = false;
|
||||
dataGridView.Name = "dataGridView";
|
||||
dataGridView.ReadOnly = true;
|
||||
dataGridView.RowHeadersVisible = false;
|
||||
dataGridView.RowHeadersWidth = 51;
|
||||
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dataGridView.Size = new Size(648, 450);
|
||||
dataGridView.TabIndex = 5;
|
||||
//
|
||||
// panelButtons
|
||||
//
|
||||
panelButtons.Controls.Add(buttonRemove);
|
||||
panelButtons.Controls.Add(buttonEdit);
|
||||
panelButtons.Controls.Add(buttonAdd);
|
||||
panelButtons.Dock = DockStyle.Right;
|
||||
panelButtons.Location = new Point(648, 0);
|
||||
panelButtons.Name = "panelButtons";
|
||||
panelButtons.Size = new Size(152, 450);
|
||||
panelButtons.TabIndex = 4;
|
||||
//
|
||||
// buttonRemove
|
||||
//
|
||||
buttonRemove.Image = (Image)resources.GetObject("buttonRemove.Image");
|
||||
buttonRemove.Location = new Point(23, 254);
|
||||
buttonRemove.Name = "buttonRemove";
|
||||
buttonRemove.Size = new Size(115, 115);
|
||||
buttonRemove.TabIndex = 2;
|
||||
buttonRemove.UseVisualStyleBackColor = true;
|
||||
buttonRemove.Click += buttonRemove_Click;
|
||||
//
|
||||
// buttonEdit
|
||||
//
|
||||
buttonEdit.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
buttonEdit.Image = (Image)resources.GetObject("buttonEdit.Image");
|
||||
buttonEdit.Location = new Point(23, 133);
|
||||
buttonEdit.Name = "buttonEdit";
|
||||
buttonEdit.Size = new Size(115, 115);
|
||||
buttonEdit.TabIndex = 1;
|
||||
buttonEdit.UseVisualStyleBackColor = true;
|
||||
buttonEdit.Click += buttonEdit_Click;
|
||||
//
|
||||
// buttonAdd
|
||||
//
|
||||
buttonAdd.BackgroundImageLayout = ImageLayout.Center;
|
||||
buttonAdd.Image = (Image)resources.GetObject("buttonAdd.Image");
|
||||
buttonAdd.Location = new Point(23, 12);
|
||||
buttonAdd.Name = "buttonAdd";
|
||||
buttonAdd.Size = new Size(115, 115);
|
||||
buttonAdd.TabIndex = 0;
|
||||
buttonAdd.UseVisualStyleBackColor = true;
|
||||
buttonAdd.Click += buttonAdd_Click;
|
||||
//
|
||||
// FormOrders
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 450);
|
||||
Controls.Add(dataGridView);
|
||||
Controls.Add(panelButtons);
|
||||
Name = "FormOrders";
|
||||
StartPosition = FormStartPosition.CenterParent;
|
||||
Text = "FormOrders";
|
||||
Load += FormOrders_Load;
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
panelButtons.ResumeLayout(false);
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DataGridView dataGridView;
|
||||
private Panel panelButtons;
|
||||
private Button buttonRemove;
|
||||
private Button buttonEdit;
|
||||
private Button buttonAdd;
|
||||
}
|
||||
}
|
106
ProjectPublishing/ProjectPublishing/Forms/FormOrders.cs
Normal file
106
ProjectPublishing/ProjectPublishing/Forms/FormOrders.cs
Normal file
@ -0,0 +1,106 @@
|
||||
using ProjectPublishing.Repositories;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Unity;
|
||||
|
||||
namespace ProjectPublishing.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 ArgumentException(nameof(container));
|
||||
_orderRepository = orderRepository ?? throw new ArgumentException(nameof(orderRepository));
|
||||
}
|
||||
|
||||
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 buttonEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!tryGetIDFromRow(out var findId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
var form = _container.Resolve<FormOrder>();
|
||||
form.Id = findId;
|
||||
form.ShowDialog();
|
||||
loadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonRemove_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!tryGetIDFromRow(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 FormOrders_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
loadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void loadList() => dataGridView.DataSource = _orderRepository.ReadOrders();
|
||||
|
||||
private bool tryGetIDFromRow(out int id)
|
||||
{
|
||||
id = 0;
|
||||
if (dataGridView.SelectedRows.Count < 1)
|
||||
{
|
||||
MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return false;
|
||||
}
|
||||
id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
233
ProjectPublishing/ProjectPublishing/Forms/FormOrders.resx
Normal file
233
ProjectPublishing/ProjectPublishing/Forms/FormOrders.resx
Normal file
@ -0,0 +1,233 @@
|
||||
<?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="buttonRemove.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
|
||||
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAB3RJTUUH6AcSDjMPELkl4AAACdZJREFU
|
||||
eF7tnUWsJUUUhh8Ed3d3h+CaQHBfsSH4gg0e3II7JDhhga5wHSDBQ3DXDcEXOAR3+79kXhiKc9871bf6
|
||||
3u7b50u+ZDLzprq7+nV3yalTY0EQBEEQBEHQi+nlsnJ7eZi8Uj4gn5Gvy3fl1/LXqfJn/o5/e1reL6+Q
|
||||
h0rKWEZSZjAkZpXbyLMkN+hn+XdhKfMpeabcWnLMoEaWlsfLx+Uv0ropdcoxH5PHyaVkUACemj3kvfIP
|
||||
aVX8MPx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TH6TpsQTAxpg9jWnL0TGfLzpl3MkdkhnlJ21yYPFZtjBEOCPibz
|
||||
seTNZBdOltfcL7lBRDIyqM+sD/PUyJ/5O/6Nn+Fn2dyRlLxMdVJWJ/utQRAEQRAEwaSMjf0DMjsRo5UV
|
||||
a8gAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="buttonEdit.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||
vAAADrwBlbxySQAAA9dJREFUeF7tnS2QE0EQRuOQSCQSiUSeRCKRSCTy5LmTSOTJk0gkEolEIpHIs9Af
|
||||
VV0V0eSS7fnpSd6regJzlZrvY7IzO5vdAQAAAAAAAAAAAAAAAABAkivzxvxq/jL/mN/Ne/PafGrCGfLE
|
||||
vDUV+CFVitcmnBGvzB9mFPj/vDNVGlgc/W9+MKOQH/OLSQkWJhO+SwkWpUX4LiVYjJbhu5RgEXqE71KC
|
||||
4vQM36UERRkRvksJijEyfJcSFGFG+C4lmIz29WeF71KCiejGjW7kRMGM9JMJk6hSAs1GMIkKJfhp8lUw
|
||||
kQoleGvCRGaX4KMJHdBST/fzn//712FmlkArAmjM/jpf37OVS6DPBw2JNnkql0DnDKERh3b4qpaAa4BG
|
||||
HLO9W7EE70xowEvztxkN8r6VSqDTxM9MaMRqJWAPoAOrlEAPlUAnqpdAf0t/EzpStQSEn0RX+5/NY26i
|
||||
VCsB4SfZX+ode6iiSgkIP0m0zl+lBISf5NAmT/USEH6SY3b4qpaA8JMcE75brQSEn+SU8N0qJSD8JFvC
|
||||
d2eXgPCTZMJ3Z5aA8BO0CN+dVQLYSMvwXUqwCD3CdylBcXqG71KCoowI321dAt2QggQjw3dblYClXpIZ
|
||||
4bvZEhB+kpnhu1tLQPhJKoTvnloCwk9SKXz3lBIQfoKK4bvHlgA2Ujl8lxJ0YoXwXUrQmJXCdylBI1YM
|
||||
3+Vp3SQrh89SL8nK4esGD0/qJlg9fO7uJVg5fO3yEX6C1cPXLh9shPAvGMK/YFYOX59bL4WEjawevj4/
|
||||
bITwL5iVw5eEn0DfmSuHz48xJtD2qL8zf0UJP4nOv0cDu4LvTUigtXI0sCt4Y0ISvdkqGtzqEn4DdDJG
|
||||
O2bRAFeWAx2N0A8ZRwNc2TsTGqHzcdEgV5XwG6Kl30rrfpUVGqLlUzTQFeUkbwf0IqNosKtJ+B3Q9B8N
|
||||
djU5wduJD2Y04JUk/I58M6NBryLhd0SnY6NBryLHtztzbUYDX0HCH4Cm12jwZ0v4A3hhRoM/Wx7cGITu
|
||||
oEUBzJTj2wPRu/ajEGZJ+AOpdvCD8Adza0ZBzFA3oXhwYzBVDn1ydn8CV2YUxmgJfxIVzv3pO59pfwIV
|
||||
zv3pJA8/zTIJTblRKL3VdK/gudKfjEKIAuql7jTqSR3u5hVA0/+Ic39aYWiZqa1mKETPY98+xXNVX5h7
|
||||
Mwovo6Z4HShlii9Oy+lfU7yexmGKX4g3ZhTmKWoG0dcILMjWzR8dGGGKPwNOWf4xxZ8hjx391vWBpniu
|
||||
4s8UXQRGv/zBFH9hKGjdDZRM8QAAAAAAAAAAAAAAAAA12O3+AseEEu6imt+zAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="buttonAdd.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAABGdBTUEAALGPC/xhBQAACEJJREFUeF7t
|
||||
nWWoNVUUhq/d3d1id3djgigoiojgDxFFRPwjqD/8oSCIiolidyCIhd3d3Y3d3fE8l6vcb1j3nD33nn1q
|
||||
zwsP38e5M3Nmr3Vmx9pr7xkZEM0Km8DxcCe8Dz/D3/AX/DT22e1wLGwMntNoip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fVrLkSxDJbFMllmy2hZLbNl1wZ+7nl1
|
||||
4lV9IW/aX05knCo5HGD8xtUwxcpfmo97ZJwqORzgjFRy13AY5WOeumF3Dgc4G2hDWaysY23oIuNUyeEA
|
||||
82HNDCxWNtCpu93mcIALCV0BWazsXfRysw53US96itVpzachMk6VHA4wTdx1zcXK/nPqPGoOBxgqGM1Q
|
||||
LlW93rLMOFfRW5a5ad/LEBmnSg4HuC6i6E37mm0reyzjKL3euNUgY7Fqti7usZrNu3usZvv6HqvOCxzM
|
||||
3kuJtzt5dC1E16jiRJLtULGq0wtyWazR03ZybJE6ui7+FSbOiKWGo41cutVZOzltmpqf7xRp0S/xsb6u
|
||||
8xY9Q9etBk7mW6Y+UVL8a6zUYRAZZyKcIN8TjKRa34vViL/81DcySfMitzEZjaybe+RcrvMIrk9wbzbr
|
||||
fCfYo2MnonmV4ZjMjnAxRWSknNirypY6MmjyNebOTkWGyoFrIZp3zI+Tq3RM+IqMlQPXQth2NBont3ZM
|
||||
naCfCo4nih58tZI5OqnR0cng3MP60KiF3IsohxM0ftFZcHVkspRJs53YKtlrWO00v/yaMkx8GrhpdmTY
|
||||
FOzt2OA2df4kZe/IauMicOCUsqLfNQxGWM3Pd7lV09fvgBysubjtKLgBjPf4ZDj6FROsDEO4y/sR4B7/
|
||||
Oq/PNTLyL00LnOXokiBjAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
162
ProjectPublishing/ProjectPublishing/Forms/FormPrintingHouse.Designer.cs
generated
Normal file
162
ProjectPublishing/ProjectPublishing/Forms/FormPrintingHouse.Designer.cs
generated
Normal file
@ -0,0 +1,162 @@
|
||||
namespace ProjectPublishing.Forms
|
||||
{
|
||||
partial class FormPrintingHouse
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
buttonCancel = new Button();
|
||||
buttonSave = new Button();
|
||||
textBoxEmail = new TextBox();
|
||||
textBoxPhone = new TextBox();
|
||||
label2 = new Label();
|
||||
label1 = new Label();
|
||||
label3 = new Label();
|
||||
label4 = new Label();
|
||||
textBoxName = new TextBox();
|
||||
textBoxAddress = new TextBox();
|
||||
SuspendLayout();
|
||||
//
|
||||
// buttonCancel
|
||||
//
|
||||
buttonCancel.Location = new Point(206, 255);
|
||||
buttonCancel.Name = "buttonCancel";
|
||||
buttonCancel.Size = new Size(94, 29);
|
||||
buttonCancel.TabIndex = 13;
|
||||
buttonCancel.Text = "Отмена";
|
||||
buttonCancel.UseVisualStyleBackColor = true;
|
||||
buttonCancel.Click += buttonCancel_Click;
|
||||
//
|
||||
// buttonSave
|
||||
//
|
||||
buttonSave.Location = new Point(7, 255);
|
||||
buttonSave.Name = "buttonSave";
|
||||
buttonSave.Size = new Size(94, 29);
|
||||
buttonSave.TabIndex = 12;
|
||||
buttonSave.Text = "Сохранить";
|
||||
buttonSave.UseVisualStyleBackColor = true;
|
||||
buttonSave.Click += buttonSave_Click;
|
||||
//
|
||||
// textBoxEmail
|
||||
//
|
||||
textBoxEmail.Location = new Point(139, 156);
|
||||
textBoxEmail.Name = "textBoxEmail";
|
||||
textBoxEmail.Size = new Size(161, 27);
|
||||
textBoxEmail.TabIndex = 11;
|
||||
//
|
||||
// textBoxPhone
|
||||
//
|
||||
textBoxPhone.Location = new Point(139, 106);
|
||||
textBoxPhone.Name = "textBoxPhone";
|
||||
textBoxPhone.Size = new Size(161, 27);
|
||||
textBoxPhone.TabIndex = 10;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Location = new Point(7, 159);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(51, 20);
|
||||
label2.TabIndex = 9;
|
||||
label2.Text = "Почта";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Location = new Point(7, 109);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(69, 20);
|
||||
label1.TabIndex = 8;
|
||||
label1.Text = "Телефон";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.AutoSize = true;
|
||||
label3.Location = new Point(7, 15);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new Size(77, 20);
|
||||
label3.TabIndex = 8;
|
||||
label3.Text = "Название";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
label4.AutoSize = true;
|
||||
label4.Location = new Point(7, 65);
|
||||
label4.Name = "label4";
|
||||
label4.Size = new Size(51, 20);
|
||||
label4.TabIndex = 9;
|
||||
label4.Text = "Адрес";
|
||||
//
|
||||
// textBoxName
|
||||
//
|
||||
textBoxName.Location = new Point(139, 12);
|
||||
textBoxName.Name = "textBoxName";
|
||||
textBoxName.Size = new Size(161, 27);
|
||||
textBoxName.TabIndex = 10;
|
||||
//
|
||||
// textBoxAddress
|
||||
//
|
||||
textBoxAddress.Location = new Point(139, 62);
|
||||
textBoxAddress.Name = "textBoxAddress";
|
||||
textBoxAddress.Size = new Size(161, 27);
|
||||
textBoxAddress.TabIndex = 11;
|
||||
//
|
||||
// FormPrintingHouse
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(307, 301);
|
||||
Controls.Add(buttonCancel);
|
||||
Controls.Add(buttonSave);
|
||||
Controls.Add(textBoxAddress);
|
||||
Controls.Add(textBoxEmail);
|
||||
Controls.Add(textBoxName);
|
||||
Controls.Add(label4);
|
||||
Controls.Add(textBoxPhone);
|
||||
Controls.Add(label3);
|
||||
Controls.Add(label2);
|
||||
Controls.Add(label1);
|
||||
Name = "FormPrintingHouse";
|
||||
StartPosition = FormStartPosition.CenterParent;
|
||||
Text = "Типография";
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Button buttonCancel;
|
||||
private Button buttonSave;
|
||||
private TextBox textBoxEmail;
|
||||
private TextBox textBoxPhone;
|
||||
private Label label2;
|
||||
private Label label1;
|
||||
private Label label3;
|
||||
private Label label4;
|
||||
private TextBox textBoxName;
|
||||
private TextBox textBoxAddress;
|
||||
}
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
using ProjectPublishing.Entities;
|
||||
using ProjectPublishing.Repositories;
|
||||
using ProjectPublishing.Repositories.Implementations;
|
||||
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 ProjectPublishing.Forms
|
||||
{
|
||||
public partial class FormPrintingHouse : Form
|
||||
{
|
||||
private readonly IPrintingHouseRepository _printingHouseRepository;
|
||||
private int? _printingHouseId;
|
||||
|
||||
public int Id
|
||||
{
|
||||
set
|
||||
{
|
||||
try
|
||||
{
|
||||
var printingHouse = _printingHouseRepository.ReadPrintingHouseById(value);
|
||||
if (printingHouse == null)
|
||||
{
|
||||
throw new InvalidDataException(nameof(printingHouse));
|
||||
}
|
||||
textBoxAddress.Text = printingHouse.Address;
|
||||
textBoxPhone.Text = printingHouse.PhoneNumber;
|
||||
textBoxEmail.Text = printingHouse.Email;
|
||||
textBoxName.Text = printingHouse.Name;
|
||||
_printingHouseId = value;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
public FormPrintingHouse(IPrintingHouseRepository printingHouseRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_printingHouseRepository = printingHouseRepository ?? throw new ArgumentException(nameof(printingHouseRepository));
|
||||
}
|
||||
|
||||
private void buttonSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(textBoxPhone.Text) || string.IsNullOrWhiteSpace(textBoxEmail.Text) || string.IsNullOrWhiteSpace(textBoxName.Text))
|
||||
{
|
||||
throw new Exception("Имеются незаполненные поля!");
|
||||
}
|
||||
|
||||
if (_printingHouseId.HasValue)
|
||||
{
|
||||
_printingHouseRepository.UpdatePrintingHouse(CreatePrintingHouse(_printingHouseId.Value));
|
||||
}
|
||||
else
|
||||
{
|
||||
_printingHouseRepository.UpdatePrintingHouse(CreatePrintingHouse(0));
|
||||
}
|
||||
Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonCancel_Click(object sender, EventArgs e) => Close();
|
||||
|
||||
private PrintingHouse CreatePrintingHouse(int id) => PrintingHouse.CreatePrintingHouse(id, textBoxName.Text, textBoxAddress.Text, textBoxPhone.Text, textBoxEmail.Text);
|
||||
}
|
||||
}
|
120
ProjectPublishing/ProjectPublishing/Forms/FormPrintingHouse.resx
Normal file
120
ProjectPublishing/ProjectPublishing/Forms/FormPrintingHouse.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
126
ProjectPublishing/ProjectPublishing/Forms/FormPrintingHouses.Designer.cs
generated
Normal file
126
ProjectPublishing/ProjectPublishing/Forms/FormPrintingHouses.Designer.cs
generated
Normal file
@ -0,0 +1,126 @@
|
||||
namespace ProjectPublishing.Forms
|
||||
{
|
||||
partial class FormPrintingHouses
|
||||
{
|
||||
/// <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(FormPrintingHouses));
|
||||
dataGridView = new DataGridView();
|
||||
panelButtons = new Panel();
|
||||
buttonRemove = new Button();
|
||||
buttonEdit = new Button();
|
||||
buttonAdd = new Button();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||
panelButtons.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// dataGridView
|
||||
//
|
||||
dataGridView.AllowUserToAddRows = false;
|
||||
dataGridView.AllowUserToDeleteRows = false;
|
||||
dataGridView.AllowUserToResizeColumns = false;
|
||||
dataGridView.AllowUserToResizeRows = false;
|
||||
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dataGridView.Dock = DockStyle.Fill;
|
||||
dataGridView.Location = new Point(0, 0);
|
||||
dataGridView.MultiSelect = false;
|
||||
dataGridView.Name = "dataGridView";
|
||||
dataGridView.ReadOnly = true;
|
||||
dataGridView.RowHeadersVisible = false;
|
||||
dataGridView.RowHeadersWidth = 51;
|
||||
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
dataGridView.Size = new Size(648, 450);
|
||||
dataGridView.TabIndex = 5;
|
||||
//
|
||||
// panelButtons
|
||||
//
|
||||
panelButtons.Controls.Add(buttonRemove);
|
||||
panelButtons.Controls.Add(buttonEdit);
|
||||
panelButtons.Controls.Add(buttonAdd);
|
||||
panelButtons.Dock = DockStyle.Right;
|
||||
panelButtons.Location = new Point(648, 0);
|
||||
panelButtons.Name = "panelButtons";
|
||||
panelButtons.Size = new Size(152, 450);
|
||||
panelButtons.TabIndex = 4;
|
||||
//
|
||||
// buttonRemove
|
||||
//
|
||||
buttonRemove.Image = (Image)resources.GetObject("buttonRemove.Image");
|
||||
buttonRemove.Location = new Point(23, 254);
|
||||
buttonRemove.Name = "buttonRemove";
|
||||
buttonRemove.Size = new Size(115, 115);
|
||||
buttonRemove.TabIndex = 2;
|
||||
buttonRemove.UseVisualStyleBackColor = true;
|
||||
buttonRemove.Click += buttonRemove_Click;
|
||||
//
|
||||
// buttonEdit
|
||||
//
|
||||
buttonEdit.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
buttonEdit.Image = (Image)resources.GetObject("buttonEdit.Image");
|
||||
buttonEdit.Location = new Point(23, 133);
|
||||
buttonEdit.Name = "buttonEdit";
|
||||
buttonEdit.Size = new Size(115, 115);
|
||||
buttonEdit.TabIndex = 1;
|
||||
buttonEdit.UseVisualStyleBackColor = true;
|
||||
buttonEdit.Click += buttonEdit_Click;
|
||||
//
|
||||
// buttonAdd
|
||||
//
|
||||
buttonAdd.BackgroundImageLayout = ImageLayout.Center;
|
||||
buttonAdd.Image = (Image)resources.GetObject("buttonAdd.Image");
|
||||
buttonAdd.Location = new Point(23, 12);
|
||||
buttonAdd.Name = "buttonAdd";
|
||||
buttonAdd.Size = new Size(115, 115);
|
||||
buttonAdd.TabIndex = 0;
|
||||
buttonAdd.UseVisualStyleBackColor = true;
|
||||
buttonAdd.Click += buttonAdd_Click;
|
||||
//
|
||||
// FormPrintingHouses
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(800, 450);
|
||||
Controls.Add(dataGridView);
|
||||
Controls.Add(panelButtons);
|
||||
Name = "FormPrintingHouses";
|
||||
StartPosition = FormStartPosition.CenterParent;
|
||||
Text = "Типографии";
|
||||
Load += FormPrintingHouses_Load;
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
panelButtons.ResumeLayout(false);
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private DataGridView dataGridView;
|
||||
private Panel panelButtons;
|
||||
private Button buttonRemove;
|
||||
private Button buttonEdit;
|
||||
private Button buttonAdd;
|
||||
}
|
||||
}
|
106
ProjectPublishing/ProjectPublishing/Forms/FormPrintingHouses.cs
Normal file
106
ProjectPublishing/ProjectPublishing/Forms/FormPrintingHouses.cs
Normal file
@ -0,0 +1,106 @@
|
||||
using ProjectPublishing.Repositories;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Unity;
|
||||
|
||||
namespace ProjectPublishing.Forms
|
||||
{
|
||||
public partial class FormPrintingHouses : Form
|
||||
{
|
||||
private readonly IUnityContainer _container;
|
||||
private readonly IPrintingHouseRepository _printingHouseRepository;
|
||||
public FormPrintingHouses(IUnityContainer container, IPrintingHouseRepository printingHouseRepository)
|
||||
{
|
||||
InitializeComponent();
|
||||
_container = container ?? throw new ArgumentException(nameof(container));
|
||||
_printingHouseRepository = printingHouseRepository ?? throw new ArgumentException(nameof(printingHouseRepository));
|
||||
}
|
||||
|
||||
private void buttonAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_container.Resolve<FormPrintingHouse>().ShowDialog();
|
||||
loadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!tryGetIDFromRow(out var findId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
var form = _container.Resolve<FormPrintingHouse>();
|
||||
form.Id = findId;
|
||||
form.ShowDialog();
|
||||
loadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonRemove_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!tryGetIDFromRow(out var findId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
_printingHouseRepository.DeletePrintingHouse(findId);
|
||||
loadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void FormPrintingHouses_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
loadList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void loadList() => dataGridView.DataSource = _printingHouseRepository.ReadPrintingHouses();
|
||||
|
||||
private bool tryGetIDFromRow(out int id)
|
||||
{
|
||||
id = 0;
|
||||
if (dataGridView.SelectedRows.Count < 1)
|
||||
{
|
||||
MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return false;
|
||||
}
|
||||
id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,233 @@
|
||||
<?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="buttonRemove.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
|
||||
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAB3RJTUUH6AcSDjMPELkl4AAACdZJREFU
|
||||
eF7tnUWsJUUUhh8Ed3d3h+CaQHBfsSH4gg0e3II7JDhhga5wHSDBQ3DXDcEXOAR3+79kXhiKc9871bf6
|
||||
3u7b50u+ZDLzprq7+nV3yalTY0EQBEEQBEHQi+nlsnJ7eZi8Uj4gn5Gvy3fl1/LXqfJn/o5/e1reL6+Q
|
||||
h0rKWEZSZjAkZpXbyLMkN+hn+XdhKfMpeabcWnLMoEaWlsfLx+Uv0ropdcoxH5PHyaVkUACemj3kvfIP
|
||||
aVX8MPxTPikPlHPKIJPV5PXyJ2lVcJP8UV4nV5XBJKwlb5RNelq98lTzptlABgnrS1qyVsW1zb/kFLmu
|
||||
7DzzyEtkG5/YyeSJ5m00v+wc08l95GfSqpxR8ktJY4xr7gR0d56QVmWMsnSxRr57tbtkFMmqgH79Tb4m
|
||||
b5UMTuw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||
</value>
|
||||
</data>
|
||||
<data name="buttonEdit.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||
vAAADrwBlbxySQAAA9dJREFUeF7tnS2QE0EQRuOQSCQSiUSeRCKRSCTy5LmTSOTJk0gkEolEIpHIs9Af
|
||||
VV0V0eSS7fnpSd6regJzlZrvY7IzO5vdAQAAAAAAAAAAAAAAAABAkivzxvxq/jL/mN/Ne/PafGrCGfLE
|
||||
vDUV+CFVitcmnBGvzB9mFPj/vDNVGlgc/W9+MKOQH/OLSQkWJhO+SwkWpUX4LiVYjJbhu5RgEXqE71KC
|
||||
4vQM36UERRkRvksJijEyfJcSFGFG+C4lmIz29WeF71KCiejGjW7kRMGM9JMJk6hSAs1GMIkKJfhp8lUw
|
||||
kQoleGvCRGaX4KMJHdBST/fzn//712FmlkArAmjM/jpf37OVS6DPBw2JNnkql0DnDKERh3b4qpaAa4BG
|
||||
HLO9W7EE70xowEvztxkN8r6VSqDTxM9MaMRqJWAPoAOrlEAPlUAnqpdAf0t/EzpStQSEn0RX+5/NY26i
|
||||
VCsB4SfZX+ode6iiSgkIP0m0zl+lBISf5NAmT/USEH6SY3b4qpaA8JMcE75brQSEn+SU8N0qJSD8JFvC
|
||||
d2eXgPCTZMJ3Z5aA8BO0CN+dVQLYSMvwXUqwCD3CdylBcXqG71KCoowI321dAt2QggQjw3dblYClXpIZ
|
||||
4bvZEhB+kpnhu1tLQPhJKoTvnloCwk9SKXz3lBIQfoKK4bvHlgA2Ujl8lxJ0YoXwXUrQmJXCdylBI1YM
|
||||
3+Vp3SQrh89SL8nK4esGD0/qJlg9fO7uJVg5fO3yEX6C1cPXLh9shPAvGMK/YFYOX59bL4WEjawevj4/
|
||||
bITwL5iVw5eEn0DfmSuHz48xJtD2qL8zf0UJP4nOv0cDu4LvTUigtXI0sCt4Y0ISvdkqGtzqEn4DdDJG
|
||||
O2bRAFeWAx2N0A8ZRwNc2TsTGqHzcdEgV5XwG6Kl30rrfpUVGqLlUzTQFeUkbwf0IqNosKtJ+B3Q9B8N
|
||||
djU5wduJD2Y04JUk/I58M6NBryLhd0SnY6NBryLHtztzbUYDX0HCH4Cm12jwZ0v4A3hhRoM/Wx7cGITu
|
||||
oEUBzJTj2wPRu/ajEGZJ+AOpdvCD8Adza0ZBzFA3oXhwYzBVDn1ydn8CV2YUxmgJfxIVzv3pO59pfwIV
|
||||
zv3pJA8/zTIJTblRKL3VdK/gudKfjEKIAuql7jTqSR3u5hVA0/+Ic39aYWiZqa1mKETPY98+xXNVX5h7
|
||||
Mwovo6Z4HShlii9Oy+lfU7yexmGKX4g3ZhTmKWoG0dcILMjWzR8dGGGKPwNOWf4xxZ8hjx391vWBpniu
|
||||
4s8UXQRGv/zBFH9hKGjdDZRM8QAAAAAAAAAAAAAAAAA12O3+AseEEu6imt+zAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="buttonAdd.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAABGdBTUEAALGPC/xhBQAACEJJREFUeF7t
|
||||
nWWoNVUUhq/d3d1id3djgigoiojgDxFFRPwjqD/8oSCIiolidyCIhd3d3Y3d3fE8l6vcb1j3nD33nn1q
|
||||
zwsP38e5M3Nmr3Vmx9pr7xkZEM0Km8DxcCe8Dz/D3/AX/DT22e1wLGwMntNoipoZdoSr4VPQ2P+0wWM+
|
||||
gSthB/AajSahZeFs+BYiQ6fwDXgNr9WohjaDxyAy6mR4HLaARgnaHt6AyJBT4U2wOmvUQja0r0NkwE6g
|
||||
Y326GgVaCh6CyHCd5GFYGhqN04xwKkQGy8Hp4Hc2GtPW8CVExsqB3+V3NkI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x1zcXK/nPqPGoOBxgqGM1Q
|
||||
LlW93rLMOFfRW5a5ad/LEBmnSg4HuC6i6E37mm0reyzjKL3euNUgY7Fqti7usZrNu3usZvv6HqvOCxzM
|
||||
3kuJtzt5dC1E16jiRJLtULGq0wtyWazR03ZybJE6ui7+FSbOiKWGo41cutVZOzltmpqf7xRp0S/xsb6u
|
||||
8xY9Q9etBk7mW6Y+UVL8a6zUYRAZZyKcIN8TjKRa34vViL/81DcySfMitzEZjaybe+RcrvMIrk9wbzbr
|
||||
fCfYo2MnonmV4ZjMjnAxRWSknNirypY6MmjyNebOTkWGyoFrIZp3zI+Tq3RM+IqMlQPXQth2NBont3ZM
|
||||
naCfCo4nih58tZI5OqnR0cng3MP60KiF3IsohxM0ftFZcHVkspRJs53YKtlrWO00v/yaMkx8GrhpdmTY
|
||||
FOzt2OA2df4kZe/IauMicOCUsqLfNQxGWM3Pd7lV09fvgBysubjtKLgBjPf4ZDj6FROsDEO4y/sR4B7/
|
||||
Oq/PNTLyL00LnOXokiBjAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
@ -1,3 +1,7 @@
|
||||
using ProjectPublishing.Repositories;
|
||||
using ProjectPublishing.Repositories.Implementations;
|
||||
using Unity;
|
||||
|
||||
namespace ProjectPublishing
|
||||
{
|
||||
internal static class Program
|
||||
@ -11,7 +15,21 @@ namespace ProjectPublishing
|
||||
// To customize application configuration such as set high DPI settings or default font,
|
||||
// see https://aka.ms/applicationconfiguration.
|
||||
ApplicationConfiguration.Initialize();
|
||||
Application.Run(new Form1());
|
||||
Application.Run(CreateContainer().Resolve<FormPublishing>());
|
||||
}
|
||||
|
||||
private static IUnityContainer CreateContainer()
|
||||
{
|
||||
var container = new UnityContainer();
|
||||
|
||||
container.RegisterType<IContactPersonRepository, ContactPersonRepository>();
|
||||
container.RegisterType<ICustomerRepository, CustomerRepository>();
|
||||
container.RegisterType<IMaterialRepository, MaterialRepository>();
|
||||
container.RegisterType<IMaterialAdmissionRepository, MaterialAdmissionRepository>();
|
||||
container.RegisterType<IOrderRepository, OrderRepository>();
|
||||
container.RegisterType<IPrintingHouseRepository, PrintingHouseRepository>();
|
||||
|
||||
return container;
|
||||
}
|
||||
}
|
||||
}
|
@ -8,4 +8,24 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Unity" Version="5.11.10" />
|
||||
<PackageReference Include="Unity.Container" Version="5.11.11" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
63
ProjectPublishing/ProjectPublishing/Properties/Resources.Designer.cs
generated
Normal file
63
ProjectPublishing/ProjectPublishing/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Этот код создан программой.
|
||||
// Исполняемая версия:4.0.30319.42000
|
||||
//
|
||||
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
|
||||
// повторной генерации кода.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ProjectPublishing.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("ProjectPublishing.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
using ProjectPublishing.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPublishing.Repositories
|
||||
{
|
||||
public interface IContactPersonRepository
|
||||
{
|
||||
IEnumerable<ContactPerson> ReadContactPeople();
|
||||
|
||||
ContactPerson ReadContactPersonById(int id);
|
||||
|
||||
void CreateContactPerson(ContactPerson contactPerson);
|
||||
|
||||
void UpdateContactPerson(ContactPerson contactPerson);
|
||||
|
||||
void DeleteContactPerson(int id);
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
using ProjectPublishing.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPublishing.Repositories
|
||||
{
|
||||
public interface ICustomerRepository
|
||||
{
|
||||
IEnumerable<Customer> ReadCustomers();
|
||||
|
||||
Customer ReadCustomerById(int id);
|
||||
|
||||
void CreateCustomer(Customer customer);
|
||||
|
||||
void UpdateCustomer(Customer customer);
|
||||
|
||||
void DeleteCustomer(int id);
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
using ProjectPublishing.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPublishing.Repositories
|
||||
{
|
||||
public interface IMaterialAdmissionRepository
|
||||
{
|
||||
IEnumerable<MaterialsAdmission> ReadMaterialsAdmission(int? amount = null, DateTime? date = null, int? materialId = null);
|
||||
|
||||
MaterialsAdmission ReadAdmissionById(int id);
|
||||
|
||||
void CreateMaterialsAdmission(MaterialsAdmission materialAdmission);
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
using ProjectPublishing.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPublishing.Repositories
|
||||
{
|
||||
public interface IMaterialRepository
|
||||
{
|
||||
IEnumerable<Material> ReadMaterials();
|
||||
|
||||
Material ReadMaterialById(int id);
|
||||
|
||||
void CreateMaterial(Material material);
|
||||
|
||||
void UpdateMaterial(Material material);
|
||||
|
||||
void DeleteMaterial(int id);
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
using ProjectPublishing.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPublishing.Repositories
|
||||
{
|
||||
public interface IOrderRepository
|
||||
{
|
||||
IEnumerable<Order> ReadOrders();
|
||||
|
||||
Order ReadOrderById(int id);
|
||||
|
||||
void CreateOrder(Order order);
|
||||
|
||||
void UpdateOrder(Order order);
|
||||
|
||||
void DeleteOrder(int id);
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
using ProjectPublishing.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPublishing.Repositories
|
||||
{
|
||||
public interface IPrintingHouseRepository
|
||||
{
|
||||
IEnumerable<PrintingHouse> ReadPrintingHouses();
|
||||
|
||||
PrintingHouse ReadPrintingHouseById(int id);
|
||||
|
||||
void CreatePrintingHouse(PrintingHouse printingHouse);
|
||||
|
||||
void UpdatePrintingHouse(PrintingHouse printingHouse);
|
||||
|
||||
void DeletePrintingHouse(int id);
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
using ProjectPublishing.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPublishing.Repositories.Implementations
|
||||
{
|
||||
public class ContactPersonRepository : IContactPersonRepository
|
||||
{
|
||||
public void CreateContactPerson(ContactPerson contactPerson)
|
||||
{
|
||||
}
|
||||
|
||||
public void DeleteContactPerson(int id)
|
||||
{
|
||||
}
|
||||
|
||||
public IEnumerable<ContactPerson> ReadContactPeople()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public ContactPerson ReadContactPersonById(int id)
|
||||
{
|
||||
return ContactPerson.CreateContactPerson(0, string.Empty, string.Empty, string.Empty);
|
||||
}
|
||||
|
||||
public void UpdateContactPerson(ContactPerson contactPerson)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
using ProjectPublishing.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPublishing.Repositories.Implementations
|
||||
{
|
||||
public class CustomerRepository : ICustomerRepository
|
||||
{
|
||||
public void CreateCustomer(Customer customer)
|
||||
{
|
||||
}
|
||||
|
||||
public void DeleteCustomer(int id)
|
||||
{
|
||||
}
|
||||
|
||||
public Customer ReadCustomerById(int id)
|
||||
{
|
||||
return Customer.CreateCustomer(0, string.Empty, string.Empty, 0);
|
||||
}
|
||||
|
||||
public IEnumerable<Customer> ReadCustomers()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public void UpdateCustomer(Customer customer)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
using ProjectPublishing.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPublishing.Repositories.Implementations
|
||||
{
|
||||
public class MaterialAdmissionRepository : IMaterialAdmissionRepository
|
||||
{
|
||||
public void CreateMaterialsAdmission(MaterialsAdmission materialAdmission)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public MaterialsAdmission ReadAdmissionById(int id)
|
||||
{
|
||||
return MaterialsAdmission.CreateOperation(0, 0, 0);
|
||||
}
|
||||
|
||||
public IEnumerable<MaterialsAdmission> ReadMaterialsAdmission(int? amount = null, DateTime? date = null, int? materialId = null)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
using ProjectPublishing.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPublishing.Repositories.Implementations
|
||||
{
|
||||
public class MaterialRepository : IMaterialRepository
|
||||
{
|
||||
public void CreateMaterial(Material material)
|
||||
{
|
||||
}
|
||||
|
||||
public void DeleteMaterial(int id)
|
||||
{
|
||||
}
|
||||
|
||||
public Material ReadMaterialById(int id)
|
||||
{
|
||||
return Material.CreateMaterial(0, Entities.Enums.MaterialType.Cardboard);
|
||||
}
|
||||
|
||||
public IEnumerable<Material> ReadMaterials()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public void UpdateMaterial(Material material)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
using ProjectPublishing.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPublishing.Repositories.Implementations
|
||||
{
|
||||
public class OrderRepository : IOrderRepository
|
||||
{
|
||||
public void CreateOrder(Order order)
|
||||
{
|
||||
}
|
||||
|
||||
public void DeleteOrder(int id)
|
||||
{
|
||||
}
|
||||
|
||||
public Order ReadOrderById(int id)
|
||||
{
|
||||
return Order.CreateOrder(0, string.Empty, Entities.Enums.ProductType.Advertisement, 0, Entities.Enums.OrderStatus.Done, 0, 0, 0);
|
||||
}
|
||||
|
||||
public IEnumerable<Order> ReadOrders()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public void UpdateOrder(Order order)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
using ProjectPublishing.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ProjectPublishing.Repositories.Implementations
|
||||
{
|
||||
public class PrintingHouseRepository : IPrintingHouseRepository
|
||||
{
|
||||
public void CreatePrintingHouse(PrintingHouse printingHouse)
|
||||
{
|
||||
}
|
||||
|
||||
public void DeletePrintingHouse(int id)
|
||||
{
|
||||
}
|
||||
|
||||
public PrintingHouse ReadPrintingHouseById(int id)
|
||||
{
|
||||
return PrintingHouse.CreatePrintingHouse(0, string.Empty, string.Empty, string.Empty, string.Empty);
|
||||
}
|
||||
|
||||
public IEnumerable<PrintingHouse> ReadPrintingHouses()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public void UpdatePrintingHouse(PrintingHouse printingHouse)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
BIN
ProjectPublishing/ProjectPublishing/Resources/edit.png
Normal file
BIN
ProjectPublishing/ProjectPublishing/Resources/edit.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
ProjectPublishing/ProjectPublishing/Resources/minus.png
Normal file
BIN
ProjectPublishing/ProjectPublishing/Resources/minus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
BIN
ProjectPublishing/ProjectPublishing/Resources/plus.png
Normal file
BIN
ProjectPublishing/ProjectPublishing/Resources/plus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
Loading…
x
Reference in New Issue
Block a user