Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
7e744cb8d9 | ||
|
8bded9e4bd | ||
|
02c015aa69 | ||
|
b409d201d5 | ||
|
33659c851e | ||
|
07c3c74aeb | ||
|
1460aa71c6 |
@ -0,0 +1,30 @@
|
|||||||
|
using ProjectCompanyFurniture.Entities.Enums;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Entities;
|
||||||
|
|
||||||
|
public class Client
|
||||||
|
{
|
||||||
|
public int ID { get; private set; }
|
||||||
|
|
||||||
|
public string Name { get; private set; }
|
||||||
|
|
||||||
|
public ClientType ClientType { get; private set; }
|
||||||
|
|
||||||
|
public bool Optovik { get; private set; }
|
||||||
|
|
||||||
|
public static Client CreateEntity(int id, string name, ClientType clientType, bool optovik)
|
||||||
|
{
|
||||||
|
return new Client
|
||||||
|
{
|
||||||
|
ID = id,
|
||||||
|
Name = name,
|
||||||
|
ClientType = clientType,
|
||||||
|
Optovik = optovik
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Entities.Enums;
|
||||||
|
|
||||||
|
public enum ClientType
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
/// <summary>
|
||||||
|
/// частное лицо
|
||||||
|
/// </summary>
|
||||||
|
PrivatePerson = 1,
|
||||||
|
/// <summary>
|
||||||
|
/// предприниматель
|
||||||
|
/// </summary>
|
||||||
|
Entrepreneur = 2,
|
||||||
|
/// <summary>
|
||||||
|
/// организация
|
||||||
|
/// </summary>
|
||||||
|
Organization = 3
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Entities.Enums;
|
||||||
|
|
||||||
|
|
||||||
|
[Flags]
|
||||||
|
public enum Movement
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
/// <summary>
|
||||||
|
/// проступление
|
||||||
|
/// </summary>
|
||||||
|
Reseipt = 1,
|
||||||
|
/// <summary>
|
||||||
|
/// продажа
|
||||||
|
/// </summary>
|
||||||
|
Sale = 2,
|
||||||
|
/// <summary>
|
||||||
|
/// перемещение на склад
|
||||||
|
/// </summary>
|
||||||
|
MovingToWarehouse = 4,
|
||||||
|
/// <summary>
|
||||||
|
/// подготовка к отправке
|
||||||
|
/// </summary>
|
||||||
|
PreparationForShipment = 8,
|
||||||
|
/// <summary>
|
||||||
|
/// перемещение в магазин
|
||||||
|
/// </summary>
|
||||||
|
MovingToStore = 16,
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Entities;
|
||||||
|
|
||||||
|
public class Invoice
|
||||||
|
{
|
||||||
|
public int ID { get; private set; }
|
||||||
|
|
||||||
|
public int ClientID { get; set; }
|
||||||
|
|
||||||
|
// 0 или 1
|
||||||
|
public int AvailabilityOfPromotionalCode { get; set; }
|
||||||
|
|
||||||
|
public int DiscountPercentage { get; set; }
|
||||||
|
|
||||||
|
public int SellingPrice { get; set; }
|
||||||
|
|
||||||
|
public DateTime Date { get; set; }
|
||||||
|
|
||||||
|
public IEnumerable<InvoiceProduct> Products
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
private set;
|
||||||
|
} = [];
|
||||||
|
|
||||||
|
public static Invoice CreateOperation(int id, int clientId, int availabilityOfPromotionalCode, int discountPercentage,
|
||||||
|
int sellingPrice, IEnumerable<InvoiceProduct> products)
|
||||||
|
{
|
||||||
|
return new Invoice
|
||||||
|
{
|
||||||
|
ID = id,
|
||||||
|
ClientID = clientId,
|
||||||
|
AvailabilityOfPromotionalCode = availabilityOfPromotionalCode,
|
||||||
|
DiscountPercentage = discountPercentage,
|
||||||
|
SellingPrice = sellingPrice,
|
||||||
|
Date = DateTime.Now,
|
||||||
|
Products = products
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture;
|
||||||
|
|
||||||
|
public class InvoiceProduct
|
||||||
|
{
|
||||||
|
public int InvoiceID { get; private set; }
|
||||||
|
|
||||||
|
public int ProductID { get; private set; }
|
||||||
|
|
||||||
|
public int Count { get; private set; }
|
||||||
|
|
||||||
|
public int SellingPrice { get; private set; }
|
||||||
|
|
||||||
|
public static InvoiceProduct CreateElement(int invoiceId, int productID, int count)
|
||||||
|
{
|
||||||
|
return new InvoiceProduct
|
||||||
|
{
|
||||||
|
InvoiceID = invoiceId,
|
||||||
|
ProductID = productID,
|
||||||
|
Count = count
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Entities;
|
||||||
|
|
||||||
|
public class Manufacturer
|
||||||
|
{
|
||||||
|
public int ID { get; set; }
|
||||||
|
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public static Manufacturer CreateEntity(int iD, string name)
|
||||||
|
{
|
||||||
|
return new Manufacturer
|
||||||
|
{
|
||||||
|
ID = iD,
|
||||||
|
Name = name
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Entities;
|
||||||
|
|
||||||
|
public class Product
|
||||||
|
{
|
||||||
|
public int ID { get; private set; }
|
||||||
|
|
||||||
|
public int ManufacturerID { get; private set; }
|
||||||
|
|
||||||
|
public string Name { get; private set; }
|
||||||
|
|
||||||
|
public string Category { get; private set; }
|
||||||
|
|
||||||
|
public int StartingPrice { get; private set; }
|
||||||
|
|
||||||
|
public static Product CreateEntity(int id, int manufacturerID, string name, string category, int startingPrice)
|
||||||
|
{
|
||||||
|
return new Product
|
||||||
|
{
|
||||||
|
|
||||||
|
ID = id,
|
||||||
|
ManufacturerID = manufacturerID,
|
||||||
|
Name = name,
|
||||||
|
Category = category,
|
||||||
|
StartingPrice = startingPrice
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
using ProjectCompanyFurniture.Entities.Enums;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Entities;
|
||||||
|
|
||||||
|
public class ProductMovement
|
||||||
|
{
|
||||||
|
public int ID { get; private set; }
|
||||||
|
|
||||||
|
public int ProductID { get; private set; }
|
||||||
|
|
||||||
|
public Movement MovementType { get; private set; }
|
||||||
|
|
||||||
|
public DateTime Date { get; private set; }
|
||||||
|
|
||||||
|
public static ProductMovement CreateOperation (int it, int productId, Movement movementType)
|
||||||
|
{
|
||||||
|
return new ProductMovement
|
||||||
|
{
|
||||||
|
ID = it,
|
||||||
|
ProductID = productId,
|
||||||
|
MovementType = movementType,
|
||||||
|
Date = DateTime.Now
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -1,39 +0,0 @@
|
|||||||
namespace ProjectCompanyFurniture
|
|
||||||
{
|
|
||||||
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 ProjectCompanyFurniture
|
|
||||||
{
|
|
||||||
public partial class Form1 : Form
|
|
||||||
{
|
|
||||||
public Form1()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
147
ProjectCompanyFurniture/ProjectCompanyFurniture/FormCompanyFurniture.Designer.cs
generated
Normal file
147
ProjectCompanyFurniture/ProjectCompanyFurniture/FormCompanyFurniture.Designer.cs
generated
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
namespace ProjectCompanyFurniture
|
||||||
|
{
|
||||||
|
partial class FormCompanyFurniture
|
||||||
|
{
|
||||||
|
/// <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()
|
||||||
|
{
|
||||||
|
components = new System.ComponentModel.Container();
|
||||||
|
menuStrip1 = new MenuStrip();
|
||||||
|
справочникиToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
productToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
manufacturerToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
clientToolStripMenuItem1 = new ToolStripMenuItem();
|
||||||
|
операцииToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
invoiceToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
productMovementToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
отчетыToolStripMenuItem = new ToolStripMenuItem();
|
||||||
|
contextMenuStrip1 = new ContextMenuStrip(components);
|
||||||
|
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(995, 28);
|
||||||
|
menuStrip1.TabIndex = 0;
|
||||||
|
menuStrip1.Text = "menuStrip1";
|
||||||
|
//
|
||||||
|
// справочникиToolStripMenuItem
|
||||||
|
//
|
||||||
|
справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { productToolStripMenuItem, manufacturerToolStripMenuItem, clientToolStripMenuItem1 });
|
||||||
|
справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem";
|
||||||
|
справочникиToolStripMenuItem.Size = new Size(117, 24);
|
||||||
|
справочникиToolStripMenuItem.Text = "Справочники";
|
||||||
|
//
|
||||||
|
// productToolStripMenuItem
|
||||||
|
//
|
||||||
|
productToolStripMenuItem.Name = "productToolStripMenuItem";
|
||||||
|
productToolStripMenuItem.Size = new Size(201, 26);
|
||||||
|
productToolStripMenuItem.Text = "Продукт";
|
||||||
|
productToolStripMenuItem.Click += ProductToolStripMenuItem_Click;
|
||||||
|
//
|
||||||
|
// manufacturerToolStripMenuItem
|
||||||
|
//
|
||||||
|
manufacturerToolStripMenuItem.Name = "manufacturerToolStripMenuItem";
|
||||||
|
manufacturerToolStripMenuItem.Size = new Size(201, 26);
|
||||||
|
manufacturerToolStripMenuItem.Text = "Производитель";
|
||||||
|
manufacturerToolStripMenuItem.Click += ManufacturerToolStripMenuItem_Click;
|
||||||
|
//
|
||||||
|
// clientToolStripMenuItem1
|
||||||
|
//
|
||||||
|
clientToolStripMenuItem1.Name = "clientToolStripMenuItem1";
|
||||||
|
clientToolStripMenuItem1.Size = new Size(201, 26);
|
||||||
|
clientToolStripMenuItem1.Text = "Клиент";
|
||||||
|
clientToolStripMenuItem1.Click += ClientToolStripMenuItem_Click;
|
||||||
|
//
|
||||||
|
// операцииToolStripMenuItem
|
||||||
|
//
|
||||||
|
операцииToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { invoiceToolStripMenuItem, productMovementToolStripMenuItem });
|
||||||
|
операцииToolStripMenuItem.Name = "операцииToolStripMenuItem";
|
||||||
|
операцииToolStripMenuItem.Size = new Size(95, 24);
|
||||||
|
операцииToolStripMenuItem.Text = "Операции";
|
||||||
|
//
|
||||||
|
// invoiceToolStripMenuItem
|
||||||
|
//
|
||||||
|
invoiceToolStripMenuItem.Name = "invoiceToolStripMenuItem";
|
||||||
|
invoiceToolStripMenuItem.Size = new Size(216, 26);
|
||||||
|
invoiceToolStripMenuItem.Text = "Накладная";
|
||||||
|
invoiceToolStripMenuItem.Click += InvoiceToolStripMenuItem_Click;
|
||||||
|
//
|
||||||
|
// productMovementToolStripMenuItem
|
||||||
|
//
|
||||||
|
productMovementToolStripMenuItem.Name = "productMovementToolStripMenuItem";
|
||||||
|
productMovementToolStripMenuItem.Size = new Size(216, 26);
|
||||||
|
productMovementToolStripMenuItem.Text = "Движение товара";
|
||||||
|
productMovementToolStripMenuItem.Click += ProductMovementToolStripMenuItem_Click;
|
||||||
|
//
|
||||||
|
// отчетыToolStripMenuItem
|
||||||
|
//
|
||||||
|
отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem";
|
||||||
|
отчетыToolStripMenuItem.Size = new Size(73, 24);
|
||||||
|
отчетыToolStripMenuItem.Text = "Отчеты";
|
||||||
|
//
|
||||||
|
// contextMenuStrip1
|
||||||
|
//
|
||||||
|
contextMenuStrip1.ImageScalingSize = new Size(20, 20);
|
||||||
|
contextMenuStrip1.Name = "contextMenuStrip1";
|
||||||
|
contextMenuStrip1.Size = new Size(61, 4);
|
||||||
|
//
|
||||||
|
// FormCompanyFurniture
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
BackgroundImage = Properties.Resources.mebel;
|
||||||
|
BackgroundImageLayout = ImageLayout.Stretch;
|
||||||
|
ClientSize = new Size(995, 553);
|
||||||
|
Controls.Add(menuStrip1);
|
||||||
|
MainMenuStrip = menuStrip1;
|
||||||
|
Name = "FormCompanyFurniture";
|
||||||
|
StartPosition = FormStartPosition.CenterScreen;
|
||||||
|
Text = "Фирма \"Мебель\"";
|
||||||
|
menuStrip1.ResumeLayout(false);
|
||||||
|
menuStrip1.PerformLayout();
|
||||||
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private MenuStrip menuStrip1;
|
||||||
|
private ToolStripMenuItem справочникиToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem productToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem операцииToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem отчетыToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem manufacturerToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem clientToolStripMenuItem1;
|
||||||
|
private ContextMenuStrip contextMenuStrip1;
|
||||||
|
private ToolStripMenuItem invoiceToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem productMovementToolStripMenuItem;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,86 @@
|
|||||||
|
using ProjectCompanyFurniture.Forms;
|
||||||
|
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 System.Xml.Linq;
|
||||||
|
using Unity;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture
|
||||||
|
{
|
||||||
|
public partial class FormCompanyFurniture : Form
|
||||||
|
{
|
||||||
|
private readonly IUnityContainer _container;
|
||||||
|
|
||||||
|
public FormCompanyFurniture(IUnityContainer container)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_container = container ?? throw new ArgumentNullException(nameof(container));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ProductToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_container.Resolve<FormProducts>().ShowDialog();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ClientToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_container.Resolve<FormClients>().ShowDialog();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ManufacturerToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_container.Resolve<FormManufacturers>().ShowDialog();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InvoiceToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_container.Resolve<FormInvoices>().ShowDialog();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ProductMovementToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_container.Resolve<FormProductMovements>().ShowDialog();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,126 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>17, 17</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>153, 17</value>
|
||||||
|
</metadata>
|
||||||
|
</root>
|
135
ProjectCompanyFurniture/ProjectCompanyFurniture/Forms/FormClient.Designer.cs
generated
Normal file
135
ProjectCompanyFurniture/ProjectCompanyFurniture/Forms/FormClient.Designer.cs
generated
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
namespace ProjectCompanyFurniture.Forms
|
||||||
|
{
|
||||||
|
partial class FormClient
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
labelName = new Label();
|
||||||
|
labelType = new Label();
|
||||||
|
textBoxName = new TextBox();
|
||||||
|
buttonSave = new Button();
|
||||||
|
buttonCancel = new Button();
|
||||||
|
comboBoxClientType = new ComboBox();
|
||||||
|
checkBoxOptYes = new CheckBox();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// labelName
|
||||||
|
//
|
||||||
|
labelName.AutoSize = true;
|
||||||
|
labelName.Location = new Point(38, 39);
|
||||||
|
labelName.Name = "labelName";
|
||||||
|
labelName.Size = new Size(45, 20);
|
||||||
|
labelName.TabIndex = 0;
|
||||||
|
labelName.Text = "ФИО:";
|
||||||
|
//
|
||||||
|
// labelType
|
||||||
|
//
|
||||||
|
labelType.AutoSize = true;
|
||||||
|
labelType.Location = new Point(38, 106);
|
||||||
|
labelType.Name = "labelType";
|
||||||
|
labelType.Size = new Size(97, 20);
|
||||||
|
labelType.TabIndex = 1;
|
||||||
|
labelType.Text = "Тип клиента:";
|
||||||
|
//
|
||||||
|
// textBoxName
|
||||||
|
//
|
||||||
|
textBoxName.Location = new Point(157, 36);
|
||||||
|
textBoxName.Name = "textBoxName";
|
||||||
|
textBoxName.Size = new Size(125, 27);
|
||||||
|
textBoxName.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// buttonSave
|
||||||
|
//
|
||||||
|
buttonSave.BackColor = Color.FromArgb(255, 224, 192);
|
||||||
|
buttonSave.Location = new Point(38, 255);
|
||||||
|
buttonSave.Name = "buttonSave";
|
||||||
|
buttonSave.Size = new Size(94, 29);
|
||||||
|
buttonSave.TabIndex = 6;
|
||||||
|
buttonSave.Text = "Сохранить";
|
||||||
|
buttonSave.UseVisualStyleBackColor = false;
|
||||||
|
buttonSave.Click += ButtonSave_Click;
|
||||||
|
//
|
||||||
|
// buttonCancel
|
||||||
|
//
|
||||||
|
buttonCancel.BackColor = Color.FromArgb(255, 224, 192);
|
||||||
|
buttonCancel.Location = new Point(188, 255);
|
||||||
|
buttonCancel.Name = "buttonCancel";
|
||||||
|
buttonCancel.Size = new Size(94, 29);
|
||||||
|
buttonCancel.TabIndex = 7;
|
||||||
|
buttonCancel.Text = "Отмена";
|
||||||
|
buttonCancel.UseVisualStyleBackColor = false;
|
||||||
|
buttonCancel.Click += ButtonCancel_Click;
|
||||||
|
//
|
||||||
|
// comboBoxClientType
|
||||||
|
//
|
||||||
|
comboBoxClientType.FormattingEnabled = true;
|
||||||
|
comboBoxClientType.Location = new Point(157, 106);
|
||||||
|
comboBoxClientType.Name = "comboBoxClientType";
|
||||||
|
comboBoxClientType.Size = new Size(125, 28);
|
||||||
|
comboBoxClientType.TabIndex = 10;
|
||||||
|
//
|
||||||
|
// checkBoxOptYes
|
||||||
|
//
|
||||||
|
checkBoxOptYes.AutoSize = true;
|
||||||
|
checkBoxOptYes.CheckAlign = ContentAlignment.MiddleRight;
|
||||||
|
checkBoxOptYes.Location = new Point(45, 185);
|
||||||
|
checkBoxOptYes.Name = "checkBoxOptYes";
|
||||||
|
checkBoxOptYes.Size = new Size(90, 24);
|
||||||
|
checkBoxOptYes.TabIndex = 12;
|
||||||
|
checkBoxOptYes.Text = "Оптивик";
|
||||||
|
checkBoxOptYes.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// FormClient
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(329, 324);
|
||||||
|
Controls.Add(checkBoxOptYes);
|
||||||
|
Controls.Add(comboBoxClientType);
|
||||||
|
Controls.Add(buttonCancel);
|
||||||
|
Controls.Add(buttonSave);
|
||||||
|
Controls.Add(textBoxName);
|
||||||
|
Controls.Add(labelType);
|
||||||
|
Controls.Add(labelName);
|
||||||
|
Name = "FormClient";
|
||||||
|
StartPosition = FormStartPosition.CenterScreen;
|
||||||
|
Text = "Клиент";
|
||||||
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private Label labelName;
|
||||||
|
private Label labelType;
|
||||||
|
private TextBox textBoxName;
|
||||||
|
private Button buttonSave;
|
||||||
|
private Button buttonCancel;
|
||||||
|
private ComboBox comboBoxClientType;
|
||||||
|
private CheckBox checkBoxOptYes;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,84 @@
|
|||||||
|
using ProjectCompanyFurniture.Entities;
|
||||||
|
using ProjectCompanyFurniture.Entities.Enums;
|
||||||
|
using ProjectCompanyFurniture.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 ProjectCompanyFurniture.Forms
|
||||||
|
{
|
||||||
|
public partial class FormClient : Form
|
||||||
|
{
|
||||||
|
private readonly IClientRepository _clientRepository;
|
||||||
|
private int? _clientId;
|
||||||
|
public int Id
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var client = _clientRepository.ReadClientById(value);
|
||||||
|
if (client == null)
|
||||||
|
{
|
||||||
|
throw new InvalidDataException(nameof(client));
|
||||||
|
}
|
||||||
|
textBoxName.Text = client.Name;
|
||||||
|
comboBoxClientType.SelectedItem = client.ClientType;
|
||||||
|
if (client.Optovik)
|
||||||
|
{
|
||||||
|
checkBoxOptYes.Checked = true;
|
||||||
|
}
|
||||||
|
_clientId = value;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public FormClient(IClientRepository clientRepository)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_clientRepository = clientRepository ?? throw new ArgumentNullException(nameof(clientRepository));
|
||||||
|
comboBoxClientType.DataSource = Enum.GetValues(typeof(ClientType));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonSave_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(textBoxName.Text) || comboBoxClientType.SelectedIndex < 1)
|
||||||
|
{
|
||||||
|
throw new Exception("Имеются незаполненные поля");
|
||||||
|
}
|
||||||
|
if (_clientId.HasValue)
|
||||||
|
{
|
||||||
|
_clientRepository.UpdateClient(CreateClient(_clientId.Value));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_clientRepository.CreateClient(CreateClient(0));
|
||||||
|
}
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при сохранении",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
|
||||||
|
|
||||||
|
private Client CreateClient(int id) => Client.CreateEntity(id, textBoxName.Text,
|
||||||
|
(ClientType)comboBoxClientType.SelectedItem!, checkBoxOptYes.Checked);
|
||||||
|
}
|
||||||
|
}
|
@ -1,17 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<root>
|
<root>
|
||||||
<!--
|
<!--
|
||||||
Microsoft ResX Schema
|
Microsoft ResX Schema
|
||||||
|
|
||||||
Version 2.0
|
Version 2.0
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
The primary goals of this format is to allow a simple XML format
|
||||||
that is mostly human readable. The generation and parsing of the
|
that is mostly human readable. The generation and parsing of the
|
||||||
various data types are done through the TypeConverter classes
|
various data types are done through the TypeConverter classes
|
||||||
associated with the data types.
|
associated with the data types.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
... ado.net/XML headers & schema ...
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
<resheader name="version">2.0</resheader>
|
<resheader name="version">2.0</resheader>
|
||||||
@ -26,36 +26,36 @@
|
|||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
<comment>This is a comment</comment>
|
<comment>This is a comment</comment>
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
There are any number of "resheader" rows that contain simple
|
||||||
name/value pairs.
|
name/value pairs.
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
Each data row contains a name, and value. The row also contains a
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
text/value conversion through the TypeConverter architecture.
|
text/value conversion through the TypeConverter architecture.
|
||||||
Classes that don't support this are serialized and stored with the
|
Classes that don't support this are serialized and stored with the
|
||||||
mimetype set.
|
mimetype set.
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
The mimetype is used for serialized objects, and tells the
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
read any of the formats listed below.
|
read any of the formats listed below.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
value : The object must be serialized with
|
value : The object must be serialized with
|
||||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
value : The object must be serialized with
|
value : The object must be serialized with
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
value : The object must be serialized into a byte array
|
value : The object must be serialized into a byte array
|
||||||
: using a System.ComponentModel.TypeConverter
|
: using a System.ComponentModel.TypeConverter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
-->
|
-->
|
128
ProjectCompanyFurniture/ProjectCompanyFurniture/Forms/FormClients.Designer.cs
generated
Normal file
128
ProjectCompanyFurniture/ProjectCompanyFurniture/Forms/FormClients.Designer.cs
generated
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
namespace ProjectCompanyFurniture.Forms
|
||||||
|
{
|
||||||
|
partial class FormClients
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
panel1 = new Panel();
|
||||||
|
buttonDel = new Button();
|
||||||
|
buttonEdt = new Button();
|
||||||
|
buttonAdd = new Button();
|
||||||
|
dataGridViewData = new DataGridView();
|
||||||
|
panel1.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dataGridViewData).BeginInit();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// panel1
|
||||||
|
//
|
||||||
|
panel1.Controls.Add(buttonDel);
|
||||||
|
panel1.Controls.Add(buttonEdt);
|
||||||
|
panel1.Controls.Add(buttonAdd);
|
||||||
|
panel1.Dock = DockStyle.Right;
|
||||||
|
panel1.Location = new Point(692, 0);
|
||||||
|
panel1.Name = "panel1";
|
||||||
|
panel1.Size = new Size(108, 450);
|
||||||
|
panel1.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// buttonDel
|
||||||
|
//
|
||||||
|
buttonDel.BackgroundImage = Properties.Resources.minus;
|
||||||
|
buttonDel.BackgroundImageLayout = ImageLayout.Stretch;
|
||||||
|
buttonDel.Location = new Point(8, 244);
|
||||||
|
buttonDel.Name = "buttonDel";
|
||||||
|
buttonDel.Size = new Size(94, 91);
|
||||||
|
buttonDel.TabIndex = 2;
|
||||||
|
buttonDel.UseVisualStyleBackColor = true;
|
||||||
|
buttonDel.Click += ButtonDel_Click;
|
||||||
|
//
|
||||||
|
// buttonEdt
|
||||||
|
//
|
||||||
|
buttonEdt.BackgroundImage = Properties.Resources.edit;
|
||||||
|
buttonEdt.BackgroundImageLayout = ImageLayout.Stretch;
|
||||||
|
buttonEdt.Location = new Point(8, 135);
|
||||||
|
buttonEdt.Name = "buttonEdt";
|
||||||
|
buttonEdt.Size = new Size(94, 90);
|
||||||
|
buttonEdt.TabIndex = 1;
|
||||||
|
buttonEdt.UseVisualStyleBackColor = true;
|
||||||
|
buttonEdt.Click += ButtonEdt_Click;
|
||||||
|
//
|
||||||
|
// buttonAdd
|
||||||
|
//
|
||||||
|
buttonAdd.BackgroundImage = Properties.Resources.plus;
|
||||||
|
buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
|
||||||
|
buttonAdd.Location = new Point(8, 26);
|
||||||
|
buttonAdd.Name = "buttonAdd";
|
||||||
|
buttonAdd.Size = new Size(94, 90);
|
||||||
|
buttonAdd.TabIndex = 0;
|
||||||
|
buttonAdd.UseVisualStyleBackColor = true;
|
||||||
|
buttonAdd.Click += ButtonAdd_Click;
|
||||||
|
//
|
||||||
|
// dataGridViewData
|
||||||
|
//
|
||||||
|
dataGridViewData.AllowUserToAddRows = false;
|
||||||
|
dataGridViewData.AllowUserToDeleteRows = false;
|
||||||
|
dataGridViewData.AllowUserToResizeColumns = false;
|
||||||
|
dataGridViewData.AllowUserToResizeRows = false;
|
||||||
|
dataGridViewData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||||
|
dataGridViewData.BackgroundColor = Color.FromArgb(255, 224, 192);
|
||||||
|
dataGridViewData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
|
dataGridViewData.Dock = DockStyle.Fill;
|
||||||
|
dataGridViewData.Location = new Point(0, 0);
|
||||||
|
dataGridViewData.MultiSelect = false;
|
||||||
|
dataGridViewData.Name = "dataGridViewData";
|
||||||
|
dataGridViewData.ReadOnly = true;
|
||||||
|
dataGridViewData.RowHeadersVisible = false;
|
||||||
|
dataGridViewData.RowHeadersWidth = 51;
|
||||||
|
dataGridViewData.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
|
dataGridViewData.Size = new Size(692, 450);
|
||||||
|
dataGridViewData.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// FormClients
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(800, 450);
|
||||||
|
Controls.Add(dataGridViewData);
|
||||||
|
Controls.Add(panel1);
|
||||||
|
Name = "FormClients";
|
||||||
|
StartPosition = FormStartPosition.CenterScreen;
|
||||||
|
Text = "Клиенты";
|
||||||
|
Load += FormClients_Load;
|
||||||
|
panel1.ResumeLayout(false);
|
||||||
|
((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit();
|
||||||
|
ResumeLayout(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private Panel panel1;
|
||||||
|
private Button buttonDel;
|
||||||
|
private Button buttonEdt;
|
||||||
|
private Button buttonAdd;
|
||||||
|
private DataGridView dataGridViewData;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,108 @@
|
|||||||
|
using ProjectCompanyFurniture.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 System.Xml.Linq;
|
||||||
|
using Unity;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Forms
|
||||||
|
{
|
||||||
|
public partial class FormClients : Form
|
||||||
|
{
|
||||||
|
private readonly IUnityContainer _container;
|
||||||
|
private readonly IClientRepository _clientRepository;
|
||||||
|
|
||||||
|
public FormClients(IUnityContainer container, IClientRepository clientRepository)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_container = container ?? throw new ArgumentNullException(nameof(container));
|
||||||
|
_clientRepository = clientRepository ?? throw new ArgumentNullException(nameof(clientRepository));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FormClients_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
LoadList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonAdd_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_container.Resolve<FormClient>().ShowDialog();
|
||||||
|
LoadList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonEdt_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var form = _container.Resolve<FormClient>();
|
||||||
|
form.Id = findId;
|
||||||
|
form.ShowDialog();
|
||||||
|
LoadList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonDel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_clientRepository.DeleteClient(findId);
|
||||||
|
LoadList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadList() => dataGridViewData.DataSource = _clientRepository.ReadClients();
|
||||||
|
private bool TryGetIdentifierFromSelectedRow(out int id)
|
||||||
|
{
|
||||||
|
id = 0;
|
||||||
|
if (dataGridViewData.SelectedRows.Count < 1)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
id = Convert.ToInt32(dataGridViewData.SelectedRows[0].Cells["Id"].Value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -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>
|
213
ProjectCompanyFurniture/ProjectCompanyFurniture/Forms/FormInvoice.Designer.cs
generated
Normal file
213
ProjectCompanyFurniture/ProjectCompanyFurniture/Forms/FormInvoice.Designer.cs
generated
Normal file
@ -0,0 +1,213 @@
|
|||||||
|
namespace ProjectCompanyFurniture.Forms
|
||||||
|
{
|
||||||
|
partial class FormInvoice
|
||||||
|
{
|
||||||
|
/// <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();
|
||||||
|
groupBoxProducts = new GroupBox();
|
||||||
|
dataGridViewProducts = new DataGridView();
|
||||||
|
ColumnProduct = new DataGridViewComboBoxColumn();
|
||||||
|
ColumnCount = new DataGridViewTextBoxColumn();
|
||||||
|
labelClientName = new Label();
|
||||||
|
label2 = new Label();
|
||||||
|
numericUpDownDiscPercentage = new NumericUpDown();
|
||||||
|
comboBoxClient = new ComboBox();
|
||||||
|
label3 = new Label();
|
||||||
|
numericUpDownSellingPrice = new NumericUpDown();
|
||||||
|
checkBoxPromYes = new CheckBox();
|
||||||
|
groupBoxProducts.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dataGridViewProducts).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDownDiscPercentage).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDownSellingPrice).BeginInit();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// buttonCancel
|
||||||
|
//
|
||||||
|
buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||||
|
buttonCancel.BackColor = Color.FromArgb(192, 255, 192);
|
||||||
|
buttonCancel.Location = new Point(270, 548);
|
||||||
|
buttonCancel.Name = "buttonCancel";
|
||||||
|
buttonCancel.Size = new Size(102, 29);
|
||||||
|
buttonCancel.TabIndex = 11;
|
||||||
|
buttonCancel.Text = "Отмена";
|
||||||
|
buttonCancel.UseVisualStyleBackColor = false;
|
||||||
|
buttonCancel.Click += ButtonCancel_Click;
|
||||||
|
//
|
||||||
|
// buttonSave
|
||||||
|
//
|
||||||
|
buttonSave.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||||
|
buttonSave.BackColor = Color.FromArgb(192, 255, 192);
|
||||||
|
buttonSave.Location = new Point(24, 548);
|
||||||
|
buttonSave.Name = "buttonSave";
|
||||||
|
buttonSave.Size = new Size(102, 29);
|
||||||
|
buttonSave.TabIndex = 12;
|
||||||
|
buttonSave.Text = "Сохранить";
|
||||||
|
buttonSave.UseVisualStyleBackColor = false;
|
||||||
|
buttonSave.Click += ButtonSave_Click;
|
||||||
|
//
|
||||||
|
// groupBoxProducts
|
||||||
|
//
|
||||||
|
groupBoxProducts.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
|
groupBoxProducts.Controls.Add(dataGridViewProducts);
|
||||||
|
groupBoxProducts.Location = new Point(24, 236);
|
||||||
|
groupBoxProducts.Name = "groupBoxProducts";
|
||||||
|
groupBoxProducts.Size = new Size(348, 291);
|
||||||
|
groupBoxProducts.TabIndex = 13;
|
||||||
|
groupBoxProducts.TabStop = false;
|
||||||
|
groupBoxProducts.Text = "Продукты";
|
||||||
|
//
|
||||||
|
// dataGridViewProducts
|
||||||
|
//
|
||||||
|
dataGridViewProducts.BackgroundColor = Color.FromArgb(192, 255, 192);
|
||||||
|
dataGridViewProducts.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
|
dataGridViewProducts.Columns.AddRange(new DataGridViewColumn[] { ColumnProduct, ColumnCount });
|
||||||
|
dataGridViewProducts.Dock = DockStyle.Fill;
|
||||||
|
dataGridViewProducts.Location = new Point(3, 23);
|
||||||
|
dataGridViewProducts.Name = "dataGridViewProducts";
|
||||||
|
dataGridViewProducts.RowHeadersWidth = 51;
|
||||||
|
dataGridViewProducts.Size = new Size(342, 265);
|
||||||
|
dataGridViewProducts.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// ColumnProduct
|
||||||
|
//
|
||||||
|
ColumnProduct.HeaderText = "Продукт";
|
||||||
|
ColumnProduct.MinimumWidth = 6;
|
||||||
|
ColumnProduct.Name = "ColumnProduct";
|
||||||
|
ColumnProduct.Width = 125;
|
||||||
|
//
|
||||||
|
// ColumnCount
|
||||||
|
//
|
||||||
|
ColumnCount.HeaderText = "Количество";
|
||||||
|
ColumnCount.MinimumWidth = 6;
|
||||||
|
ColumnCount.Name = "ColumnCount";
|
||||||
|
ColumnCount.Width = 125;
|
||||||
|
//
|
||||||
|
// labelClientName
|
||||||
|
//
|
||||||
|
labelClientName.AutoSize = true;
|
||||||
|
labelClientName.Location = new Point(27, 33);
|
||||||
|
labelClientName.Name = "labelClientName";
|
||||||
|
labelClientName.Size = new Size(104, 20);
|
||||||
|
labelClientName.TabIndex = 14;
|
||||||
|
labelClientName.Text = "ФИО клиента:";
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
label2.AutoSize = true;
|
||||||
|
label2.Location = new Point(27, 148);
|
||||||
|
label2.Name = "label2";
|
||||||
|
label2.Size = new Size(124, 20);
|
||||||
|
label2.TabIndex = 19;
|
||||||
|
label2.Text = "Процент скидки:";
|
||||||
|
//
|
||||||
|
// numericUpDownDiscPercentage
|
||||||
|
//
|
||||||
|
numericUpDownDiscPercentage.Location = new Point(213, 141);
|
||||||
|
numericUpDownDiscPercentage.Name = "numericUpDownDiscPercentage";
|
||||||
|
numericUpDownDiscPercentage.Size = new Size(150, 27);
|
||||||
|
numericUpDownDiscPercentage.TabIndex = 20;
|
||||||
|
//
|
||||||
|
// comboBoxClient
|
||||||
|
//
|
||||||
|
comboBoxClient.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
|
comboBoxClient.FormattingEnabled = true;
|
||||||
|
comboBoxClient.Location = new Point(212, 33);
|
||||||
|
comboBoxClient.Name = "comboBoxClient";
|
||||||
|
comboBoxClient.Size = new Size(151, 28);
|
||||||
|
comboBoxClient.TabIndex = 21;
|
||||||
|
//
|
||||||
|
// label3
|
||||||
|
//
|
||||||
|
label3.AutoSize = true;
|
||||||
|
label3.Location = new Point(27, 201);
|
||||||
|
label3.Name = "label3";
|
||||||
|
label3.Size = new Size(115, 20);
|
||||||
|
label3.TabIndex = 22;
|
||||||
|
label3.Text = "Итоговая цена:";
|
||||||
|
//
|
||||||
|
// numericUpDownSellingPrice
|
||||||
|
//
|
||||||
|
numericUpDownSellingPrice.Location = new Point(212, 194);
|
||||||
|
numericUpDownSellingPrice.Name = "numericUpDownSellingPrice";
|
||||||
|
numericUpDownSellingPrice.Size = new Size(151, 27);
|
||||||
|
numericUpDownSellingPrice.TabIndex = 23;
|
||||||
|
//
|
||||||
|
// checkBoxPromYes
|
||||||
|
//
|
||||||
|
checkBoxPromYes.AutoSize = true;
|
||||||
|
checkBoxPromYes.CheckAlign = ContentAlignment.MiddleRight;
|
||||||
|
checkBoxPromYes.Location = new Point(27, 94);
|
||||||
|
checkBoxPromYes.Name = "checkBoxPromYes";
|
||||||
|
checkBoxPromYes.Size = new Size(175, 24);
|
||||||
|
checkBoxPromYes.TabIndex = 24;
|
||||||
|
checkBoxPromYes.Text = "Наличие промокода";
|
||||||
|
checkBoxPromYes.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// FormInvoice
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(403, 589);
|
||||||
|
Controls.Add(checkBoxPromYes);
|
||||||
|
Controls.Add(numericUpDownSellingPrice);
|
||||||
|
Controls.Add(label3);
|
||||||
|
Controls.Add(comboBoxClient);
|
||||||
|
Controls.Add(numericUpDownDiscPercentage);
|
||||||
|
Controls.Add(label2);
|
||||||
|
Controls.Add(labelClientName);
|
||||||
|
Controls.Add(groupBoxProducts);
|
||||||
|
Controls.Add(buttonSave);
|
||||||
|
Controls.Add(buttonCancel);
|
||||||
|
Name = "FormInvoice";
|
||||||
|
StartPosition = FormStartPosition.CenterScreen;
|
||||||
|
Text = "Накладная";
|
||||||
|
groupBoxProducts.ResumeLayout(false);
|
||||||
|
((System.ComponentModel.ISupportInitialize)dataGridViewProducts).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDownDiscPercentage).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDownSellingPrice).EndInit();
|
||||||
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
private Button buttonCancel;
|
||||||
|
private Button buttonSave;
|
||||||
|
private GroupBox groupBoxProducts;
|
||||||
|
private DataGridView dataGridViewProducts;
|
||||||
|
private DataGridViewComboBoxColumn ColumnProduct;
|
||||||
|
private DataGridViewTextBoxColumn ColumnCount;
|
||||||
|
private Label label2;
|
||||||
|
private Label labelClientName;
|
||||||
|
private NumericUpDown numericUpDownDiscPercentage;
|
||||||
|
private ComboBox comboBoxClient;
|
||||||
|
private Label label3;
|
||||||
|
private NumericUpDown numericUpDownSellingPrice;
|
||||||
|
private CheckBox checkBoxPromYes;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,89 @@
|
|||||||
|
using ProjectCompanyFurniture.Entities;
|
||||||
|
using ProjectCompanyFurniture.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 ProjectCompanyFurniture.Forms
|
||||||
|
{
|
||||||
|
public partial class FormInvoice : Form
|
||||||
|
{
|
||||||
|
private readonly IInvoiceRepository _invoiceRepository;
|
||||||
|
|
||||||
|
public FormInvoice(IInvoiceRepository invoiceRepository, IClientRepository clientRepository,
|
||||||
|
IProductRepository productRepository)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_invoiceRepository = invoiceRepository ??
|
||||||
|
throw new ArgumentNullException(nameof(invoiceRepository));
|
||||||
|
|
||||||
|
comboBoxClient.DataSource = clientRepository.ReadClients();
|
||||||
|
comboBoxClient.DisplayMember = "Name";
|
||||||
|
comboBoxClient.ValueMember = "ID";
|
||||||
|
|
||||||
|
ColumnProduct.DataSource = productRepository.ReadProducts();
|
||||||
|
ColumnProduct.DisplayMember = "Name";
|
||||||
|
ColumnProduct.ValueMember = "ID";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonSave_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (dataGridViewProducts.RowCount < 1 || comboBoxClient.SelectedIndex < 0)
|
||||||
|
{
|
||||||
|
throw new Exception("Имеются незаполненные поля");
|
||||||
|
}
|
||||||
|
if (checkBoxPromYes.Checked && numericUpDownDiscPercentage.Value == 0)
|
||||||
|
{
|
||||||
|
throw new Exception("Не указан процент скидки");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (checkBoxPromYes.Checked)
|
||||||
|
{
|
||||||
|
_invoiceRepository.CreateInvoice(Invoice.CreateOperation(0,
|
||||||
|
(int)comboBoxClient.SelectedValue!, 1, Convert.ToInt32(numericUpDownDiscPercentage.Value),
|
||||||
|
Convert.ToInt32(numericUpDownSellingPrice.Value), CreateListInvoiceProductFromDataGrid()));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_invoiceRepository.CreateInvoice(Invoice.CreateOperation(0,
|
||||||
|
(int)comboBoxClient.SelectedValue!, 0, 0, Convert.ToInt32(numericUpDownSellingPrice.Value),
|
||||||
|
CreateListInvoiceProductFromDataGrid()));
|
||||||
|
}
|
||||||
|
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при сохранении",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
|
||||||
|
|
||||||
|
private List<InvoiceProduct> CreateListInvoiceProductFromDataGrid()
|
||||||
|
{
|
||||||
|
var list = new List<InvoiceProduct>();
|
||||||
|
foreach (DataGridViewRow row in dataGridViewProducts.Rows)
|
||||||
|
{
|
||||||
|
if (row.Cells["ColumnProduct"].Value == null ||
|
||||||
|
row.Cells["ColumnCount"].Value == null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
list.Add(InvoiceProduct.CreateElement(0, Convert.ToInt32(row.Cells["ColumnProduct"].Value),
|
||||||
|
Convert.ToInt32(row.Cells["ColumnCount"].Value)));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,126 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<metadata name="ColumnProduct.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="ColumnCount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
</root>
|
114
ProjectCompanyFurniture/ProjectCompanyFurniture/Forms/FormInvoices.Designer.cs
generated
Normal file
114
ProjectCompanyFurniture/ProjectCompanyFurniture/Forms/FormInvoices.Designer.cs
generated
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
namespace ProjectCompanyFurniture.Forms
|
||||||
|
{
|
||||||
|
partial class FormInvoices
|
||||||
|
{
|
||||||
|
/// <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()
|
||||||
|
{
|
||||||
|
dataGridViewData = new DataGridView();
|
||||||
|
panel1 = new Panel();
|
||||||
|
buttonDel = new Button();
|
||||||
|
buttonAdd = new Button();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dataGridViewData).BeginInit();
|
||||||
|
panel1.SuspendLayout();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// dataGridViewData
|
||||||
|
//
|
||||||
|
dataGridViewData.AllowUserToAddRows = false;
|
||||||
|
dataGridViewData.AllowUserToDeleteRows = false;
|
||||||
|
dataGridViewData.AllowUserToResizeColumns = false;
|
||||||
|
dataGridViewData.AllowUserToResizeRows = false;
|
||||||
|
dataGridViewData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||||
|
dataGridViewData.BackgroundColor = Color.FromArgb(192, 255, 192);
|
||||||
|
dataGridViewData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
|
dataGridViewData.Dock = DockStyle.Fill;
|
||||||
|
dataGridViewData.Location = new Point(0, 0);
|
||||||
|
dataGridViewData.MultiSelect = false;
|
||||||
|
dataGridViewData.Name = "dataGridViewData";
|
||||||
|
dataGridViewData.ReadOnly = true;
|
||||||
|
dataGridViewData.RowHeadersVisible = false;
|
||||||
|
dataGridViewData.RowHeadersWidth = 51;
|
||||||
|
dataGridViewData.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
|
dataGridViewData.Size = new Size(692, 450);
|
||||||
|
dataGridViewData.TabIndex = 5;
|
||||||
|
//
|
||||||
|
// panel1
|
||||||
|
//
|
||||||
|
panel1.Controls.Add(buttonDel);
|
||||||
|
panel1.Controls.Add(buttonAdd);
|
||||||
|
panel1.Dock = DockStyle.Right;
|
||||||
|
panel1.Location = new Point(692, 0);
|
||||||
|
panel1.Name = "panel1";
|
||||||
|
panel1.Size = new Size(108, 450);
|
||||||
|
panel1.TabIndex = 4;
|
||||||
|
//
|
||||||
|
// buttonDel
|
||||||
|
//
|
||||||
|
buttonDel.BackgroundImage = Properties.Resources.minus;
|
||||||
|
buttonDel.BackgroundImageLayout = ImageLayout.Stretch;
|
||||||
|
buttonDel.Location = new Point(8, 244);
|
||||||
|
buttonDel.Name = "buttonDel";
|
||||||
|
buttonDel.Size = new Size(94, 91);
|
||||||
|
buttonDel.TabIndex = 2;
|
||||||
|
buttonDel.UseVisualStyleBackColor = true;
|
||||||
|
buttonDel.Click += ButtonDel_Click;
|
||||||
|
//
|
||||||
|
// buttonAdd
|
||||||
|
//
|
||||||
|
buttonAdd.BackgroundImage = Properties.Resources.plus;
|
||||||
|
buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
|
||||||
|
buttonAdd.Location = new Point(8, 26);
|
||||||
|
buttonAdd.Name = "buttonAdd";
|
||||||
|
buttonAdd.Size = new Size(94, 90);
|
||||||
|
buttonAdd.TabIndex = 0;
|
||||||
|
buttonAdd.UseVisualStyleBackColor = true;
|
||||||
|
buttonAdd.Click += ButtonAdd_Click;
|
||||||
|
//
|
||||||
|
// FormInvoices
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(800, 450);
|
||||||
|
Controls.Add(dataGridViewData);
|
||||||
|
Controls.Add(panel1);
|
||||||
|
Name = "FormInvoices";
|
||||||
|
StartPosition = FormStartPosition.CenterScreen;
|
||||||
|
Text = "Накладные";
|
||||||
|
Load += FormInvoices_Load;
|
||||||
|
((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit();
|
||||||
|
panel1.ResumeLayout(false);
|
||||||
|
ResumeLayout(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private DataGridView dataGridViewData;
|
||||||
|
private Panel panel1;
|
||||||
|
private Button buttonDel;
|
||||||
|
private Button buttonAdd;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,88 @@
|
|||||||
|
using ProjectCompanyFurniture.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 ProjectCompanyFurniture.Forms
|
||||||
|
{
|
||||||
|
public partial class FormInvoices : Form
|
||||||
|
{
|
||||||
|
private readonly IUnityContainer _container;
|
||||||
|
private readonly IInvoiceRepository _invoiceRepository;
|
||||||
|
|
||||||
|
public FormInvoices(IUnityContainer container, IInvoiceRepository invoiceRepository)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_container = container ?? throw new ArgumentNullException(nameof(container));
|
||||||
|
_invoiceRepository = invoiceRepository ?? throw new ArgumentNullException(nameof(invoiceRepository));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FormInvoices_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
LoadList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonAdd_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_container.Resolve<FormInvoice>().ShowDialog();
|
||||||
|
LoadList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonDel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_invoiceRepository.DeleteInvoice(findId);
|
||||||
|
LoadList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadList() => dataGridViewData.DataSource = _invoiceRepository.ReadInvoices();
|
||||||
|
|
||||||
|
private bool TryGetIdentifierFromSelectedRow(out int id)
|
||||||
|
{
|
||||||
|
id = 0;
|
||||||
|
if (dataGridViewData.SelectedRows.Count < 1)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Нет выбранной записи", "Ошибка",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
id = Convert.ToInt32(dataGridViewData.SelectedRows[0].Cells["Id"].Value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -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
ProjectCompanyFurniture/ProjectCompanyFurniture/Forms/FormManufacturer.Designer.cs
generated
Normal file
98
ProjectCompanyFurniture/ProjectCompanyFurniture/Forms/FormManufacturer.Designer.cs
generated
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
namespace ProjectCompanyFurniture.Forms
|
||||||
|
{
|
||||||
|
partial class FormManufacturer
|
||||||
|
{
|
||||||
|
/// <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()
|
||||||
|
{
|
||||||
|
labelName = new Label();
|
||||||
|
textBoxName = new TextBox();
|
||||||
|
buttonSave = new Button();
|
||||||
|
buttonCancel = new Button();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// labelName
|
||||||
|
//
|
||||||
|
labelName.AutoSize = true;
|
||||||
|
labelName.Location = new Point(25, 28);
|
||||||
|
labelName.Name = "labelName";
|
||||||
|
labelName.Size = new Size(80, 20);
|
||||||
|
labelName.TabIndex = 0;
|
||||||
|
labelName.Text = "Название:";
|
||||||
|
//
|
||||||
|
// textBoxName
|
||||||
|
//
|
||||||
|
textBoxName.Location = new Point(166, 25);
|
||||||
|
textBoxName.Name = "textBoxName";
|
||||||
|
textBoxName.Size = new Size(125, 27);
|
||||||
|
textBoxName.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// buttonSave
|
||||||
|
//
|
||||||
|
buttonSave.BackColor = Color.FromArgb(192, 255, 255);
|
||||||
|
buttonSave.Location = new Point(25, 91);
|
||||||
|
buttonSave.Name = "buttonSave";
|
||||||
|
buttonSave.Size = new Size(94, 29);
|
||||||
|
buttonSave.TabIndex = 2;
|
||||||
|
buttonSave.Text = "Сохранить";
|
||||||
|
buttonSave.UseVisualStyleBackColor = false;
|
||||||
|
buttonSave.Click += ButtonSave_Click;
|
||||||
|
//
|
||||||
|
// buttonCancel
|
||||||
|
//
|
||||||
|
buttonCancel.BackColor = Color.FromArgb(192, 255, 255);
|
||||||
|
buttonCancel.Location = new Point(197, 91);
|
||||||
|
buttonCancel.Name = "buttonCancel";
|
||||||
|
buttonCancel.Size = new Size(94, 29);
|
||||||
|
buttonCancel.TabIndex = 3;
|
||||||
|
buttonCancel.Text = "Отмена";
|
||||||
|
buttonCancel.UseVisualStyleBackColor = false;
|
||||||
|
buttonCancel.Click += ButtonCancel_Click;
|
||||||
|
//
|
||||||
|
// FormManufacturer
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(318, 158);
|
||||||
|
Controls.Add(buttonCancel);
|
||||||
|
Controls.Add(buttonSave);
|
||||||
|
Controls.Add(textBoxName);
|
||||||
|
Controls.Add(labelName);
|
||||||
|
Name = "FormManufacturer";
|
||||||
|
StartPosition = FormStartPosition.CenterScreen;
|
||||||
|
Text = "Производитель";
|
||||||
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private Label labelName;
|
||||||
|
private TextBox textBoxName;
|
||||||
|
private Button buttonSave;
|
||||||
|
private Button buttonCancel;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
using ProjectCompanyFurniture.Entities;
|
||||||
|
using ProjectCompanyFurniture.Repositories;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Forms;
|
||||||
|
|
||||||
|
public partial class FormManufacturer : Form
|
||||||
|
{
|
||||||
|
private readonly IManufacturerRepository _manufacturerRepository;
|
||||||
|
private int? _manufacturerId;
|
||||||
|
|
||||||
|
public int Id
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var manufacturer = _manufacturerRepository.ReadManufacturerById(value);
|
||||||
|
if (manufacturer == null)
|
||||||
|
{
|
||||||
|
throw new
|
||||||
|
InvalidDataException(nameof(manufacturer));
|
||||||
|
}
|
||||||
|
textBoxName.Text = manufacturer.Name;
|
||||||
|
_manufacturerId = value;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public FormManufacturer(IManufacturerRepository manufacturerRepository)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_manufacturerRepository = manufacturerRepository ?? throw new ArgumentNullException(nameof(manufacturerRepository));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonSave_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(textBoxName.Text))
|
||||||
|
{
|
||||||
|
throw new Exception("Имеются незаполненные поля");
|
||||||
|
}
|
||||||
|
if (_manufacturerId.HasValue)
|
||||||
|
{
|
||||||
|
_manufacturerRepository.UpdateManufacturer(CreateManufacturer(_manufacturerId.Value));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_manufacturerRepository.CreateManufacturer(CreateManufacturer(0));
|
||||||
|
}
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при сохранении",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
|
||||||
|
|
||||||
|
private Manufacturer CreateManufacturer(int id) => Manufacturer.CreateEntity(id, textBoxName.Text);
|
||||||
|
}
|
@ -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
ProjectCompanyFurniture/ProjectCompanyFurniture/Forms/FormManufacturers.Designer.cs
generated
Normal file
126
ProjectCompanyFurniture/ProjectCompanyFurniture/Forms/FormManufacturers.Designer.cs
generated
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
namespace ProjectCompanyFurniture.Forms
|
||||||
|
{
|
||||||
|
partial class FormManufacturers
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
panel1 = new Panel();
|
||||||
|
buttonDel = new Button();
|
||||||
|
buttonEdt = new Button();
|
||||||
|
buttonAdd = new Button();
|
||||||
|
dataGridViewData = new DataGridView();
|
||||||
|
panel1.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dataGridViewData).BeginInit();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// panel1
|
||||||
|
//
|
||||||
|
panel1.Controls.Add(buttonDel);
|
||||||
|
panel1.Controls.Add(buttonEdt);
|
||||||
|
panel1.Controls.Add(buttonAdd);
|
||||||
|
panel1.Dock = DockStyle.Right;
|
||||||
|
panel1.Location = new Point(680, 0);
|
||||||
|
panel1.Name = "panel1";
|
||||||
|
panel1.Size = new Size(120, 450);
|
||||||
|
panel1.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// buttonDel
|
||||||
|
//
|
||||||
|
buttonDel.BackgroundImage = Properties.Resources.minus;
|
||||||
|
buttonDel.BackgroundImageLayout = ImageLayout.Stretch;
|
||||||
|
buttonDel.Location = new Point(14, 258);
|
||||||
|
buttonDel.Name = "buttonDel";
|
||||||
|
buttonDel.Size = new Size(94, 91);
|
||||||
|
buttonDel.TabIndex = 3;
|
||||||
|
buttonDel.UseVisualStyleBackColor = true;
|
||||||
|
buttonDel.Click += ButtonDel_Click;
|
||||||
|
//
|
||||||
|
// buttonEdt
|
||||||
|
//
|
||||||
|
buttonEdt.BackgroundImage = Properties.Resources.edit;
|
||||||
|
buttonEdt.BackgroundImageLayout = ImageLayout.Stretch;
|
||||||
|
buttonEdt.Location = new Point(14, 143);
|
||||||
|
buttonEdt.Name = "buttonEdt";
|
||||||
|
buttonEdt.Size = new Size(94, 90);
|
||||||
|
buttonEdt.TabIndex = 2;
|
||||||
|
buttonEdt.UseVisualStyleBackColor = true;
|
||||||
|
buttonEdt.Click += ButtonEdt_Click;
|
||||||
|
//
|
||||||
|
// buttonAdd
|
||||||
|
//
|
||||||
|
buttonAdd.BackgroundImage = Properties.Resources.plus;
|
||||||
|
buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
|
||||||
|
buttonAdd.Location = new Point(14, 28);
|
||||||
|
buttonAdd.Name = "buttonAdd";
|
||||||
|
buttonAdd.Size = new Size(94, 90);
|
||||||
|
buttonAdd.TabIndex = 1;
|
||||||
|
buttonAdd.UseVisualStyleBackColor = true;
|
||||||
|
buttonAdd.Click += ButtonAdd_Click;
|
||||||
|
//
|
||||||
|
// dataGridViewData
|
||||||
|
//
|
||||||
|
dataGridViewData.AllowUserToAddRows = false;
|
||||||
|
dataGridViewData.AllowUserToDeleteRows = false;
|
||||||
|
dataGridViewData.AllowUserToResizeColumns = false;
|
||||||
|
dataGridViewData.AllowUserToResizeRows = false;
|
||||||
|
dataGridViewData.BackgroundColor = Color.FromArgb(192, 255, 255);
|
||||||
|
dataGridViewData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
|
dataGridViewData.Dock = DockStyle.Fill;
|
||||||
|
dataGridViewData.Location = new Point(0, 0);
|
||||||
|
dataGridViewData.Name = "dataGridViewData";
|
||||||
|
dataGridViewData.ReadOnly = true;
|
||||||
|
dataGridViewData.RowHeadersVisible = false;
|
||||||
|
dataGridViewData.RowHeadersWidth = 51;
|
||||||
|
dataGridViewData.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
|
dataGridViewData.Size = new Size(680, 450);
|
||||||
|
dataGridViewData.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// FormManufacturers
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(800, 450);
|
||||||
|
Controls.Add(dataGridViewData);
|
||||||
|
Controls.Add(panel1);
|
||||||
|
Name = "FormManufacturers";
|
||||||
|
StartPosition = FormStartPosition.CenterScreen;
|
||||||
|
Text = "Производители";
|
||||||
|
Load += FormManufacturers_Load;
|
||||||
|
panel1.ResumeLayout(false);
|
||||||
|
((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit();
|
||||||
|
ResumeLayout(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private Panel panel1;
|
||||||
|
private Button buttonAdd;
|
||||||
|
private Button buttonEdt;
|
||||||
|
private Button buttonDel;
|
||||||
|
private DataGridView dataGridViewData;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,96 @@
|
|||||||
|
using ProjectCompanyFurniture.Repositories;
|
||||||
|
using Unity;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Forms
|
||||||
|
{
|
||||||
|
public partial class FormManufacturers : Form
|
||||||
|
{
|
||||||
|
private readonly IUnityContainer _container;
|
||||||
|
private readonly IManufacturerRepository _manufacturerRepository;
|
||||||
|
|
||||||
|
public FormManufacturers(IUnityContainer container, IManufacturerRepository manufacturerRepository)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_container = container ?? throw new ArgumentNullException(nameof(container));
|
||||||
|
_manufacturerRepository = manufacturerRepository ?? throw new ArgumentNullException(nameof(manufacturerRepository));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FormManufacturers_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
LoadList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonAdd_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_container.Resolve<FormManufacturer>().ShowDialog();
|
||||||
|
LoadList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonEdt_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var form = _container.Resolve<FormClient>();
|
||||||
|
form.Id = findId;
|
||||||
|
form.ShowDialog();
|
||||||
|
LoadList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonDel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_manufacturerRepository.DeleteManufacturer(findId);
|
||||||
|
LoadList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadList() => dataGridViewData.DataSource = _manufacturerRepository.ReadManufacturers();
|
||||||
|
private bool TryGetIdentifierFromSelectedRow(out int id)
|
||||||
|
{
|
||||||
|
id = 0;
|
||||||
|
if (dataGridViewData.SelectedRows.Count < 1)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
id = Convert.ToInt32(dataGridViewData.SelectedRows[0].Cells["Id"].Value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -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>
|
168
ProjectCompanyFurniture/ProjectCompanyFurniture/Forms/FormProduct.Designer.cs
generated
Normal file
168
ProjectCompanyFurniture/ProjectCompanyFurniture/Forms/FormProduct.Designer.cs
generated
Normal file
@ -0,0 +1,168 @@
|
|||||||
|
namespace ProjectCompanyFurniture.Forms
|
||||||
|
{
|
||||||
|
partial class FormProduct
|
||||||
|
{
|
||||||
|
/// <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()
|
||||||
|
{
|
||||||
|
labelName = new Label();
|
||||||
|
labelCategory = new Label();
|
||||||
|
labelStartPrice = new Label();
|
||||||
|
textBoxName = new TextBox();
|
||||||
|
textBoxCategory = new TextBox();
|
||||||
|
numericUpDownStartPrice = new NumericUpDown();
|
||||||
|
buttonSave = new Button();
|
||||||
|
buttonCancel = new Button();
|
||||||
|
labelIDManuf = new Label();
|
||||||
|
comboBoxManufacturer = new ComboBox();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDownStartPrice).BeginInit();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// labelName
|
||||||
|
//
|
||||||
|
labelName.AutoSize = true;
|
||||||
|
labelName.Location = new Point(35, 94);
|
||||||
|
labelName.Name = "labelName";
|
||||||
|
labelName.Size = new Size(80, 20);
|
||||||
|
labelName.TabIndex = 0;
|
||||||
|
labelName.Text = "Название:";
|
||||||
|
//
|
||||||
|
// labelCategory
|
||||||
|
//
|
||||||
|
labelCategory.AutoSize = true;
|
||||||
|
labelCategory.Location = new Point(35, 161);
|
||||||
|
labelCategory.Name = "labelCategory";
|
||||||
|
labelCategory.Size = new Size(84, 20);
|
||||||
|
labelCategory.TabIndex = 1;
|
||||||
|
labelCategory.Text = "Категория:";
|
||||||
|
//
|
||||||
|
// labelStartPrice
|
||||||
|
//
|
||||||
|
labelStartPrice.AutoSize = true;
|
||||||
|
labelStartPrice.Location = new Point(35, 222);
|
||||||
|
labelStartPrice.Name = "labelStartPrice";
|
||||||
|
labelStartPrice.Size = new Size(126, 20);
|
||||||
|
labelStartPrice.TabIndex = 2;
|
||||||
|
labelStartPrice.Text = "Начальная цена:";
|
||||||
|
//
|
||||||
|
// textBoxName
|
||||||
|
//
|
||||||
|
textBoxName.Location = new Point(211, 91);
|
||||||
|
textBoxName.Name = "textBoxName";
|
||||||
|
textBoxName.Size = new Size(125, 27);
|
||||||
|
textBoxName.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// textBoxCategory
|
||||||
|
//
|
||||||
|
textBoxCategory.Location = new Point(211, 158);
|
||||||
|
textBoxCategory.Name = "textBoxCategory";
|
||||||
|
textBoxCategory.Size = new Size(125, 27);
|
||||||
|
textBoxCategory.TabIndex = 4;
|
||||||
|
//
|
||||||
|
// numericUpDownStartPrice
|
||||||
|
//
|
||||||
|
numericUpDownStartPrice.Location = new Point(211, 220);
|
||||||
|
numericUpDownStartPrice.Name = "numericUpDownStartPrice";
|
||||||
|
numericUpDownStartPrice.Size = new Size(125, 27);
|
||||||
|
numericUpDownStartPrice.TabIndex = 5;
|
||||||
|
//
|
||||||
|
// buttonSave
|
||||||
|
//
|
||||||
|
buttonSave.BackColor = Color.FromArgb(255, 192, 255);
|
||||||
|
buttonSave.Location = new Point(33, 307);
|
||||||
|
buttonSave.Name = "buttonSave";
|
||||||
|
buttonSave.Size = new Size(125, 29);
|
||||||
|
buttonSave.TabIndex = 6;
|
||||||
|
buttonSave.Text = "Сохранить";
|
||||||
|
buttonSave.UseVisualStyleBackColor = false;
|
||||||
|
buttonSave.Click += ButtonSave_Click;
|
||||||
|
//
|
||||||
|
// buttonCancel
|
||||||
|
//
|
||||||
|
buttonCancel.BackColor = Color.FromArgb(255, 192, 255);
|
||||||
|
buttonCancel.Location = new Point(211, 307);
|
||||||
|
buttonCancel.Name = "buttonCancel";
|
||||||
|
buttonCancel.Size = new Size(125, 29);
|
||||||
|
buttonCancel.TabIndex = 7;
|
||||||
|
buttonCancel.Text = "Отмена";
|
||||||
|
buttonCancel.UseVisualStyleBackColor = false;
|
||||||
|
buttonCancel.Click += ButtonCancel_Click;
|
||||||
|
//
|
||||||
|
// labelIDManuf
|
||||||
|
//
|
||||||
|
labelIDManuf.AutoSize = true;
|
||||||
|
labelIDManuf.Location = new Point(35, 31);
|
||||||
|
labelIDManuf.Name = "labelIDManuf";
|
||||||
|
labelIDManuf.Size = new Size(121, 20);
|
||||||
|
labelIDManuf.TabIndex = 8;
|
||||||
|
labelIDManuf.Text = "Производитель:";
|
||||||
|
//
|
||||||
|
// comboBoxManufacturer
|
||||||
|
//
|
||||||
|
comboBoxManufacturer.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
|
comboBoxManufacturer.FormattingEnabled = true;
|
||||||
|
comboBoxManufacturer.Location = new Point(211, 31);
|
||||||
|
comboBoxManufacturer.Name = "comboBoxManufacturer";
|
||||||
|
comboBoxManufacturer.Size = new Size(125, 28);
|
||||||
|
comboBoxManufacturer.TabIndex = 9;
|
||||||
|
//
|
||||||
|
// FormProduct
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(363, 394);
|
||||||
|
Controls.Add(comboBoxManufacturer);
|
||||||
|
Controls.Add(labelIDManuf);
|
||||||
|
Controls.Add(buttonCancel);
|
||||||
|
Controls.Add(buttonSave);
|
||||||
|
Controls.Add(numericUpDownStartPrice);
|
||||||
|
Controls.Add(textBoxCategory);
|
||||||
|
Controls.Add(textBoxName);
|
||||||
|
Controls.Add(labelStartPrice);
|
||||||
|
Controls.Add(labelCategory);
|
||||||
|
Controls.Add(labelName);
|
||||||
|
Name = "FormProduct";
|
||||||
|
StartPosition = FormStartPosition.CenterScreen;
|
||||||
|
Text = "Продукт";
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDownStartPrice).EndInit();
|
||||||
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private Label labelName;
|
||||||
|
private Label labelCategory;
|
||||||
|
private Label labelStartPrice;
|
||||||
|
private TextBox textBoxName;
|
||||||
|
private TextBox textBoxCategory;
|
||||||
|
private NumericUpDown numericUpDownStartPrice;
|
||||||
|
private Button buttonSave;
|
||||||
|
private Button buttonCancel;
|
||||||
|
private Label labelIDManuf;
|
||||||
|
private ComboBox comboBoxManufacturer;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,80 @@
|
|||||||
|
using ProjectCompanyFurniture.Entities.Enums;
|
||||||
|
using ProjectCompanyFurniture.Entities;
|
||||||
|
using ProjectCompanyFurniture.Repositories;
|
||||||
|
using ProjectCompanyFurniture.Repositories.Implementations;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Forms
|
||||||
|
{
|
||||||
|
public partial class FormProduct : Form
|
||||||
|
{
|
||||||
|
|
||||||
|
private readonly IProductRepository _productRepository;
|
||||||
|
private int? _productId;
|
||||||
|
|
||||||
|
public int Id
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var product = _productRepository.ReadProductById(value);
|
||||||
|
if (product == null)
|
||||||
|
{
|
||||||
|
throw new InvalidDataException(nameof(product));
|
||||||
|
}
|
||||||
|
comboBoxManufacturer.SelectedValue = product.ManufacturerID;
|
||||||
|
textBoxName.Text = product.Name;
|
||||||
|
textBoxCategory.Text = product.Category;
|
||||||
|
numericUpDownStartPrice.Value = product.StartingPrice;
|
||||||
|
_productId = value;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public FormProduct(IProductRepository productRepository, IManufacturerRepository manufacturerRepository)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_productRepository = productRepository ?? throw new ArgumentNullException(nameof(productRepository));
|
||||||
|
|
||||||
|
comboBoxManufacturer.DataSource = manufacturerRepository.ReadManufacturers();
|
||||||
|
comboBoxManufacturer.DisplayMember = "FirstName";
|
||||||
|
comboBoxManufacturer.ValueMember = "Id";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonSave_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(textBoxName.Text) || string.IsNullOrEmpty(textBoxCategory.Text)
|
||||||
|
|| comboBoxManufacturer.SelectedIndex < 0)
|
||||||
|
{
|
||||||
|
throw new Exception("Имеются незаполненные поля");
|
||||||
|
}
|
||||||
|
if (_productId.HasValue)
|
||||||
|
{
|
||||||
|
_productRepository.UpdateProduct(CreateProduct(_productId.Value));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_productRepository.CreateProduct(CreateProduct(0));
|
||||||
|
}
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при сохранении",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
|
||||||
|
|
||||||
|
private Product CreateProduct(int id) => Product.CreateEntity(id, Convert.ToInt32((int)comboBoxManufacturer.SelectedValue!),
|
||||||
|
textBoxName.Text, textBoxCategory.Text, Convert.ToInt32(numericUpDownStartPrice.Value));
|
||||||
|
}
|
||||||
|
}
|
@ -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>
|
125
ProjectCompanyFurniture/ProjectCompanyFurniture/Forms/FormProductMovement.Designer.cs
generated
Normal file
125
ProjectCompanyFurniture/ProjectCompanyFurniture/Forms/FormProductMovement.Designer.cs
generated
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
namespace ProjectCompanyFurniture.Forms
|
||||||
|
{
|
||||||
|
partial class FormProductMovement
|
||||||
|
{
|
||||||
|
/// <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()
|
||||||
|
{
|
||||||
|
labelProductID = new Label();
|
||||||
|
labelMovement = new Label();
|
||||||
|
buttonCancel = new Button();
|
||||||
|
buttonSave = new Button();
|
||||||
|
checkedListBoxMovement = new CheckedListBox();
|
||||||
|
comboBoxProduct = new ComboBox();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// labelProductID
|
||||||
|
//
|
||||||
|
labelProductID.AutoSize = true;
|
||||||
|
labelProductID.Location = new Point(31, 28);
|
||||||
|
labelProductID.Name = "labelProductID";
|
||||||
|
labelProductID.Size = new Size(69, 20);
|
||||||
|
labelProductID.TabIndex = 0;
|
||||||
|
labelProductID.Text = "Продукт:";
|
||||||
|
//
|
||||||
|
// labelMovement
|
||||||
|
//
|
||||||
|
labelMovement.AutoSize = true;
|
||||||
|
labelMovement.Location = new Point(31, 71);
|
||||||
|
labelMovement.Name = "labelMovement";
|
||||||
|
labelMovement.Size = new Size(112, 20);
|
||||||
|
labelMovement.TabIndex = 1;
|
||||||
|
labelMovement.Text = "Тип движения:";
|
||||||
|
//
|
||||||
|
// buttonCancel
|
||||||
|
//
|
||||||
|
buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||||
|
buttonCancel.BackColor = Color.FromArgb(255, 192, 192);
|
||||||
|
buttonCancel.Location = new Point(286, 232);
|
||||||
|
buttonCancel.Name = "buttonCancel";
|
||||||
|
buttonCancel.Size = new Size(162, 29);
|
||||||
|
buttonCancel.TabIndex = 6;
|
||||||
|
buttonCancel.Text = "Отмена";
|
||||||
|
buttonCancel.UseVisualStyleBackColor = false;
|
||||||
|
buttonCancel.Click += ButtonCancel_Click;
|
||||||
|
//
|
||||||
|
// buttonSave
|
||||||
|
//
|
||||||
|
buttonSave.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||||
|
buttonSave.BackColor = Color.FromArgb(255, 192, 192);
|
||||||
|
buttonSave.Location = new Point(31, 232);
|
||||||
|
buttonSave.Name = "buttonSave";
|
||||||
|
buttonSave.Size = new Size(162, 29);
|
||||||
|
buttonSave.TabIndex = 7;
|
||||||
|
buttonSave.Text = "Сохранить";
|
||||||
|
buttonSave.UseVisualStyleBackColor = false;
|
||||||
|
buttonSave.Click += ButtonSave_Click;
|
||||||
|
//
|
||||||
|
// checkedListBoxMovement
|
||||||
|
//
|
||||||
|
checkedListBoxMovement.FormattingEnabled = true;
|
||||||
|
checkedListBoxMovement.Location = new Point(267, 71);
|
||||||
|
checkedListBoxMovement.Name = "checkedListBoxMovement";
|
||||||
|
checkedListBoxMovement.Size = new Size(181, 136);
|
||||||
|
checkedListBoxMovement.TabIndex = 8;
|
||||||
|
//
|
||||||
|
// comboBoxProduct
|
||||||
|
//
|
||||||
|
comboBoxProduct.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
|
comboBoxProduct.FormattingEnabled = true;
|
||||||
|
comboBoxProduct.Location = new Point(267, 28);
|
||||||
|
comboBoxProduct.Name = "comboBoxProduct";
|
||||||
|
comboBoxProduct.Size = new Size(181, 28);
|
||||||
|
comboBoxProduct.TabIndex = 9;
|
||||||
|
//
|
||||||
|
// FormProductMovement
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(485, 290);
|
||||||
|
Controls.Add(comboBoxProduct);
|
||||||
|
Controls.Add(checkedListBoxMovement);
|
||||||
|
Controls.Add(buttonSave);
|
||||||
|
Controls.Add(buttonCancel);
|
||||||
|
Controls.Add(labelMovement);
|
||||||
|
Controls.Add(labelProductID);
|
||||||
|
Name = "FormProductMovement";
|
||||||
|
StartPosition = FormStartPosition.CenterScreen;
|
||||||
|
Text = "Движение товара";
|
||||||
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private Label labelProductID;
|
||||||
|
private Label labelMovement;
|
||||||
|
private Button buttonCancel;
|
||||||
|
private Button buttonSave;
|
||||||
|
private CheckedListBox checkedListBoxMovement;
|
||||||
|
private ComboBox comboBoxProduct;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
using Microsoft.VisualBasic.FileIO;
|
||||||
|
using ProjectCompanyFurniture.Entities;
|
||||||
|
using ProjectCompanyFurniture.Entities.Enums;
|
||||||
|
using ProjectCompanyFurniture.Repositories;
|
||||||
|
using ProjectCompanyFurniture.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 ProjectCompanyFurniture.Forms
|
||||||
|
{
|
||||||
|
public partial class FormProductMovement : Form
|
||||||
|
{
|
||||||
|
private readonly IProductMovementRepository _productMovementRepository;
|
||||||
|
private int? _productMovementId;
|
||||||
|
|
||||||
|
public FormProductMovement(IProductMovementRepository productMovementRepository,
|
||||||
|
IProductRepository productRepository)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_productMovementRepository = productMovementRepository ?? throw new ArgumentNullException(nameof(productMovementRepository));
|
||||||
|
|
||||||
|
comboBoxProduct.DataSource = productRepository.ReadProducts();
|
||||||
|
comboBoxProduct.DisplayMember = "Name";
|
||||||
|
comboBoxProduct.ValueMember = "ID";
|
||||||
|
|
||||||
|
foreach (var elem in Enum.GetValues(typeof(Movement)))
|
||||||
|
{
|
||||||
|
checkedListBoxMovement.Items.Add(elem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonSave_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (comboBoxProduct.SelectedIndex < 0 || checkedListBoxMovement.CheckedItems.Count == 0)
|
||||||
|
{
|
||||||
|
throw new Exception("Имеются незаполненные поля");
|
||||||
|
}
|
||||||
|
Movement movement = Movement.None;
|
||||||
|
foreach (var elem in checkedListBoxMovement.CheckedItems)
|
||||||
|
{
|
||||||
|
movement |= (Movement)elem;
|
||||||
|
}
|
||||||
|
_productMovementRepository.CreateProductMovement(ProductMovement.CreateOperation(0,
|
||||||
|
(int)comboBoxProduct.SelectedValue!, movement));
|
||||||
|
|
||||||
|
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>
|
97
ProjectCompanyFurniture/ProjectCompanyFurniture/Forms/FormProductMovements.Designer.cs
generated
Normal file
97
ProjectCompanyFurniture/ProjectCompanyFurniture/Forms/FormProductMovements.Designer.cs
generated
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
namespace ProjectCompanyFurniture.Forms
|
||||||
|
{
|
||||||
|
partial class FormProductMovements
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
panel1 = new Panel();
|
||||||
|
buttonAdd = new Button();
|
||||||
|
dataGridViewData = new DataGridView();
|
||||||
|
panel1.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dataGridViewData).BeginInit();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// panel1
|
||||||
|
//
|
||||||
|
panel1.Controls.Add(buttonAdd);
|
||||||
|
panel1.Dock = DockStyle.Right;
|
||||||
|
panel1.Location = new Point(674, 0);
|
||||||
|
panel1.Name = "panel1";
|
||||||
|
panel1.Size = new Size(126, 450);
|
||||||
|
panel1.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// buttonAdd
|
||||||
|
//
|
||||||
|
buttonAdd.BackgroundImage = Properties.Resources.plus;
|
||||||
|
buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
|
||||||
|
buttonAdd.Location = new Point(15, 27);
|
||||||
|
buttonAdd.Name = "buttonAdd";
|
||||||
|
buttonAdd.Size = new Size(94, 90);
|
||||||
|
buttonAdd.TabIndex = 3;
|
||||||
|
buttonAdd.UseVisualStyleBackColor = true;
|
||||||
|
buttonAdd.Click += ButtonAdd_Click;
|
||||||
|
//
|
||||||
|
// dataGridViewData
|
||||||
|
//
|
||||||
|
dataGridViewData.AllowUserToResizeColumns = false;
|
||||||
|
dataGridViewData.AllowUserToResizeRows = false;
|
||||||
|
dataGridViewData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||||
|
dataGridViewData.BackgroundColor = Color.FromArgb(255, 192, 192);
|
||||||
|
dataGridViewData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
|
dataGridViewData.Dock = DockStyle.Fill;
|
||||||
|
dataGridViewData.Location = new Point(0, 0);
|
||||||
|
dataGridViewData.MultiSelect = false;
|
||||||
|
dataGridViewData.Name = "dataGridViewData";
|
||||||
|
dataGridViewData.RowHeadersVisible = false;
|
||||||
|
dataGridViewData.RowHeadersWidth = 51;
|
||||||
|
dataGridViewData.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
|
dataGridViewData.Size = new Size(674, 450);
|
||||||
|
dataGridViewData.TabIndex = 2;
|
||||||
|
//
|
||||||
|
// FormProductMovements
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(800, 450);
|
||||||
|
Controls.Add(dataGridViewData);
|
||||||
|
Controls.Add(panel1);
|
||||||
|
Name = "FormProductMovements";
|
||||||
|
StartPosition = FormStartPosition.CenterScreen;
|
||||||
|
Text = "Движения продуктов";
|
||||||
|
Load += FormProductMovements_Load;
|
||||||
|
panel1.ResumeLayout(false);
|
||||||
|
((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit();
|
||||||
|
ResumeLayout(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private Panel panel1;
|
||||||
|
private Button buttonAdd;
|
||||||
|
private DataGridView dataGridViewData;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
using ProjectCompanyFurniture.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 ProjectCompanyFurniture.Forms
|
||||||
|
{
|
||||||
|
public partial class FormProductMovements : Form
|
||||||
|
{
|
||||||
|
private readonly IUnityContainer _container;
|
||||||
|
private readonly IProductMovementRepository _productMovementRepository;
|
||||||
|
public FormProductMovements(IUnityContainer container, IProductMovementRepository productMovementRepository)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_container = container ?? throw new ArgumentNullException(nameof(container)); ;
|
||||||
|
_productMovementRepository = productMovementRepository ??
|
||||||
|
throw new ArgumentNullException(nameof(productMovementRepository));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FormProductMovements_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
LoadList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при загрузке",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonAdd_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_container.Resolve<FormProductMovement>().ShowDialog();
|
||||||
|
LoadList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadList() => dataGridViewData.DataSource = _productMovementRepository.ReadProductMovements();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -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>
|
128
ProjectCompanyFurniture/ProjectCompanyFurniture/Forms/FormProducts.Designer.cs
generated
Normal file
128
ProjectCompanyFurniture/ProjectCompanyFurniture/Forms/FormProducts.Designer.cs
generated
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
namespace ProjectCompanyFurniture.Forms
|
||||||
|
{
|
||||||
|
partial class FormProducts
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
panel1 = new Panel();
|
||||||
|
buttonDel = new Button();
|
||||||
|
buttonEdt = new Button();
|
||||||
|
buttonAdd = new Button();
|
||||||
|
dataGridViewData = new DataGridView();
|
||||||
|
panel1.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)dataGridViewData).BeginInit();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// panel1
|
||||||
|
//
|
||||||
|
panel1.Controls.Add(buttonDel);
|
||||||
|
panel1.Controls.Add(buttonEdt);
|
||||||
|
panel1.Controls.Add(buttonAdd);
|
||||||
|
panel1.Dock = DockStyle.Right;
|
||||||
|
panel1.Location = new Point(674, 0);
|
||||||
|
panel1.Name = "panel1";
|
||||||
|
panel1.Size = new Size(126, 450);
|
||||||
|
panel1.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// buttonDel
|
||||||
|
//
|
||||||
|
buttonDel.BackgroundImage = Properties.Resources.minus;
|
||||||
|
buttonDel.BackgroundImageLayout = ImageLayout.Stretch;
|
||||||
|
buttonDel.Location = new Point(15, 245);
|
||||||
|
buttonDel.Name = "buttonDel";
|
||||||
|
buttonDel.Size = new Size(94, 91);
|
||||||
|
buttonDel.TabIndex = 5;
|
||||||
|
buttonDel.UseVisualStyleBackColor = true;
|
||||||
|
buttonDel.Click += ButtonDel_Click;
|
||||||
|
//
|
||||||
|
// buttonEdt
|
||||||
|
//
|
||||||
|
buttonEdt.BackgroundImage = Properties.Resources.edit;
|
||||||
|
buttonEdt.BackgroundImageLayout = ImageLayout.Stretch;
|
||||||
|
buttonEdt.Location = new Point(15, 136);
|
||||||
|
buttonEdt.Name = "buttonEdt";
|
||||||
|
buttonEdt.Size = new Size(94, 90);
|
||||||
|
buttonEdt.TabIndex = 4;
|
||||||
|
buttonEdt.UseVisualStyleBackColor = true;
|
||||||
|
buttonEdt.Click += ButtonEdt_Click;
|
||||||
|
//
|
||||||
|
// buttonAdd
|
||||||
|
//
|
||||||
|
buttonAdd.BackgroundImage = Properties.Resources.plus;
|
||||||
|
buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
|
||||||
|
buttonAdd.Location = new Point(15, 27);
|
||||||
|
buttonAdd.Name = "buttonAdd";
|
||||||
|
buttonAdd.Size = new Size(94, 90);
|
||||||
|
buttonAdd.TabIndex = 3;
|
||||||
|
buttonAdd.UseVisualStyleBackColor = true;
|
||||||
|
buttonAdd.Click += ButtonAdd_Click;
|
||||||
|
//
|
||||||
|
// dataGridViewData
|
||||||
|
//
|
||||||
|
dataGridViewData.AllowUserToAddRows = false;
|
||||||
|
dataGridViewData.AllowUserToDeleteRows = false;
|
||||||
|
dataGridViewData.AllowUserToResizeColumns = false;
|
||||||
|
dataGridViewData.AllowUserToResizeRows = false;
|
||||||
|
dataGridViewData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||||
|
dataGridViewData.BackgroundColor = Color.FromArgb(255, 192, 255);
|
||||||
|
dataGridViewData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
|
dataGridViewData.Dock = DockStyle.Fill;
|
||||||
|
dataGridViewData.Location = new Point(0, 0);
|
||||||
|
dataGridViewData.MultiSelect = false;
|
||||||
|
dataGridViewData.Name = "dataGridViewData";
|
||||||
|
dataGridViewData.ReadOnly = true;
|
||||||
|
dataGridViewData.RowHeadersVisible = false;
|
||||||
|
dataGridViewData.RowHeadersWidth = 51;
|
||||||
|
dataGridViewData.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
|
dataGridViewData.Size = new Size(674, 450);
|
||||||
|
dataGridViewData.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// FormProducts
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(800, 450);
|
||||||
|
Controls.Add(dataGridViewData);
|
||||||
|
Controls.Add(panel1);
|
||||||
|
Name = "FormProducts";
|
||||||
|
StartPosition = FormStartPosition.CenterScreen;
|
||||||
|
Text = "Продукты";
|
||||||
|
Load += FormProducts_Load;
|
||||||
|
panel1.ResumeLayout(false);
|
||||||
|
((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit();
|
||||||
|
ResumeLayout(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private Panel panel1;
|
||||||
|
private Button buttonDel;
|
||||||
|
private Button buttonEdt;
|
||||||
|
private Button buttonAdd;
|
||||||
|
private DataGridView dataGridViewData;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,107 @@
|
|||||||
|
using ProjectCompanyFurniture.Repositories;
|
||||||
|
using ProjectCompanyFurniture.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;
|
||||||
|
using Unity;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Forms
|
||||||
|
{
|
||||||
|
public partial class FormProducts : Form
|
||||||
|
{
|
||||||
|
private readonly IUnityContainer _container;
|
||||||
|
private readonly IProductRepository _productRepository;
|
||||||
|
|
||||||
|
public FormProducts(IUnityContainer container, IProductRepository productRepository)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_container = container ?? throw new ArgumentNullException(nameof(container));
|
||||||
|
_productRepository = productRepository ?? throw new ArgumentNullException(nameof(productRepository));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FormProducts_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
LoadList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonAdd_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_container.Resolve<FormProduct>().ShowDialog();
|
||||||
|
LoadList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonEdt_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var form = _container.Resolve<FormProduct>();
|
||||||
|
form.Id = findId;
|
||||||
|
form.ShowDialog();
|
||||||
|
LoadList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonDel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!TryGetIdentifierFromSelectedRow(out var findId))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_productRepository.DeleteProduct(findId);
|
||||||
|
LoadList();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadList() => dataGridViewData.DataSource = _productRepository.ReadProducts();
|
||||||
|
private bool TryGetIdentifierFromSelectedRow(out int id)
|
||||||
|
{
|
||||||
|
id = 0;
|
||||||
|
if (dataGridViewData.SelectedRows.Count < 1)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
id = Convert.ToInt32(dataGridViewData.SelectedRows[0].Cells["Id"].Value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
@ -1,3 +1,8 @@
|
|||||||
|
using ProjectCompanyFurniture.Repositories;
|
||||||
|
using ProjectCompanyFurniture.Repositories.Implementations;
|
||||||
|
using Unity;
|
||||||
|
using Unity.Lifetime;
|
||||||
|
|
||||||
namespace ProjectCompanyFurniture
|
namespace ProjectCompanyFurniture
|
||||||
{
|
{
|
||||||
internal static class Program
|
internal static class Program
|
||||||
@ -11,7 +16,18 @@ namespace ProjectCompanyFurniture
|
|||||||
// To customize application configuration such as set high DPI settings or default font,
|
// To customize application configuration such as set high DPI settings or default font,
|
||||||
// see https://aka.ms/applicationconfiguration.
|
// see https://aka.ms/applicationconfiguration.
|
||||||
ApplicationConfiguration.Initialize();
|
ApplicationConfiguration.Initialize();
|
||||||
Application.Run(new Form1());
|
Application.Run(CreateContainer().Resolve<FormCompanyFurniture>());
|
||||||
|
}
|
||||||
|
|
||||||
|
private static IUnityContainer CreateContainer()
|
||||||
|
{
|
||||||
|
var container = new UnityContainer();
|
||||||
|
container.RegisterType<IClientRepository, ClientRepository>(new TransientLifetimeManager());
|
||||||
|
container.RegisterType<IInvoiceRepository, InvoiceRepository>(new TransientLifetimeManager());
|
||||||
|
container.RegisterType<IManufacturerRepository, ManufacturerRepository>(new TransientLifetimeManager());
|
||||||
|
container.RegisterType<IProductMovementRepository, ProductMovementRepository>(new TransientLifetimeManager());
|
||||||
|
container.RegisterType<IProductRepository, ProductRepository>(new TransientLifetimeManager());
|
||||||
|
return container;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -8,4 +8,36 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</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>
|
||||||
|
<Compile Update="Properties\Settings.Designer.cs">
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Update="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Update="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
103
ProjectCompanyFurniture/ProjectCompanyFurniture/Properties/Resources.Designer.cs
generated
Normal file
103
ProjectCompanyFurniture/ProjectCompanyFurniture/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// Этот код создан программой.
|
||||||
|
// Исполняемая версия:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
|
||||||
|
// повторной генерации кода.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.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("ProjectCompanyFurniture.Properties.Resources", typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Перезаписывает свойство CurrentUICulture текущего потока для всех
|
||||||
|
/// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
|
get {
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap edit {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("edit", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap mebel {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("mebel", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap minus {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("minus", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap plus {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("plus", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,133 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
|
<data name="mebel" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\mebel.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="plus" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\plus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="edit" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\edit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="minus" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\minus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
26
ProjectCompanyFurniture/ProjectCompanyFurniture/Properties/Settings.Designer.cs
generated
Normal file
26
ProjectCompanyFurniture/ProjectCompanyFurniture/Properties/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// Этот код создан программой.
|
||||||
|
// Исполняемая версия:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
|
||||||
|
// повторной генерации кода.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Properties {
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.11.0.0")]
|
||||||
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
|
public static Settings Default {
|
||||||
|
get {
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||||
|
<Profiles>
|
||||||
|
<Profile Name="(Default)" />
|
||||||
|
</Profiles>
|
||||||
|
</SettingsFile>
|
@ -0,0 +1,17 @@
|
|||||||
|
using ProjectCompanyFurniture.Entities;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Repositories;
|
||||||
|
|
||||||
|
public interface IClientRepository
|
||||||
|
{
|
||||||
|
IEnumerable<Client> ReadClients();
|
||||||
|
Client ReadClientById(int id);
|
||||||
|
void CreateClient(Client client);
|
||||||
|
void UpdateClient(Client client);
|
||||||
|
void DeleteClient(int id);
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
using ProjectCompanyFurniture.Entities;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Repositories;
|
||||||
|
|
||||||
|
public interface IInvoiceRepository
|
||||||
|
{
|
||||||
|
IEnumerable<Invoice> ReadInvoices (DateTime? dateForm = null, DateTime? dateTo = null, int? clientId = null);
|
||||||
|
void CreateInvoice(Invoice invoice);
|
||||||
|
void DeleteInvoice(int id);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
using ProjectCompanyFurniture.Entities;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Repositories;
|
||||||
|
|
||||||
|
public interface IManufacturerRepository
|
||||||
|
{
|
||||||
|
IEnumerable<Manufacturer> ReadManufacturers();
|
||||||
|
Manufacturer ReadManufacturerById(int id);
|
||||||
|
void CreateManufacturer(Manufacturer manufacturer);
|
||||||
|
void UpdateManufacturer(Manufacturer manufacturer);
|
||||||
|
void DeleteManufacturer(int id);
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
using ProjectCompanyFurniture.Entities;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Repositories;
|
||||||
|
|
||||||
|
public interface IProductMovementRepository
|
||||||
|
{
|
||||||
|
IEnumerable<ProductMovement> ReadProductMovements(DateTime? dateForm = null, DateTime? dateTo = null, int? clientId = null);
|
||||||
|
void CreateProductMovement(ProductMovement productMovement);
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
using ProjectCompanyFurniture.Entities;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Repositories;
|
||||||
|
|
||||||
|
public interface IProductRepository
|
||||||
|
{
|
||||||
|
IEnumerable<Product> ReadProducts();
|
||||||
|
Product ReadProductById(int id);
|
||||||
|
void CreateProduct(Product product);
|
||||||
|
void UpdateProduct(Product product);
|
||||||
|
void DeleteProduct(int id);
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
using ProjectCompanyFurniture.Entities;
|
||||||
|
using ProjectCompanyFurniture.Entities.Enums;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Repositories.Implementations;
|
||||||
|
|
||||||
|
public class ClientRepository : IClientRepository
|
||||||
|
{
|
||||||
|
public void CreateClient(Client client)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DeleteClient(int id)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<Client> ReadClient()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public Client ReadClientById(int id)
|
||||||
|
{
|
||||||
|
return Client.CreateEntity(0, string.Empty, ClientType.None, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<Client> ReadClients()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateClient(Client client)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
using ProjectCompanyFurniture.Entities;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Repositories.Implementations;
|
||||||
|
|
||||||
|
public class InvoiceRepository : IInvoiceRepository
|
||||||
|
{
|
||||||
|
public void CreateInvoice(Invoice invoice)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DeleteInvoice(int id)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<Invoice> ReadInvoices(DateTime? dateForm = null, DateTime? dateTo = null, int? clientId = null)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
using ProjectCompanyFurniture.Entities;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Repositories.Implementations;
|
||||||
|
|
||||||
|
public class ManufacturerRepository : IManufacturerRepository
|
||||||
|
{
|
||||||
|
public void CreateManufacturer(Manufacturer manufacturer)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DeleteManufacturer(int id)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<Manufacturer> ReadManufacturers()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public Manufacturer ReadManufacturerById(int id)
|
||||||
|
{
|
||||||
|
return Manufacturer.CreateEntity(0, string.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateManufacturer(Manufacturer manufacturer)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
using ProjectCompanyFurniture.Entities;
|
||||||
|
using ProjectCompanyFurniture.Entities.Enums;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Repositories.Implementations;
|
||||||
|
|
||||||
|
public class ProductMovementRepository : IProductMovementRepository
|
||||||
|
{
|
||||||
|
public void CreateProductMovement(ProductMovement productMovement)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<ProductMovement> ReadProductMovements(DateTime? dateForm = null, DateTime? dateTo = null, int? clientId = null)
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
using ProjectCompanyFurniture.Entities;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ProjectCompanyFurniture.Repositories.Implementations;
|
||||||
|
|
||||||
|
public class ProductRepository : IProductRepository
|
||||||
|
{
|
||||||
|
public void CreateProduct(Product product)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DeleteProduct(int id)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public Product ReadProductById(int id)
|
||||||
|
{
|
||||||
|
return Product.CreateEntity(0, 0, string.Empty, string.Empty, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<Product> ReadProducts()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateProduct(Product product)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 9.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 514 KiB |
Binary file not shown.
After Width: | Height: | Size: 60 KiB |
Binary file not shown.
After Width: | Height: | Size: 63 KiB |
Loading…
Reference in New Issue
Block a user