From b379829b473deaa76fe386a16d176a86cf2bd886 Mon Sep 17 00:00:00 2001 From: sa Date: Tue, 3 Dec 2024 00:17:56 +0300 Subject: [PATCH 1/2] =?UTF-8?q?=D0=9C=D0=B5=D0=B3=D0=B0=20=D0=B1=D0=BE?= =?UTF-8?q?=D0=BB=D1=8C=D1=88=D0=BE=D0=B9=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B8?= =?UTF-8?q?=D1=82=20=D0=B2=D1=81=D0=B5=D0=B9=20=D1=84=D0=B0=D0=B7=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectOpticsStore/Entities/Customer.cs | 16 ++ .../Entities/Enums/OrderStatusEnum.cs | 10 + .../Entities/Enums/ProductTypeEnum.cs | 13 ++ .../ProjectOpticsStore/Entities/Order.cs | 26 +++ .../Entities/Order_Product.cs | 22 ++ .../ProjectOpticsStore/Entities/Product.cs | 26 +++ .../ProjectOpticsStore/Entities/Store.cs | 16 ++ .../ProjectOpticsStore/Entities/Supply.cs | 23 ++ .../ProjectOpticsStore/Form1.Designer.cs | 39 ---- .../ProjectOpticsStore/Form1.cs | 10 - .../FormOpticsStore.Designer.cs | 138 ++++++++++++ .../ProjectOpticsStore/FormOpticsStore.cs | 82 +++++++ .../ProjectOpticsStore/FormOpticsStore.resx | 123 +++++++++++ .../Forms/FormCustomer.Designer.cs | 97 ++++++++ .../ProjectOpticsStore/Forms/FormCustomer.cs | 72 ++++++ .../{Form1.resx => Forms/FormCustomer.resx} | 54 ++--- .../Forms/FormCustomers.Designer.cs | 122 +++++++++++ .../ProjectOpticsStore/Forms/FormCustomers.cs | 101 +++++++++ .../Forms/FormCustomers.resx | 120 ++++++++++ .../Forms/FormOrder.Designer.cs | 192 ++++++++++++++++ .../ProjectOpticsStore/Forms/FormOrder.cs | 91 ++++++++ .../ProjectOpticsStore/Forms/FormOrder.resx | 126 +++++++++++ .../Forms/FormOrders.Designer.cs | 107 +++++++++ .../ProjectOpticsStore/Forms/FormOrders.cs | 94 ++++++++ .../ProjectOpticsStore/Forms/FormOrders.resx | 120 ++++++++++ .../Forms/FormProduct.Designer.cs | 207 ++++++++++++++++++ .../ProjectOpticsStore/Forms/FormProduct.cs | 117 ++++++++++ .../ProjectOpticsStore/Forms/FormProduct.resx | 120 ++++++++++ .../Forms/FormProducts.Designer.cs | 121 ++++++++++ .../ProjectOpticsStore/Forms/FormProducts.cs | 108 +++++++++ .../Forms/FormProducts.resx | 120 ++++++++++ .../Forms/FormStore.Designer.cs | 96 ++++++++ .../ProjectOpticsStore/Forms/FormStore.cs | 79 +++++++ .../ProjectOpticsStore/Forms/FormStore.resx | 120 ++++++++++ .../Forms/FormStores.Designer.cs | 120 ++++++++++ .../ProjectOpticsStore/Forms/FormStores.cs | 106 +++++++++ .../ProjectOpticsStore/Forms/FormStores.resx | 120 ++++++++++ .../Forms/FormSupplies.Designer.cs | 93 ++++++++ .../ProjectOpticsStore/Forms/FormSupplies.cs | 48 ++++ .../Forms/FormSupplies.resx | 120 ++++++++++ .../Forms/FormSupply.Designer.cs | 168 ++++++++++++++ .../ProjectOpticsStore/Forms/FormSupply.cs | 67 ++++++ .../ProjectOpticsStore/Forms/FormSupply.resx | 120 ++++++++++ .../ProjectOpticsStore/Program.cs | 19 +- .../ProjectOpticsStore.csproj | 23 ++ .../Properties/DataSources/Order.datasource | 10 + .../Properties/Resources.Designer.cs | 103 +++++++++ .../Properties/Resources.resx | 133 +++++++++++ .../Repositories/ICustomerRepository.cs | 12 + .../Repositories/IOrderRepository.cs | 12 + .../Repositories/IProductRepository.cs | 10 + .../Repositories/IStoreRepository.cs | 12 + .../Repositories/ISupplyRepository.cs | 13 ++ .../Implementations/CustomerRepository.cs | 28 +++ .../Implementations/OrderRepository.cs | 17 ++ .../Implementations/ProductRepository.cs | 33 +++ .../Implementations/StoreRepository.cs | 33 +++ .../Implementations/SupplyRepository.cs | 15 ++ .../Resources/Button_Add.png | Bin 0 -> 12503 bytes .../Resources/Button_Delete.png | Bin 0 -> 20893 bytes .../Resources/Button_Edit.png | Bin 0 -> 2242 bytes .../Resources/catwithglasses.jpg | Bin 0 -> 10914 bytes 62 files changed, 4285 insertions(+), 78 deletions(-) create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Entities/Customer.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Entities/Enums/OrderStatusEnum.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Entities/Enums/ProductTypeEnum.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Entities/Order.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Entities/Order_Product.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Entities/Product.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Entities/Store.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Entities/Supply.cs delete mode 100644 ProjectOpticsStore/ProjectOpticsStore/Form1.Designer.cs delete mode 100644 ProjectOpticsStore/ProjectOpticsStore/Form1.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/FormOpticsStore.Designer.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/FormOpticsStore.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/FormOpticsStore.resx create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomer.Designer.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomer.cs rename ProjectOpticsStore/ProjectOpticsStore/{Form1.resx => Forms/FormCustomer.resx} (92%) create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomers.Designer.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomers.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomers.resx create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrder.Designer.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrder.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrder.resx create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrders.Designer.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrders.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrders.resx create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormProduct.Designer.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormProduct.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormProduct.resx create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormProducts.Designer.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormProducts.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormProducts.resx create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormStore.Designer.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormStore.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormStore.resx create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormStores.Designer.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormStores.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormStores.resx create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupplies.Designer.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupplies.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupplies.resx create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupply.Designer.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupply.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupply.resx create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Properties/DataSources/Order.datasource create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Properties/Resources.Designer.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Properties/Resources.resx create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Repositories/ICustomerRepository.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Repositories/IOrderRepository.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Repositories/IProductRepository.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Repositories/IStoreRepository.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Repositories/ISupplyRepository.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Repositories/Implementations/CustomerRepository.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Repositories/Implementations/OrderRepository.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Repositories/Implementations/ProductRepository.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Repositories/Implementations/StoreRepository.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Repositories/Implementations/SupplyRepository.cs create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Resources/Button_Add.png create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Resources/Button_Delete.png create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Resources/Button_Edit.png create mode 100644 ProjectOpticsStore/ProjectOpticsStore/Resources/catwithglasses.jpg diff --git a/ProjectOpticsStore/ProjectOpticsStore/Entities/Customer.cs b/ProjectOpticsStore/ProjectOpticsStore/Entities/Customer.cs new file mode 100644 index 0000000..b82790a --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Entities/Customer.cs @@ -0,0 +1,16 @@ +namespace ProjectOpticsStore.Entities; + +public class Customer +{ + public int Id { get; private set; } + public string FullName { get; private set; } = string.Empty; + + public static Customer CreateEntity(int id, string fullName) + { + return new Customer + { + Id = id, + FullName = fullName ?? string.Empty + }; + } +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Entities/Enums/OrderStatusEnum.cs b/ProjectOpticsStore/ProjectOpticsStore/Entities/Enums/OrderStatusEnum.cs new file mode 100644 index 0000000..b1a26c4 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Entities/Enums/OrderStatusEnum.cs @@ -0,0 +1,10 @@ +namespace ProjectOpticsStore.Entities.Enums; + +public enum OrderStatusEnum +{ + None = 0, + Pending = 1, + Completed = 2, + Canceled = 3, + InProgress = 4 +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Entities/Enums/ProductTypeEnum.cs b/ProjectOpticsStore/ProjectOpticsStore/Entities/Enums/ProductTypeEnum.cs new file mode 100644 index 0000000..6db516e --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Entities/Enums/ProductTypeEnum.cs @@ -0,0 +1,13 @@ +namespace ProjectOpticsStore.Entities.Enums; + +[Flags] +public enum ProductTypeEnum +{ + None = 0, + Glasses = 1, + ContactLenses = 2, + Sunglasses = 4, + Frame = 8, + Cases = 16 +} + diff --git a/ProjectOpticsStore/ProjectOpticsStore/Entities/Order.cs b/ProjectOpticsStore/ProjectOpticsStore/Entities/Order.cs new file mode 100644 index 0000000..5d3a545 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Entities/Order.cs @@ -0,0 +1,26 @@ +using ProjectOpticsStore.Entities; +using ProjectOpticsStore.Entities.Enums; + +public class Order +{ + public int Id { get; private set; } + public int CustomerId { get; private set; } + public DateTime DateCreated { get; private set; } + + public OrderStatusEnum Status { get; private set; } = OrderStatusEnum.Pending; + + // Коллекция, описывающая связь "Order_Product" + public IEnumerable OrderProducts { get; private set; } = new List(); + + public static Order CreateOperation(int id, int customerId, IEnumerable orderProducts, OrderStatusEnum status = OrderStatusEnum.Pending) + { + return new Order + { + Id = id, + CustomerId = customerId, + DateCreated = DateTime.Now, + Status = status, + OrderProducts = orderProducts + }; + } +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Entities/Order_Product.cs b/ProjectOpticsStore/ProjectOpticsStore/Entities/Order_Product.cs new file mode 100644 index 0000000..86393cc --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Entities/Order_Product.cs @@ -0,0 +1,22 @@ +namespace ProjectOpticsStore.Entities; + +public class Order_Product +{ + public int Id { get; private set; } + public int OrderId { get; private set; } + public int ProductId { get; private set; } + public int Quantity { get; private set; } + + // Создание элемента связи + public static Order_Product CreateElement(int id, int orderId, int productId, int quantity) + { + return new Order_Product + { + Id = id, + OrderId = orderId, + ProductId = productId, + Quantity = quantity + }; + } +} + diff --git a/ProjectOpticsStore/ProjectOpticsStore/Entities/Product.cs b/ProjectOpticsStore/ProjectOpticsStore/Entities/Product.cs new file mode 100644 index 0000000..bc14611 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Entities/Product.cs @@ -0,0 +1,26 @@ +using ProjectOpticsStore.Entities.Enums; + +public class Product +{ + public int Id { get; private set; } + public ProductTypeEnum Type { get; private set; } + public double Power { get; private set; } + public int Price { get; private set; } + public int StoreId { get; private set; } + public float Thickness { get; private set; } + public string Disease { get; private set; } = string.Empty; + + public static Product CreateEntity(int id, ProductTypeEnum type, double power, int price, int storeId, float thickness, string disease) + { + return new Product + { + Id = id, + Type = type, + Power = power, + Price = price, + StoreId = storeId, + Thickness = thickness, + Disease = disease ?? string.Empty + }; + } +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Entities/Store.cs b/ProjectOpticsStore/ProjectOpticsStore/Entities/Store.cs new file mode 100644 index 0000000..cb2ca36 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Entities/Store.cs @@ -0,0 +1,16 @@ +namespace ProjectOpticsStore.Entities; + +public class Store +{ + public int Id { get; private set; } + public string Address { get; private set; } = string.Empty; + + public static Store CreateEntity(int id, string address) + { + return new Store + { + Id = id, + Address = address ?? string.Empty + }; + } +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Entities/Supply.cs b/ProjectOpticsStore/ProjectOpticsStore/Entities/Supply.cs new file mode 100644 index 0000000..4dfec73 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Entities/Supply.cs @@ -0,0 +1,23 @@ +namespace ProjectOpticsStore.Entities; + +public class Supply +{ + public int Id { get; private set; } + public int StoreId { get; private set; } + public DateTime OperationDate { get; private set; } + public int ProductId { get; private set; } // Связь многие-к-одному с товарами + public int Quantity { get; private set; } // Количество поставленного товара + + public static Supply CreateOperation(int id, int storeId, int productId, int quantity) + { + return new Supply + { + Id = id, + StoreId = storeId, + OperationDate = DateTime.Now, + ProductId = productId, + Quantity = quantity + }; + } +} + diff --git a/ProjectOpticsStore/ProjectOpticsStore/Form1.Designer.cs b/ProjectOpticsStore/ProjectOpticsStore/Form1.Designer.cs deleted file mode 100644 index bddcf42..0000000 --- a/ProjectOpticsStore/ProjectOpticsStore/Form1.Designer.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace ProjectOpticsStore -{ - partial class Form1 - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - 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 - } -} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Form1.cs b/ProjectOpticsStore/ProjectOpticsStore/Form1.cs deleted file mode 100644 index a85a8c4..0000000 --- a/ProjectOpticsStore/ProjectOpticsStore/Form1.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace ProjectOpticsStore -{ - public partial class Form1 : Form - { - public Form1() - { - InitializeComponent(); - } - } -} diff --git a/ProjectOpticsStore/ProjectOpticsStore/FormOpticsStore.Designer.cs b/ProjectOpticsStore/ProjectOpticsStore/FormOpticsStore.Designer.cs new file mode 100644 index 0000000..06fbc1c --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/FormOpticsStore.Designer.cs @@ -0,0 +1,138 @@ +namespace ProjectOpticsStore +{ + partial class FormOpticsStore + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + menuStrip1 = new MenuStrip(); + справочникиToolStripMenuItem = new ToolStripMenuItem(); + товарыToolStripMenuItem = new ToolStripMenuItem(); + магазиныToolStripMenuItem = new ToolStripMenuItem(); + заказчикиToolStripMenuItem = new ToolStripMenuItem(); + операцииToolStripMenuItem = new ToolStripMenuItem(); + поставкаToolStripMenuItem = new ToolStripMenuItem(); + заказатьToolStripMenuItem = new ToolStripMenuItem(); + отчетыToolStripMenuItem = new ToolStripMenuItem(); + menuStrip1.SuspendLayout(); + SuspendLayout(); + // + // menuStrip1 + // + menuStrip1.ImageScalingSize = new Size(20, 20); + menuStrip1.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, операцииToolStripMenuItem, отчетыToolStripMenuItem }); + menuStrip1.Location = new Point(0, 0); + menuStrip1.Name = "menuStrip1"; + menuStrip1.Size = new Size(800, 28); + menuStrip1.TabIndex = 0; + menuStrip1.Text = "menuStrip1"; + // + // справочникиToolStripMenuItem + // + справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { товарыToolStripMenuItem, магазиныToolStripMenuItem, заказчикиToolStripMenuItem }); + справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem"; + справочникиToolStripMenuItem.Size = new Size(117, 24); + справочникиToolStripMenuItem.Text = "Справочники"; + // + // товарыToolStripMenuItem + // + товарыToolStripMenuItem.Name = "товарыToolStripMenuItem"; + товарыToolStripMenuItem.Size = new Size(224, 26); + товарыToolStripMenuItem.Text = "Товары"; + товарыToolStripMenuItem.Click += ProductsToolStripMenuItem_Click; + // + // магазиныToolStripMenuItem + // + магазиныToolStripMenuItem.Name = "магазиныToolStripMenuItem"; + магазиныToolStripMenuItem.Size = new Size(224, 26); + магазиныToolStripMenuItem.Text = "Магазины"; + магазиныToolStripMenuItem.Click += StoresToolStripMenuItem_Click; + // + // заказчикиToolStripMenuItem + // + заказчикиToolStripMenuItem.Name = "заказчикиToolStripMenuItem"; + заказчикиToolStripMenuItem.Size = new Size(224, 26); + заказчикиToolStripMenuItem.Text = "Заказчики"; + заказчикиToolStripMenuItem.Click += CustomersToolStripMenuItem_Click; + // + // операцииToolStripMenuItem + // + операцииToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { поставкаToolStripMenuItem, заказатьToolStripMenuItem }); + операцииToolStripMenuItem.Name = "операцииToolStripMenuItem"; + операцииToolStripMenuItem.Size = new Size(95, 24); + операцииToolStripMenuItem.Text = "Операции"; + // + // поставкаToolStripMenuItem + // + поставкаToolStripMenuItem.Name = "поставкаToolStripMenuItem"; + поставкаToolStripMenuItem.Size = new Size(164, 26); + поставкаToolStripMenuItem.Text = "Поставить"; + поставкаToolStripMenuItem.Click += SupplyToolStripMenuItem_Click; + // + // заказатьToolStripMenuItem + // + заказатьToolStripMenuItem.Name = "заказатьToolStripMenuItem"; + заказатьToolStripMenuItem.Size = new Size(164, 26); + заказатьToolStripMenuItem.Text = "Заказать"; + заказатьToolStripMenuItem.Click += OrderToolStripMenuItem_Click; + // + // отчетыToolStripMenuItem + // + отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem"; + отчетыToolStripMenuItem.Size = new Size(73, 24); + отчетыToolStripMenuItem.Text = "Отчеты"; + // + // FormOpticsStore + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + BackgroundImage = Properties.Resources.catwithglasses; + BackgroundImageLayout = ImageLayout.Stretch; + ClientSize = new Size(800, 450); + Controls.Add(menuStrip1); + MainMenuStrip = menuStrip1; + Name = "FormOpticsStore"; + StartPosition = FormStartPosition.CenterScreen; + Text = "Салон Оптики"; + menuStrip1.ResumeLayout(false); + menuStrip1.PerformLayout(); + ResumeLayout(false); + PerformLayout(); + } + + #endregion + + private MenuStrip menuStrip1; + private ToolStripMenuItem справочникиToolStripMenuItem; + private ToolStripMenuItem операцииToolStripMenuItem; + private ToolStripMenuItem отчетыToolStripMenuItem; + private ToolStripMenuItem товарыToolStripMenuItem; + private ToolStripMenuItem магазиныToolStripMenuItem; + private ToolStripMenuItem заказчикиToolStripMenuItem; + private ToolStripMenuItem поставкаToolStripMenuItem; + private ToolStripMenuItem заказатьToolStripMenuItem; + } +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/FormOpticsStore.cs b/ProjectOpticsStore/ProjectOpticsStore/FormOpticsStore.cs new file mode 100644 index 0000000..79e73ef --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/FormOpticsStore.cs @@ -0,0 +1,82 @@ +using ProjectOpticsStore.Forms; +using Unity; + +namespace ProjectOpticsStore; + +public partial class FormOpticsStore : Form +{ + private readonly IUnityContainer _container; + + public FormOpticsStore(IUnityContainer container) + { + InitializeComponent(); + _container = container ?? throw new ArgumentNullException(nameof(container)); + } + + // + private void ProductsToolStripMenuItem_Click(object sender, EventArgs e) + { + try + { + _container.Resolve().ShowDialog(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, " ", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void StoresToolStripMenuItem_Click(object sender, EventArgs e) + { + try + { + _container.Resolve().ShowDialog(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, " ", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void CustomersToolStripMenuItem_Click(object sender, EventArgs e) + { + try + { + _container.Resolve().ShowDialog(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, " ", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + // + private void SupplyToolStripMenuItem_Click(object sender, EventArgs e) + { + try + { + _container.Resolve().ShowDialog(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, " ", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OrderToolStripMenuItem_Click(object sender, EventArgs e) + { + try + { + _container.Resolve().ShowDialog(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, " ", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ExitToolStripMenuItem_Click(object sender, EventArgs e) + { + Close(); + } +} \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/FormOpticsStore.resx b/ProjectOpticsStore/ProjectOpticsStore/FormOpticsStore.resx new file mode 100644 index 0000000..b48baf1 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/FormOpticsStore.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomer.Designer.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomer.Designer.cs new file mode 100644 index 0000000..e600c0e --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomer.Designer.cs @@ -0,0 +1,97 @@ +namespace ProjectOpticsStore.Forms +{ + partial class FormCustomer + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + textBoxFullName = new TextBox(); + buttonSave = new Button(); + buttonCancel = new Button(); + labelFullName = new Label(); + SuspendLayout(); + // + // textBoxFullName + // + textBoxFullName.Location = new Point(209, 45); + textBoxFullName.Name = "textBoxFullName"; + textBoxFullName.Size = new Size(295, 27); + textBoxFullName.TabIndex = 0; + // + // buttonSave + // + buttonSave.Location = new Point(28, 240); + buttonSave.Name = "buttonSave"; + buttonSave.Size = new Size(124, 40); + buttonSave.TabIndex = 1; + buttonSave.Text = "Сохранить"; + buttonSave.UseVisualStyleBackColor = true; + buttonSave.Click += ButtonSave_Click; + // + // buttonCancel + // + buttonCancel.Location = new Point(209, 240); + buttonCancel.Name = "buttonCancel"; + buttonCancel.Size = new Size(124, 40); + buttonCancel.TabIndex = 2; + buttonCancel.Text = "Отмена"; + buttonCancel.UseVisualStyleBackColor = true; + buttonCancel.Click += ButtonCancel_Click; + // + // labelFullName + // + labelFullName.AutoSize = true; + labelFullName.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 204); + labelFullName.Location = new Point(28, 41); + labelFullName.Name = "labelFullName"; + labelFullName.Size = new Size(153, 28); + labelFullName.TabIndex = 3; + labelFullName.Text = "ФИО заказчика"; + // + // FormCustomer + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(527, 306); + Controls.Add(labelFullName); + Controls.Add(buttonCancel); + Controls.Add(buttonSave); + Controls.Add(textBoxFullName); + Name = "FormCustomer"; + StartPosition = FormStartPosition.CenterParent; + Text = "Заказчик"; + ResumeLayout(false); + PerformLayout(); + } + + #endregion + + private TextBox textBoxFullName; + private Button buttonSave; + private Button buttonCancel; + private Label labelFullName; + } +} \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomer.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomer.cs new file mode 100644 index 0000000..5543fac --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomer.cs @@ -0,0 +1,72 @@ +using ProjectOpticsStore.Entities; +using ProjectOpticsStore.Repositories; + +namespace ProjectOpticsStore.Forms; + +public partial class FormCustomer : Form +{ + private readonly ICustomerRepository _customerRepository; + private int? _customerId; + + // Конструктор принимает экземпляр ICustomerRepository + public FormCustomer(ICustomerRepository customerRepository) + { + InitializeComponent(); + _customerRepository = customerRepository ?? throw new ArgumentNullException(nameof(customerRepository)); + } + + public int Id + { + set + { + try + { + var customer = _customerRepository.ReadCustomerById(value); + if (customer == null) + { + throw new InvalidDataException(nameof(customer)); + } + + textBoxFullName.Text = customer.FullName; + _customerId = value; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + + private void ButtonSave_Click(object sender, EventArgs e) + { + try + { + if (string.IsNullOrWhiteSpace(textBoxFullName.Text)) + { + throw new Exception("Имеются незаполненные поля"); + } + + if (_customerId.HasValue) + { + // Если редактируем существующего клиента + _customerRepository.UpdateCustomer(CreateCustomer(_customerId.Value)); + } + else + { + // Если создаем нового клиента + _customerRepository.CreateCustomer(CreateCustomer(0)); + } + + Close(); // Закрываем форму после сохранения + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ButtonCancel_Click(object sender, EventArgs e) => Close(); + + // Метод для создания объекта Customer + private Customer CreateCustomer(int id) => Customer.CreateEntity(id, textBoxFullName.Text); +} \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Form1.resx b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomer.resx similarity index 92% rename from ProjectOpticsStore/ProjectOpticsStore/Form1.resx rename to ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomer.resx index 1af7de1..8b2ff64 100644 --- a/ProjectOpticsStore/ProjectOpticsStore/Form1.resx +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomer.resx @@ -1,17 +1,17 @@  - diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomers.Designer.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomers.Designer.cs new file mode 100644 index 0000000..23a697d --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomers.Designer.cs @@ -0,0 +1,122 @@ +namespace ProjectOpticsStore.Forms +{ + partial class FormCustomers + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + panelButtons = new Panel(); + buttonDel = new Button(); + buttonUpd = new Button(); + buttonAdd = new Button(); + dataGridViewData = new DataGridView(); + panelButtons.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)dataGridViewData).BeginInit(); + SuspendLayout(); + // + // panelButtons + // + panelButtons.Controls.Add(buttonDel); + panelButtons.Controls.Add(buttonUpd); + panelButtons.Controls.Add(buttonAdd); + panelButtons.Dock = DockStyle.Right; + panelButtons.Location = new Point(650, 0); + panelButtons.Name = "panelButtons"; + panelButtons.Size = new Size(150, 450); + panelButtons.TabIndex = 1; + // + // buttonDel + // + buttonDel.BackgroundImage = Properties.Resources.Button_Delete; + buttonDel.BackgroundImageLayout = ImageLayout.Stretch; + buttonDel.Location = new Point(20, 323); + buttonDel.Name = "buttonDel"; + buttonDel.Size = new Size(113, 100); + buttonDel.TabIndex = 2; + buttonDel.UseVisualStyleBackColor = true; + buttonDel.Click += ButtonDel_Click; + // + // buttonUpd + // + buttonUpd.BackgroundImage = Properties.Resources.Button_Edit; + buttonUpd.BackgroundImageLayout = ImageLayout.Stretch; + buttonUpd.Location = new Point(20, 174); + buttonUpd.Name = "buttonUpd"; + buttonUpd.Size = new Size(113, 100); + buttonUpd.TabIndex = 1; + buttonUpd.UseVisualStyleBackColor = true; + buttonUpd.Click += ButtonUpd_Click; + // + // buttonAdd + // + buttonAdd.BackgroundImage = Properties.Resources.Button_Add; + buttonAdd.BackgroundImageLayout = ImageLayout.Stretch; + buttonAdd.Location = new Point(20, 26); + buttonAdd.Name = "buttonAdd"; + buttonAdd.Size = new Size(113, 100); + buttonAdd.TabIndex = 0; + buttonAdd.UseVisualStyleBackColor = true; + buttonAdd.Click += ButtonAdd_Click; + // + // dataGridViewData + // + dataGridViewData.AllowUserToAddRows = false; + dataGridViewData.AllowUserToDeleteRows = false; + 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.Size = new Size(650, 450); + dataGridViewData.TabIndex = 2; + // + // FormCustomers + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(800, 450); + Controls.Add(dataGridViewData); + Controls.Add(panelButtons); + Name = "FormCustomers"; + StartPosition = FormStartPosition.CenterParent; + Text = "Заказчики"; + Load += FormCustomers_Load; + panelButtons.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)dataGridViewData).EndInit(); + ResumeLayout(false); + } + + #endregion + private Panel panelButtons; + private Button buttonDel; + private Button buttonUpd; + private Button buttonAdd; + private DataGridView dataGridViewData; + } +} \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomers.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomers.cs new file mode 100644 index 0000000..098e594 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomers.cs @@ -0,0 +1,101 @@ +using ProjectOpticsStore.Repositories; +using ProjectOpticsStore.Repositories.Implementations; +using Unity; + +namespace ProjectOpticsStore.Forms; + + +public partial class FormCustomers : Form +{ + private readonly IUnityContainer _container; + private readonly ICustomerRepository _customerRepository; + + public FormCustomers(IUnityContainer container, ICustomerRepository customerRepository) + { + InitializeComponent(); + _container = container ?? throw new ArgumentNullException(nameof(container)); + _customerRepository = customerRepository ?? throw new ArgumentNullException(nameof(customerRepository)); + } + + private void FormCustomers_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().ShowDialog(); + LoadList(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ButtonUpd_Click(object sender, EventArgs e) + { + if (!TryGetIdentifierFromSelectedRow(out var findId)) + { + return; + } + try + { + var form = _container.Resolve(); + 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 + { + _customerRepository.DeleteCustomer(findId); + LoadList(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void LoadList() + { + dataGridViewData.DataSource = _customerRepository.ReadCustomers(); + } + + 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; + } +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomers.resx b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomers.resx new file mode 100644 index 0000000..8b2ff64 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomers.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrder.Designer.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrder.Designer.cs new file mode 100644 index 0000000..eaf2425 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrder.Designer.cs @@ -0,0 +1,192 @@ +namespace ProjectOpticsStore.Forms +{ + partial class FormOrder + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + ButtonSave = new Button(); + ButtonCancel = new Button(); + comboBoxCustomer = new ComboBox(); + label1 = new Label(); + label2 = new Label(); + dateTimePickerOrderDate = new DateTimePicker(); + label3 = new Label(); + comboBoxStatus = new ComboBox(); + dataGridViewProducts = new DataGridView(); + ColumnProduct = new DataGridViewComboBoxColumn(); + ColumnQuantity = new DataGridViewTextBoxColumn(); + groupBox1 = new GroupBox(); + ((System.ComponentModel.ISupportInitialize)dataGridViewProducts).BeginInit(); + groupBox1.SuspendLayout(); + SuspendLayout(); + // + // ButtonSave + // + ButtonSave.Location = new Point(32, 499); + ButtonSave.Name = "ButtonSave"; + ButtonSave.Size = new Size(133, 45); + ButtonSave.TabIndex = 6; + ButtonSave.Text = "Сохранить"; + ButtonSave.UseVisualStyleBackColor = true; + ButtonSave.Click += ButtonSave_Click; + // + // ButtonCancel + // + ButtonCancel.Location = new Point(291, 499); + ButtonCancel.Name = "ButtonCancel"; + ButtonCancel.Size = new Size(133, 45); + ButtonCancel.TabIndex = 7; + ButtonCancel.Text = "Отмена"; + ButtonCancel.UseVisualStyleBackColor = true; + ButtonCancel.Click += ButtonCancel_Click; + // + // comboBoxCustomer + // + comboBoxCustomer.DropDownStyle = ComboBoxStyle.DropDownList; + comboBoxCustomer.FormattingEnabled = true; + comboBoxCustomer.Location = new Point(139, 12); + comboBoxCustomer.Name = "comboBoxCustomer"; + comboBoxCustomer.Size = new Size(288, 28); + comboBoxCustomer.TabIndex = 8; + // + // label1 + // + label1.AutoSize = true; + label1.Location = new Point(29, 15); + label1.Name = "label1"; + label1.Size = new Size(71, 20); + label1.TabIndex = 9; + label1.Text = "Заказчик"; + // + // label2 + // + label2.AutoSize = true; + label2.Location = new Point(29, 73); + label2.Name = "label2"; + label2.Size = new Size(86, 20); + label2.TabIndex = 10; + label2.Text = "ДатаВремя"; + // + // dateTimePickerOrderDate + // + dateTimePickerOrderDate.Enabled = false; + dateTimePickerOrderDate.Location = new Point(139, 68); + dateTimePickerOrderDate.Name = "dateTimePickerOrderDate"; + dateTimePickerOrderDate.Size = new Size(288, 27); + dateTimePickerOrderDate.TabIndex = 11; + // + // label3 + // + label3.AutoSize = true; + label3.Location = new Point(29, 128); + label3.Name = "label3"; + label3.Size = new Size(52, 20); + label3.TabIndex = 12; + label3.Text = "Статус"; + // + // comboBoxStatus + // + comboBoxStatus.DropDownStyle = ComboBoxStyle.DropDownList; + comboBoxStatus.FormattingEnabled = true; + comboBoxStatus.Location = new Point(139, 125); + comboBoxStatus.Name = "comboBoxStatus"; + comboBoxStatus.Size = new Size(288, 28); + comboBoxStatus.TabIndex = 13; + // + // dataGridViewProducts + // + dataGridViewProducts.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridViewProducts.Columns.AddRange(new DataGridViewColumn[] { ColumnProduct, ColumnQuantity }); + dataGridViewProducts.Dock = DockStyle.Fill; + dataGridViewProducts.Location = new Point(3, 23); + dataGridViewProducts.Name = "dataGridViewProducts"; + dataGridViewProducts.RowHeadersVisible = false; + dataGridViewProducts.RowHeadersWidth = 51; + dataGridViewProducts.Size = new Size(392, 236); + dataGridViewProducts.TabIndex = 14; + // + // ColumnProduct + // + ColumnProduct.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; + ColumnProduct.HeaderText = "Товар"; + ColumnProduct.MinimumWidth = 6; + ColumnProduct.Name = "ColumnProduct"; + // + // ColumnQuantity + // + ColumnQuantity.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; + ColumnQuantity.HeaderText = "Количество"; + ColumnQuantity.MinimumWidth = 6; + ColumnQuantity.Name = "ColumnQuantity"; + // + // groupBox1 + // + groupBox1.Controls.Add(dataGridViewProducts); + groupBox1.Location = new Point(29, 191); + groupBox1.Name = "groupBox1"; + groupBox1.Size = new Size(398, 262); + groupBox1.TabIndex = 15; + groupBox1.TabStop = false; + groupBox1.Text = "Заказы"; + // + // FormOrder + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(455, 569); + Controls.Add(groupBox1); + Controls.Add(comboBoxStatus); + Controls.Add(label3); + Controls.Add(dateTimePickerOrderDate); + Controls.Add(label2); + Controls.Add(label1); + Controls.Add(comboBoxCustomer); + Controls.Add(ButtonCancel); + Controls.Add(ButtonSave); + Name = "FormOrder"; + Text = "Заказать товары"; + ((System.ComponentModel.ISupportInitialize)dataGridViewProducts).EndInit(); + groupBox1.ResumeLayout(false); + ResumeLayout(false); + PerformLayout(); + } + + #endregion + private Button ButtonSave; + private Button ButtonCancel; + private ComboBox comboBoxCustomer; + private Label label1; + private Label label2; + private DateTimePicker dateTimePickerOrderDate; + private Label label3; + private ComboBox comboBoxStatus; + private DataGridView dataGridViewProducts; + private GroupBox groupBox1; + private DataGridViewComboBoxColumn ColumnProduct; + private DataGridViewTextBoxColumn ColumnQuantity; + } +} \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrder.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrder.cs new file mode 100644 index 0000000..7a107ad --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrder.cs @@ -0,0 +1,91 @@ +using ProjectOpticsStore.Entities.Enums; +using ProjectOpticsStore.Entities; +using ProjectOpticsStore.Repositories; + +namespace ProjectOpticsStore.Forms; + +public partial class FormOrder : Form +{ + private readonly IOrderRepository _orderRepository; + private readonly ICustomerRepository _customerRepository; + private readonly IProductRepository _productRepository; + + + public FormOrder(IOrderRepository orderRepository, ICustomerRepository customerRepository, IProductRepository productRepository) + { + InitializeComponent(); + _orderRepository = orderRepository ?? throw new ArgumentNullException(nameof(orderRepository)); + _customerRepository = customerRepository ?? throw new ArgumentNullException(nameof(customerRepository)); + _productRepository = productRepository ?? throw new ArgumentNullException(nameof(productRepository)); + + // Настройка ComboBox для выбора клиента + comboBoxCustomer.DataSource = _customerRepository.ReadCustomers() + .Select(c => new { c.Id }) + .ToList(); + comboBoxCustomer.DisplayMember = "Id"; + comboBoxCustomer.ValueMember = "Id"; + comboBoxCustomer.DropDownStyle = ComboBoxStyle.DropDownList; + + // Настройка ComboBox для выбора статуса заказа + comboBoxStatus.DataSource = Enum.GetValues(typeof(OrderStatusEnum)); + comboBoxStatus.DropDownStyle = ComboBoxStyle.DropDownList; + + dataGridViewProducts.AllowUserToAddRows = true; + dataGridViewProducts.AllowUserToDeleteRows = true; + + // Настройка DateTimePicker для даты заказа + dateTimePickerOrderDate.Value = DateTime.Now; + dateTimePickerOrderDate.Enabled = false; + } + + + private void ButtonSave_Click(object sender, EventArgs e) + { + try + { + if (string.IsNullOrWhiteSpace(comboBoxCustomer.Text) || comboBoxStatus.SelectedItem == null || dataGridViewProducts.RowCount < 1) + { + throw new Exception("Имеются незаполненные поля"); + } + + var customerId = (int)comboBoxCustomer.SelectedValue!; + var status = (OrderStatusEnum)comboBoxStatus.SelectedItem!; + var orderProducts = CreateOrderProductsFromDataGrid(); + + var order = Order.CreateOperation(0, customerId, orderProducts, status); + _orderRepository.CreateOrder(order); + + Close(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ButtonCancel_Click(object sender, EventArgs e) + { + Close(); + } + + private List CreateOrderProductsFromDataGrid() + { + var list = new List(); + + foreach (DataGridViewRow row in dataGridViewProducts.Rows) + { + // Пропускаем строку, если не указаны значения для продукта или количества + if (row.Cells["ColumnProduct"].Value == null || row.Cells["ColumnQuantity"].Value == null) + continue; + + // Получаем значения из ячеек + var productId = Convert.ToInt32(row.Cells["ColumnProduct"].Value); + var quantity = Convert.ToInt32(row.Cells["ColumnQuantity"].Value); + + // Используем метод CreateElement для создания объектов Order_Product + list.Add(Order_Product.CreateElement(0, 0, productId, quantity)); + } + + return list; + } +} \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrder.resx b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrder.resx new file mode 100644 index 0000000..70d9360 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrder.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrders.Designer.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrders.Designer.cs new file mode 100644 index 0000000..052b7fc --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrders.Designer.cs @@ -0,0 +1,107 @@ +namespace ProjectOpticsStore.Forms +{ + partial class FormOrders + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + panelButtons = new Panel(); + buttonDel = new Button(); + buttonAdd = new Button(); + dataGridViewOrders = new DataGridView(); + panelButtons.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)dataGridViewOrders).BeginInit(); + SuspendLayout(); + // + // panelButtons + // + panelButtons.Controls.Add(buttonDel); + panelButtons.Controls.Add(buttonAdd); + panelButtons.Dock = DockStyle.Right; + panelButtons.Location = new Point(650, 0); + panelButtons.Name = "panelButtons"; + panelButtons.Size = new Size(150, 450); + panelButtons.TabIndex = 2; + // + // buttonDel + // + buttonDel.BackgroundImage = Properties.Resources.Button_Delete; + buttonDel.BackgroundImageLayout = ImageLayout.Stretch; + buttonDel.Location = new Point(20, 323); + buttonDel.Name = "buttonDel"; + buttonDel.Size = new Size(113, 100); + buttonDel.TabIndex = 2; + buttonDel.UseVisualStyleBackColor = true; + buttonDel.Click += ButtonDel_Click; + // + // buttonAdd + // + buttonAdd.BackgroundImage = Properties.Resources.Button_Add; + buttonAdd.BackgroundImageLayout = ImageLayout.Stretch; + buttonAdd.Location = new Point(20, 26); + buttonAdd.Name = "buttonAdd"; + buttonAdd.Size = new Size(113, 100); + buttonAdd.TabIndex = 0; + buttonAdd.UseVisualStyleBackColor = true; + buttonAdd.Click += ButtonAdd_Click; + // + // dataGridViewOrders + // + dataGridViewOrders.AllowUserToAddRows = false; + dataGridViewOrders.AllowUserToDeleteRows = false; + dataGridViewOrders.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridViewOrders.Dock = DockStyle.Fill; + dataGridViewOrders.Location = new Point(0, 0); + dataGridViewOrders.MultiSelect = false; + dataGridViewOrders.Name = "dataGridViewOrders"; + dataGridViewOrders.ReadOnly = true; + dataGridViewOrders.RowHeadersVisible = false; + dataGridViewOrders.RowHeadersWidth = 51; + dataGridViewOrders.Size = new Size(650, 450); + dataGridViewOrders.TabIndex = 3; + // + // FormOrders + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(800, 450); + Controls.Add(dataGridViewOrders); + Controls.Add(panelButtons); + Name = "FormOrders"; + Text = "Заказать товары"; + Load += FormOrders_Load; + panelButtons.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)dataGridViewOrders).EndInit(); + ResumeLayout(false); + } + + #endregion + private Panel panelButtons; + private Button buttonDel; + private Button buttonAdd; + private DataGridView dataGridViewOrders; + } +} \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrders.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrders.cs new file mode 100644 index 0000000..8980d0b --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrders.cs @@ -0,0 +1,94 @@ +using ProjectOpticsStore.Repositories; +using ProjectOpticsStore.Entities; +using ProjectOpticsStore.Repositories.Implementations; + +namespace ProjectOpticsStore.Forms; + +public partial class FormOrders : Form +{ + private readonly IOrderRepository _orderRepository; + private readonly ICustomerRepository _customerRepository; + private readonly IProductRepository _productRepository; + + public FormOrders(IOrderRepository orderRepository, ICustomerRepository customerRepository, IProductRepository productRepository) + { + InitializeComponent(); + _orderRepository = orderRepository ?? throw new ArgumentNullException(nameof(orderRepository)); + _customerRepository = customerRepository ?? throw new ArgumentNullException(nameof(customerRepository)); + _productRepository = productRepository ?? throw new ArgumentNullException(nameof(productRepository)); + } + // Загрузка списка заказов при загрузке формы + private void FormOrders_Load(object sender, EventArgs e) + { + try + { + LoadList(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + // Кнопка для добавления нового заказа + private void ButtonAdd_Click(object sender, EventArgs e) + { + try + { + // Передаем все три зависимости в конструктор FormOrder + using (var form = new FormOrder(_orderRepository, _customerRepository, _productRepository)) + { + 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 orderId)) + { + return; + } + + if (MessageBox.Show("Удалить заказ?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes) + { + return; + } + + try + { + _orderRepository.DeleteOrder(orderId); + LoadList(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + // Метод для загрузки списка заказов в DataGridView + private void LoadList() + { + dataGridViewOrders.DataSource = _orderRepository.ReadOrders(); + } + + // Метод для получения идентификатора заказа из выбранной строки в DataGridView + private bool TryGetIdentifierFromSelectedRow(out int id) + { + id = 0; + if (dataGridViewOrders.SelectedRows.Count < 1) + { + MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return false; + } + + id = Convert.ToInt32(dataGridViewOrders.SelectedRows[0].Cells["Id"].Value); + return true; + } +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrders.resx b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrders.resx new file mode 100644 index 0000000..8b2ff64 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrders.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProduct.Designer.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProduct.Designer.cs new file mode 100644 index 0000000..a379967 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProduct.Designer.cs @@ -0,0 +1,207 @@ +namespace ProjectOpticsStore.Forms +{ + partial class FormProduct + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + buttonSave = new Button(); + buttonCancel = new Button(); + checkedListBoxProductType = new CheckedListBox(); + label1 = new Label(); + label2 = new Label(); + label3 = new Label(); + label4 = new Label(); + label5 = new Label(); + label6 = new Label(); + textBoxPower = new TextBox(); + textBoxPrice = new TextBox(); + textBoxStoreID = new TextBox(); + textBoxThickness = new TextBox(); + textBoxDisease = new TextBox(); + SuspendLayout(); + // + // buttonSave + // + buttonSave.Location = new Point(32, 493); + buttonSave.Name = "buttonSave"; + buttonSave.Size = new Size(124, 40); + buttonSave.TabIndex = 2; + buttonSave.Text = "Сохранить"; + buttonSave.UseVisualStyleBackColor = true; + buttonSave.Click += ButtonSave_Click; + // + // buttonCancel + // + buttonCancel.Location = new Point(201, 493); + buttonCancel.Name = "buttonCancel"; + buttonCancel.Size = new Size(124, 40); + buttonCancel.TabIndex = 3; + buttonCancel.Text = "Отмена"; + buttonCancel.UseVisualStyleBackColor = true; + buttonCancel.Click += ButtonCancel_Click; + // + // checkedListBoxProductType + // + checkedListBoxProductType.FormattingEnabled = true; + checkedListBoxProductType.Location = new Point(157, 22); + checkedListBoxProductType.Name = "checkedListBoxProductType"; + checkedListBoxProductType.Size = new Size(254, 114); + checkedListBoxProductType.TabIndex = 4; + // + // label1 + // + label1.AutoSize = true; + label1.Location = new Point(32, 22); + label1.Name = "label1"; + label1.Size = new Size(90, 20); + label1.TabIndex = 5; + label1.Text = "Тип товара:"; + // + // label2 + // + label2.AutoSize = true; + label2.Location = new Point(32, 171); + label2.Name = "label2"; + label2.Size = new Size(85, 20); + label2.TabIndex = 6; + label2.Text = "Мощность:"; + // + // label3 + // + label3.AutoSize = true; + label3.Location = new Point(32, 227); + label3.Name = "label3"; + label3.Size = new Size(48, 20); + label3.TabIndex = 7; + label3.Text = "Цена:"; + // + // label4 + // + label4.AutoSize = true; + label4.Location = new Point(32, 287); + label4.Name = "label4"; + label4.Size = new Size(97, 20); + label4.TabIndex = 8; + label4.Text = "ID магазина:"; + // + // label5 + // + label5.AutoSize = true; + label5.Location = new Point(32, 352); + label5.Name = "label5"; + label5.Size = new Size(122, 20); + label5.TabIndex = 9; + label5.Text = "Толщина (чево):"; + // + // label6 + // + label6.AutoSize = true; + label6.Location = new Point(32, 406); + label6.Name = "label6"; + label6.Size = new Size(70, 20); + label6.TabIndex = 10; + label6.Text = "Болезнь:"; + // + // textBoxPower + // + textBoxPower.Location = new Point(157, 168); + textBoxPower.Name = "textBoxPower"; + textBoxPower.Size = new Size(254, 27); + textBoxPower.TabIndex = 11; + // + // textBoxPrice + // + textBoxPrice.Location = new Point(157, 224); + textBoxPrice.Name = "textBoxPrice"; + textBoxPrice.Size = new Size(254, 27); + textBoxPrice.TabIndex = 12; + // + // textBoxStoreID + // + textBoxStoreID.Location = new Point(157, 284); + textBoxStoreID.Name = "textBoxStoreID"; + textBoxStoreID.Size = new Size(254, 27); + textBoxStoreID.TabIndex = 13; + // + // textBoxThickness + // + textBoxThickness.Location = new Point(157, 349); + textBoxThickness.Name = "textBoxThickness"; + textBoxThickness.Size = new Size(254, 27); + textBoxThickness.TabIndex = 14; + // + // textBoxDisease + // + textBoxDisease.Location = new Point(157, 406); + textBoxDisease.Multiline = true; + textBoxDisease.Name = "textBoxDisease"; + textBoxDisease.Size = new Size(254, 67); + textBoxDisease.TabIndex = 15; + // + // FormProduct + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(436, 545); + Controls.Add(textBoxDisease); + Controls.Add(textBoxThickness); + Controls.Add(textBoxStoreID); + Controls.Add(textBoxPrice); + Controls.Add(textBoxPower); + Controls.Add(label6); + Controls.Add(label5); + Controls.Add(label4); + Controls.Add(label3); + Controls.Add(label2); + Controls.Add(label1); + Controls.Add(checkedListBoxProductType); + Controls.Add(buttonCancel); + Controls.Add(buttonSave); + Name = "FormProduct"; + Text = "Так называемые товары"; + ResumeLayout(false); + PerformLayout(); + } + + #endregion + + private Button buttonSave; + private Button buttonCancel; + private CheckedListBox checkedListBoxProductType; + private Label label1; + private Label label2; + private Label label3; + private Label label4; + private Label label5; + private Label label6; + private TextBox textBoxPower; + private TextBox textBoxPrice; + private TextBox textBoxStoreID; + private TextBox textBoxThickness; + private TextBox textBoxDisease; + } +} \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProduct.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProduct.cs new file mode 100644 index 0000000..72069c6 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProduct.cs @@ -0,0 +1,117 @@ +using ProjectOpticsStore.Entities; +using ProjectOpticsStore.Entities.Enums; +using ProjectOpticsStore.Repositories; +namespace ProjectOpticsStore.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)); + } + + // Заполнение значений CheckedListBox + foreach (ProductTypeEnum elem in Enum.GetValues(typeof(ProductTypeEnum))) + { + if ((elem & product.Type) != 0) + { + checkedListBoxProductType.SetItemChecked( + checkedListBoxProductType.Items.IndexOf(elem), true); + } + } + + // Заполнение текстовых полей + textBoxPower.Text = product.Power.ToString(); + textBoxPrice.Text = product.Price.ToString(); + textBoxStoreID.Text = product.StoreId.ToString(); + textBoxThickness.Text = product.Thickness.ToString("F2"); + textBoxDisease.Text = product.Disease; + + _productId = value; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + } + } + + public FormProduct(IProductRepository productRepository) + { + InitializeComponent(); + _productRepository = productRepository ?? throw new ArgumentNullException(nameof(productRepository)); + + // Заполнение CheckedListBox значениями перечисления + foreach (var elem in Enum.GetValues(typeof(ProductTypeEnum))) + { + checkedListBoxProductType.Items.Add(elem); + } + } + + private void ButtonSave_Click(object sender, EventArgs e) + { + try + { + // Проверка на заполненность всех обязательных полей + if (checkedListBoxProductType.CheckedItems.Count == 0 || + string.IsNullOrWhiteSpace(textBoxPower.Text) || + string.IsNullOrWhiteSpace(textBoxPrice.Text) || + string.IsNullOrWhiteSpace(textBoxStoreID.Text) || + string.IsNullOrWhiteSpace(textBoxThickness.Text)) + { + 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) + { + // Сбор значений из CheckedListBox + ProductTypeEnum productType = ProductTypeEnum.None; + foreach (var elem in checkedListBoxProductType.CheckedItems) + { + productType |= (ProductTypeEnum)elem; + } + + // Создание сущности Product + return Product.CreateEntity( + id, + productType, + double.Parse(textBoxPower.Text), + int.Parse(textBoxPrice.Text), + int.Parse(textBoxStoreID.Text), + float.Parse(textBoxThickness.Text), + textBoxDisease.Text + ); + } +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProduct.resx b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProduct.resx new file mode 100644 index 0000000..8b2ff64 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProduct.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProducts.Designer.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProducts.Designer.cs new file mode 100644 index 0000000..890564a --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProducts.Designer.cs @@ -0,0 +1,121 @@ +namespace ProjectOpticsStore.Forms +{ + partial class FormProducts + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + panelButtons = new Panel(); + buttonDel = new Button(); + buttonUpd = new Button(); + buttonAdd = new Button(); + dataGridViewProducts = new DataGridView(); + panelButtons.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)dataGridViewProducts).BeginInit(); + SuspendLayout(); + // + // panelButtons + // + panelButtons.Controls.Add(buttonDel); + panelButtons.Controls.Add(buttonUpd); + panelButtons.Controls.Add(buttonAdd); + panelButtons.Dock = DockStyle.Right; + panelButtons.Location = new Point(650, 0); + panelButtons.Name = "panelButtons"; + panelButtons.Size = new Size(150, 450); + panelButtons.TabIndex = 3; + // + // buttonDel + // + buttonDel.BackgroundImage = Properties.Resources.Button_Delete; + buttonDel.BackgroundImageLayout = ImageLayout.Stretch; + buttonDel.Location = new Point(20, 323); + buttonDel.Name = "buttonDel"; + buttonDel.Size = new Size(113, 100); + buttonDel.TabIndex = 2; + buttonDel.UseVisualStyleBackColor = true; + buttonDel.Click += ButtonDel_Click; + // + // buttonUpd + // + buttonUpd.BackgroundImage = Properties.Resources.Button_Edit; + buttonUpd.BackgroundImageLayout = ImageLayout.Stretch; + buttonUpd.Location = new Point(20, 174); + buttonUpd.Name = "buttonUpd"; + buttonUpd.Size = new Size(113, 100); + buttonUpd.TabIndex = 1; + buttonUpd.UseVisualStyleBackColor = true; + buttonUpd.Click += ButtonUpd_Click; + // + // buttonAdd + // + buttonAdd.BackgroundImage = Properties.Resources.Button_Add; + buttonAdd.BackgroundImageLayout = ImageLayout.Stretch; + buttonAdd.Location = new Point(20, 26); + buttonAdd.Name = "buttonAdd"; + buttonAdd.Size = new Size(113, 100); + buttonAdd.TabIndex = 0; + buttonAdd.UseVisualStyleBackColor = true; + buttonAdd.Click += ButtonAdd_Click; + // + // dataGridViewProducts + // + dataGridViewProducts.AllowUserToAddRows = false; + dataGridViewProducts.AllowUserToDeleteRows = false; + dataGridViewProducts.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridViewProducts.Dock = DockStyle.Fill; + dataGridViewProducts.Location = new Point(0, 0); + dataGridViewProducts.MultiSelect = false; + dataGridViewProducts.Name = "dataGridViewProducts"; + dataGridViewProducts.ReadOnly = true; + dataGridViewProducts.RowHeadersVisible = false; + dataGridViewProducts.RowHeadersWidth = 51; + dataGridViewProducts.Size = new Size(650, 450); + dataGridViewProducts.TabIndex = 4; + // + // FormProducts + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(800, 450); + Controls.Add(dataGridViewProducts); + Controls.Add(panelButtons); + Name = "FormProducts"; + Text = "Работа с товарами"; + Load += FormProducts_Load; + panelButtons.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)dataGridViewProducts).EndInit(); + ResumeLayout(false); + } + + #endregion + private Panel panelButtons; + private Button buttonDel; + private Button buttonUpd; + private Button buttonAdd; + private DataGridView dataGridViewProducts; + } +} \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProducts.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProducts.cs new file mode 100644 index 0000000..24461b1 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProducts.cs @@ -0,0 +1,108 @@ +using ProjectOpticsStore.Entities; +using ProjectOpticsStore.Repositories; +using Unity; + +namespace ProjectOpticsStore.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().ShowDialog(); + LoadList(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ButtonUpd_Click(object sender, EventArgs e) + { + if (!TryGetIdentifierFromSelectedRow(out var productId)) + { + return; + } + + try + { + // Открытие формы редактирования существующего товара + var form = _container.Resolve(); + form.Id = productId; + 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 productId)) + { + return; + } + + if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes) + { + return; + } + + try + { + // Удаление товара + _productRepository.DeleteProduct(productId); + LoadList(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void LoadList() + { + // Загрузка списка товаров в DataGridView + dataGridViewProducts.DataSource = _productRepository.ReadProducts().ToList(); + } + + private bool TryGetIdentifierFromSelectedRow(out int id) + { + id = 0; + if (dataGridViewProducts.SelectedRows.Count < 1) + { + MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return false; + } + + // Получение идентификатора выбранного товара + id = Convert.ToInt32(dataGridViewProducts.SelectedRows[0].Cells["Id"].Value); + return true; + } +} \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProducts.resx b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProducts.resx new file mode 100644 index 0000000..8b2ff64 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProducts.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormStore.Designer.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormStore.Designer.cs new file mode 100644 index 0000000..052a254 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormStore.Designer.cs @@ -0,0 +1,96 @@ +namespace ProjectOpticsStore.Forms +{ + partial class FormStore + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + textBoxAddress = new TextBox(); + labelFullName = new Label(); + buttonSave = new Button(); + buttonCancel = new Button(); + SuspendLayout(); + // + // textBoxAddress + // + textBoxAddress.Location = new Point(134, 69); + textBoxAddress.Name = "textBoxAddress"; + textBoxAddress.Size = new Size(295, 27); + textBoxAddress.TabIndex = 1; + // + // labelFullName + // + labelFullName.AutoSize = true; + labelFullName.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point, 204); + labelFullName.Location = new Point(22, 65); + labelFullName.Name = "labelFullName"; + labelFullName.Size = new Size(71, 28); + labelFullName.TabIndex = 4; + labelFullName.Text = "Адрес:"; + // + // buttonSave + // + buttonSave.Location = new Point(40, 278); + buttonSave.Name = "buttonSave"; + buttonSave.Size = new Size(124, 40); + buttonSave.TabIndex = 5; + buttonSave.Text = "Сохранить"; + buttonSave.UseVisualStyleBackColor = true; + buttonSave.Click += ButtonSave_Click; + // + // buttonCancel + // + buttonCancel.Location = new Point(206, 278); + buttonCancel.Name = "buttonCancel"; + buttonCancel.Size = new Size(124, 40); + buttonCancel.TabIndex = 6; + buttonCancel.Text = "Отмена"; + buttonCancel.UseVisualStyleBackColor = true; + buttonCancel.Click += ButtonCancel_Click; + // + // FormStore + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(469, 341); + Controls.Add(buttonCancel); + Controls.Add(buttonSave); + Controls.Add(labelFullName); + Controls.Add(textBoxAddress); + Name = "FormStore"; + Text = "Магазины"; + ResumeLayout(false); + PerformLayout(); + } + + #endregion + + private TextBox textBoxAddress; + private Label labelFullName; + private Button buttonSave; + private Button buttonCancel; + } +} \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormStore.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormStore.cs new file mode 100644 index 0000000..fad22a5 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormStore.cs @@ -0,0 +1,79 @@ +using ProjectOpticsStore.Entities; +using ProjectOpticsStore.Repositories; + +namespace ProjectOpticsStore.Forms; + +public partial class FormStore : Form +{ + private readonly IStoreRepository _storeRepository; + private int? _storeId; + + public int Id + { + set + { + try + { + // Загрузка данных магазина + var store = _storeRepository.ReadStoreById(value); + if (store == null) + { + throw new InvalidDataException(nameof(store)); + } + + textBoxAddress.Text = store.Address; + _storeId = value; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + } + } + + public FormStore(IStoreRepository storeRepository) + { + InitializeComponent(); + _storeRepository = storeRepository ?? throw new ArgumentNullException(nameof(storeRepository)); + } + + private void ButtonSave_Click(object sender, EventArgs e) + { + try + { + // Проверка на заполненность обязательных полей + if (string.IsNullOrWhiteSpace(textBoxAddress.Text)) + { + throw new Exception("Адрес магазина не указан."); + } + + // Сохранение данных + if (_storeId.HasValue) + { + _storeRepository.UpdateStore(CreateStore(_storeId.Value)); + } + else + { + _storeRepository.CreateStore(CreateStore(0)); + } + + Close(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ButtonCancel_Click(object sender, EventArgs e) + { + Close(); + } + + private Store CreateStore(int id) + { + // Создание сущности Store + return Store.CreateEntity(id, textBoxAddress.Text); + } +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormStore.resx b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormStore.resx new file mode 100644 index 0000000..8b2ff64 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormStore.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormStores.Designer.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormStores.Designer.cs new file mode 100644 index 0000000..aff9d97 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormStores.Designer.cs @@ -0,0 +1,120 @@ +namespace ProjectOpticsStore.Forms +{ + partial class FormStores + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + panelButtons = new Panel(); + buttonDel = new Button(); + buttonUpd = new Button(); + buttonAdd = new Button(); + dataGridViewStores = new DataGridView(); + panelButtons.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)dataGridViewStores).BeginInit(); + SuspendLayout(); + // + // panelButtons + // + panelButtons.Controls.Add(buttonDel); + panelButtons.Controls.Add(buttonUpd); + panelButtons.Controls.Add(buttonAdd); + panelButtons.Dock = DockStyle.Right; + panelButtons.Location = new Point(650, 0); + panelButtons.Name = "panelButtons"; + panelButtons.Size = new Size(150, 450); + panelButtons.TabIndex = 4; + // + // buttonDel + // + buttonDel.BackgroundImage = Properties.Resources.Button_Delete; + buttonDel.BackgroundImageLayout = ImageLayout.Stretch; + buttonDel.Location = new Point(20, 323); + buttonDel.Name = "buttonDel"; + buttonDel.Size = new Size(113, 100); + buttonDel.TabIndex = 2; + buttonDel.UseVisualStyleBackColor = true; + buttonDel.Click += ButtonDel_Click; + // + // buttonUpd + // + buttonUpd.BackgroundImage = Properties.Resources.Button_Edit; + buttonUpd.BackgroundImageLayout = ImageLayout.Stretch; + buttonUpd.Location = new Point(20, 174); + buttonUpd.Name = "buttonUpd"; + buttonUpd.Size = new Size(113, 100); + buttonUpd.TabIndex = 1; + buttonUpd.UseVisualStyleBackColor = true; + buttonUpd.Click += ButtonUpd_Click; + // + // buttonAdd + // + buttonAdd.BackgroundImage = Properties.Resources.Button_Add; + buttonAdd.BackgroundImageLayout = ImageLayout.Stretch; + buttonAdd.Location = new Point(20, 26); + buttonAdd.Name = "buttonAdd"; + buttonAdd.Size = new Size(113, 100); + buttonAdd.TabIndex = 0; + buttonAdd.UseVisualStyleBackColor = true; + buttonAdd.Click += ButtonAdd_Click; + // + // dataGridViewStores + // + dataGridViewStores.AllowUserToAddRows = false; + dataGridViewStores.AllowUserToDeleteRows = false; + dataGridViewStores.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridViewStores.Dock = DockStyle.Fill; + dataGridViewStores.Location = new Point(0, 0); + dataGridViewStores.MultiSelect = false; + dataGridViewStores.Name = "dataGridViewStores"; + dataGridViewStores.ReadOnly = true; + dataGridViewStores.RowHeadersVisible = false; + dataGridViewStores.RowHeadersWidth = 51; + dataGridViewStores.Size = new Size(650, 450); + dataGridViewStores.TabIndex = 5; + // + // FormStores + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(800, 450); + Controls.Add(dataGridViewStores); + Controls.Add(panelButtons); + Name = "FormStores"; + Text = "Так сказать магазины"; + panelButtons.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)dataGridViewStores).EndInit(); + ResumeLayout(false); + } + + #endregion + private Panel panelButtons; + private Button buttonDel; + private Button buttonUpd; + private Button buttonAdd; + private DataGridView dataGridViewStores; + } +} \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormStores.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormStores.cs new file mode 100644 index 0000000..9781d27 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormStores.cs @@ -0,0 +1,106 @@ +using ProjectOpticsStore.Entities; +using ProjectOpticsStore.Repositories; +using Unity; + +namespace ProjectOpticsStore.Forms; + +public partial class FormStores : Form +{ + private readonly IUnityContainer _container; + private readonly IStoreRepository _storeRepository; + + public FormStores(IUnityContainer container, IStoreRepository storeRepository) + { + InitializeComponent(); + _container = container ?? throw new ArgumentNullException(nameof(container)); + _storeRepository = storeRepository ?? throw new ArgumentNullException(nameof(storeRepository)); + } + + private void FormStores_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().ShowDialog(); + LoadList(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ButtonUpd_Click(object sender, EventArgs e) + { + if (!TryGetIdentifierFromSelectedRow(out var storeId)) + { + return; + } + + try + { + var form = _container.Resolve(); + form.Id = storeId; + 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 storeId)) + { + return; + } + + if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo) != DialogResult.Yes) + { + return; + } + + try + { + _storeRepository.DeleteStore(storeId); + LoadList(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void LoadList() + { + // Загрузка списка магазинов в DataGridView + dataGridViewStores.DataSource = _storeRepository.ReadStores().ToList(); + } + + private bool TryGetIdentifierFromSelectedRow(out int id) + { + id = 0; + if (dataGridViewStores.SelectedRows.Count < 1) + { + MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return false; + } + + // Получение идентификатора выбранного магазина + id = Convert.ToInt32(dataGridViewStores.SelectedRows[0].Cells["Id"].Value); + return true; + } +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormStores.resx b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormStores.resx new file mode 100644 index 0000000..8b2ff64 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormStores.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupplies.Designer.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupplies.Designer.cs new file mode 100644 index 0000000..94fba8a --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupplies.Designer.cs @@ -0,0 +1,93 @@ +namespace ProjectOpticsStore.Forms +{ + partial class FormSupplies + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + panelButtons = new Panel(); + buttonAdd = new Button(); + dataGridViewSupplies = new DataGridView(); + panelButtons.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)dataGridViewSupplies).BeginInit(); + SuspendLayout(); + // + // panelButtons + // + panelButtons.Controls.Add(buttonAdd); + panelButtons.Dock = DockStyle.Right; + panelButtons.Location = new Point(650, 0); + panelButtons.Name = "panelButtons"; + panelButtons.Size = new Size(150, 450); + panelButtons.TabIndex = 5; + // + // buttonAdd + // + buttonAdd.BackgroundImage = Properties.Resources.Button_Add; + buttonAdd.BackgroundImageLayout = ImageLayout.Stretch; + buttonAdd.Location = new Point(20, 26); + buttonAdd.Name = "buttonAdd"; + buttonAdd.Size = new Size(113, 100); + buttonAdd.TabIndex = 0; + buttonAdd.UseVisualStyleBackColor = true; + buttonAdd.Click += ButtonAdd_Click; + // + // dataGridViewSupplies + // + dataGridViewSupplies.AllowUserToAddRows = false; + dataGridViewSupplies.AllowUserToDeleteRows = false; + dataGridViewSupplies.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridViewSupplies.Dock = DockStyle.Fill; + dataGridViewSupplies.Location = new Point(0, 0); + dataGridViewSupplies.MultiSelect = false; + dataGridViewSupplies.Name = "dataGridViewSupplies"; + dataGridViewSupplies.ReadOnly = true; + dataGridViewSupplies.RowHeadersVisible = false; + dataGridViewSupplies.RowHeadersWidth = 51; + dataGridViewSupplies.Size = new Size(650, 450); + dataGridViewSupplies.TabIndex = 6; + // + // FormSupplies + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(800, 450); + Controls.Add(dataGridViewSupplies); + Controls.Add(panelButtons); + Name = "FormSupplies"; + Text = "Определенным образом поставка"; + Load += FormSupplies_Load; + panelButtons.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)dataGridViewSupplies).EndInit(); + ResumeLayout(false); + } + + #endregion + private Panel panelButtons; + private Button buttonAdd; + private DataGridView dataGridViewSupplies; + } +} \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupplies.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupplies.cs new file mode 100644 index 0000000..3701d1d --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupplies.cs @@ -0,0 +1,48 @@ + +using Unity; + +namespace ProjectOpticsStore.Forms; + +public partial class FormSupplies : Form +{ + private readonly IUnityContainer _container; + private readonly ISupplyRepository _supplyRepository; + + public FormSupplies(IUnityContainer container, ISupplyRepository supplyRepository) + { + InitializeComponent(); + _container = container ?? throw new ArgumentNullException(nameof(container)); + _supplyRepository = supplyRepository ?? throw new ArgumentNullException(nameof(supplyRepository)); + } + + private void FormSupplies_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().ShowDialog(); + LoadList(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void LoadList() + { + // Загрузка списка поставок в DataGridView + dataGridViewSupplies.DataSource = _supplyRepository.ReadSupplies().ToList(); + } +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupplies.resx b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupplies.resx new file mode 100644 index 0000000..8b2ff64 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupplies.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupply.Designer.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupply.Designer.cs new file mode 100644 index 0000000..2b25c50 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupply.Designer.cs @@ -0,0 +1,168 @@ +namespace ProjectOpticsStore.Forms +{ + partial class FormSupply + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + comboBoxStore = new ComboBox(); + comboBoxProduct = new ComboBox(); + numericUpDownQuantity = new NumericUpDown(); + dateTimePickerOperationDate = new DateTimePicker(); + buttonSave = new Button(); + buttonCancel = new Button(); + label1 = new Label(); + label2 = new Label(); + label3 = new Label(); + label4 = new Label(); + ((System.ComponentModel.ISupportInitialize)numericUpDownQuantity).BeginInit(); + SuspendLayout(); + // + // comboBoxStore + // + comboBoxStore.DropDownStyle = ComboBoxStyle.DropDownList; + comboBoxStore.FormattingEnabled = true; + comboBoxStore.Location = new Point(148, 12); + comboBoxStore.Name = "comboBoxStore"; + comboBoxStore.Size = new Size(288, 28); + comboBoxStore.TabIndex = 9; + // + // comboBoxProduct + // + comboBoxProduct.DropDownStyle = ComboBoxStyle.DropDownList; + comboBoxProduct.FormattingEnabled = true; + comboBoxProduct.Location = new Point(148, 85); + comboBoxProduct.Name = "comboBoxProduct"; + comboBoxProduct.Size = new Size(288, 28); + comboBoxProduct.TabIndex = 10; + // + // numericUpDownQuantity + // + numericUpDownQuantity.Location = new Point(148, 157); + numericUpDownQuantity.Name = "numericUpDownQuantity"; + numericUpDownQuantity.Size = new Size(150, 27); + numericUpDownQuantity.TabIndex = 11; + // + // dateTimePickerOperationDate + // + dateTimePickerOperationDate.Enabled = false; + dateTimePickerOperationDate.Location = new Point(148, 233); + dateTimePickerOperationDate.Name = "dateTimePickerOperationDate"; + dateTimePickerOperationDate.Size = new Size(250, 27); + dateTimePickerOperationDate.TabIndex = 12; + // + // buttonSave + // + buttonSave.Location = new Point(44, 371); + buttonSave.Name = "buttonSave"; + buttonSave.Size = new Size(124, 40); + buttonSave.TabIndex = 13; + buttonSave.Text = "Сохранить"; + buttonSave.UseVisualStyleBackColor = true; + buttonSave.Click += ButtonSave_Click; + // + // buttonCancel + // + buttonCancel.Location = new Point(204, 371); + buttonCancel.Name = "buttonCancel"; + buttonCancel.Size = new Size(124, 40); + buttonCancel.TabIndex = 14; + buttonCancel.Text = "Отмена"; + buttonCancel.UseVisualStyleBackColor = true; + buttonCancel.Click += ButtonCancel_Click; + // + // label1 + // + label1.AutoSize = true; + label1.Location = new Point(44, 15); + label1.Name = "label1"; + label1.Size = new Size(72, 20); + label1.TabIndex = 15; + label1.Text = "Магазин:"; + // + // label2 + // + label2.AutoSize = true; + label2.Location = new Point(44, 85); + label2.Name = "label2"; + label2.Size = new Size(54, 20); + label2.TabIndex = 16; + label2.Text = "Товар:"; + // + // label3 + // + label3.AutoSize = true; + label3.Location = new Point(44, 159); + label3.Name = "label3"; + label3.Size = new Size(93, 20); + label3.TabIndex = 17; + label3.Text = "Количество:"; + // + // label4 + // + label4.AutoSize = true; + label4.Location = new Point(44, 238); + label4.Name = "label4"; + label4.Size = new Size(89, 20); + label4.TabIndex = 18; + label4.Text = "ДатаВремя:"; + // + // FormSupply + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(598, 450); + Controls.Add(label4); + Controls.Add(label3); + Controls.Add(label2); + Controls.Add(label1); + Controls.Add(buttonCancel); + Controls.Add(buttonSave); + Controls.Add(dateTimePickerOperationDate); + Controls.Add(numericUpDownQuantity); + Controls.Add(comboBoxProduct); + Controls.Add(comboBoxStore); + Name = "FormSupply"; + Text = "Поставка"; + ((System.ComponentModel.ISupportInitialize)numericUpDownQuantity).EndInit(); + ResumeLayout(false); + PerformLayout(); + } + + #endregion + + private ComboBox comboBoxStore; + private ComboBox comboBoxProduct; + private NumericUpDown numericUpDownQuantity; + private DateTimePicker dateTimePickerOperationDate; + private Button buttonSave; + private Button buttonCancel; + private Label label1; + private Label label2; + private Label label3; + private Label label4; + } +} \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupply.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupply.cs new file mode 100644 index 0000000..b479f61 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupply.cs @@ -0,0 +1,67 @@ +using ProjectOpticsStore.Entities; +using ProjectOpticsStore.Repositories; + +namespace ProjectOpticsStore.Forms; + +public partial class FormSupply : Form +{ + private readonly ISupplyRepository _supplyRepository; + private readonly IStoreRepository _storeRepository; + private readonly IProductRepository _productRepository; + + public FormSupply(ISupplyRepository supplyRepository, IStoreRepository storeRepository, IProductRepository productRepository) + { + InitializeComponent(); + _supplyRepository = supplyRepository ?? throw new ArgumentNullException(nameof(supplyRepository)); + _storeRepository = storeRepository ?? throw new ArgumentNullException(nameof(storeRepository)); + _productRepository = productRepository ?? throw new ArgumentNullException(nameof(productRepository)); + + // Инициализация ComboBox для магазинов + comboBoxStore.DataSource = _storeRepository.ReadStores().ToList(); + comboBoxStore.DisplayMember = "Address"; + comboBoxStore.ValueMember = "Id"; + + // Инициализация ComboBox для товаров + comboBoxProduct.DataSource = _productRepository.ReadProducts().ToList(); + comboBoxProduct.DisplayMember = "Name"; + comboBoxProduct.ValueMember = "Id"; + + // Устанавливаем дату как текущую и блокируем редактирование + dateTimePickerOperationDate.Value = DateTime.Now; + dateTimePickerOperationDate.Enabled = false; + } + + private void ButtonSave_Click(object sender, EventArgs e) + { + try + { + // Проверка на заполненность полей + if (comboBoxStore.SelectedIndex < 0 || comboBoxProduct.SelectedIndex < 0) + { + throw new Exception("Имеются незаполненные поля"); + } + + // Создание новой поставки + var supply = Supply.CreateOperation( + id: 0, // Новый объект, идентификатор пока 0 + storeId: (int)comboBoxStore.SelectedValue!, + productId: (int)comboBoxProduct.SelectedValue!, + quantity: (int)numericUpDownQuantity.Value + ); + + _supplyRepository.CreateSupply(supply); + + MessageBox.Show("Поставка успешно добавлена", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); + Close(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ButtonCancel_Click(object sender, EventArgs e) + { + Close(); + } +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupply.resx b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupply.resx new file mode 100644 index 0000000..8b2ff64 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupply.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Program.cs b/ProjectOpticsStore/ProjectOpticsStore/Program.cs index 16b92ba..d5c6142 100644 --- a/ProjectOpticsStore/ProjectOpticsStore/Program.cs +++ b/ProjectOpticsStore/ProjectOpticsStore/Program.cs @@ -1,9 +1,14 @@ +using ProjectOpticsStore.Repositories; +using ProjectOpticsStore.Repositories.Implementations; +using Unity; +using Unity.Lifetime; + namespace ProjectOpticsStore { internal static class Program { /// - /// The main entry point for the application. + /// The main entry point for the application. /// [STAThread] static void Main() @@ -11,7 +16,17 @@ namespace ProjectOpticsStore // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. ApplicationConfiguration.Initialize(); - Application.Run(new Form1()); + Application.Run(CreateContainer().Resolve()); + } + private static IUnityContainer CreateContainer() + { + var container = new UnityContainer(); + container.RegisterType(new TransientLifetimeManager()); + container.RegisterType(new TransientLifetimeManager()); + container.RegisterType(new TransientLifetimeManager()); + container.RegisterType(new TransientLifetimeManager()); + container.RegisterType(new TransientLifetimeManager()); + return container; } } } \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/ProjectOpticsStore.csproj b/ProjectOpticsStore/ProjectOpticsStore/ProjectOpticsStore.csproj index 663fdb8..e5042c8 100644 --- a/ProjectOpticsStore/ProjectOpticsStore/ProjectOpticsStore.csproj +++ b/ProjectOpticsStore/ProjectOpticsStore/ProjectOpticsStore.csproj @@ -8,4 +8,27 @@ enable + + + + + + + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Properties/DataSources/Order.datasource b/ProjectOpticsStore/ProjectOpticsStore/Properties/DataSources/Order.datasource new file mode 100644 index 0000000..a3b0189 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Properties/DataSources/Order.datasource @@ -0,0 +1,10 @@ + + + + Order, ProjectOpticsStore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Properties/Resources.Designer.cs b/ProjectOpticsStore/ProjectOpticsStore/Properties/Resources.Designer.cs new file mode 100644 index 0000000..90e0222 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Properties/Resources.Designer.cs @@ -0,0 +1,103 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +namespace ProjectOpticsStore.Properties { + using System; + + + /// + /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. + /// + // Этот класс создан автоматически классом 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() { + } + + /// + /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. + /// + [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("ProjectOpticsStore.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Перезаписывает свойство CurrentUICulture текущего потока для всех + /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Button_Add { + get { + object obj = ResourceManager.GetObject("Button_Add", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Button_Delete { + get { + object obj = ResourceManager.GetObject("Button_Delete", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Button_Edit { + get { + object obj = ResourceManager.GetObject("Button_Edit", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap catwithglasses { + get { + object obj = ResourceManager.GetObject("catwithglasses", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Properties/Resources.resx b/ProjectOpticsStore/ProjectOpticsStore/Properties/Resources.resx new file mode 100644 index 0000000..62dec7d --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Properties/Resources.resx @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\Button_Edit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\catwithglasses.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Button_Add.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Button_Delete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Repositories/ICustomerRepository.cs b/ProjectOpticsStore/ProjectOpticsStore/Repositories/ICustomerRepository.cs new file mode 100644 index 0000000..4818c15 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Repositories/ICustomerRepository.cs @@ -0,0 +1,12 @@ +using ProjectOpticsStore.Entities; + +namespace ProjectOpticsStore.Repositories; + +public interface ICustomerRepository +{ + IEnumerable ReadCustomers(); + Customer ReadCustomerById(int id); + void CreateCustomer(Customer customer); + void UpdateCustomer(Customer customer); + void DeleteCustomer(int id); +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Repositories/IOrderRepository.cs b/ProjectOpticsStore/ProjectOpticsStore/Repositories/IOrderRepository.cs new file mode 100644 index 0000000..0b0da2c --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Repositories/IOrderRepository.cs @@ -0,0 +1,12 @@ +namespace ProjectOpticsStore.Repositories; + +public interface IOrderRepository +{ + IEnumerable ReadOrders( + DateTime? dateFrom = null, + DateTime? dateTo = null, + int? customerId = null + ); + void CreateOrder(Order order); + void DeleteOrder(int id); +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Repositories/IProductRepository.cs b/ProjectOpticsStore/ProjectOpticsStore/Repositories/IProductRepository.cs new file mode 100644 index 0000000..0f99d1a --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Repositories/IProductRepository.cs @@ -0,0 +1,10 @@ +namespace ProjectOpticsStore.Repositories; + +public interface IProductRepository +{ + IEnumerable ReadProducts(); + Product ReadProductById(int id); + void CreateProduct(Product product); + void UpdateProduct(Product product); + void DeleteProduct(int id); +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Repositories/IStoreRepository.cs b/ProjectOpticsStore/ProjectOpticsStore/Repositories/IStoreRepository.cs new file mode 100644 index 0000000..c3c6d1d --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Repositories/IStoreRepository.cs @@ -0,0 +1,12 @@ +using ProjectOpticsStore.Entities; + +namespace ProjectOpticsStore.Repositories; + +public interface IStoreRepository +{ + IEnumerable ReadStores(); + Store ReadStoreById(int id); + void CreateStore(Store store); + void UpdateStore(Store store); + void DeleteStore(int id); +} \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Repositories/ISupplyRepository.cs b/ProjectOpticsStore/ProjectOpticsStore/Repositories/ISupplyRepository.cs new file mode 100644 index 0000000..16be7fa --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Repositories/ISupplyRepository.cs @@ -0,0 +1,13 @@ +using ProjectOpticsStore.Entities; + +public interface ISupplyRepository +{ + IEnumerable ReadSupplies( + DateTime? dateFrom = null, + DateTime? dateTo = null, + int? storeId = null, + int? productId = null + ); + + void CreateSupply(Supply supply); +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Repositories/Implementations/CustomerRepository.cs b/ProjectOpticsStore/ProjectOpticsStore/Repositories/Implementations/CustomerRepository.cs new file mode 100644 index 0000000..f70a461 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Repositories/Implementations/CustomerRepository.cs @@ -0,0 +1,28 @@ +using ProjectOpticsStore.Entities; + +namespace ProjectOpticsStore.Repositories.Implementations; + +internal class CustomerRepository : ICustomerRepository +{ + public void CreateCustomer(Customer customer) + { + } + + public void DeleteCustomer(int id) + { + } + + public Customer ReadCustomerById(int id) + { + return Customer.CreateEntity(0, string.Empty); + } + + public IEnumerable ReadCustomers() + { + return []; + } + + public void UpdateCustomer(Customer customer) + { + } +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Repositories/Implementations/OrderRepository.cs b/ProjectOpticsStore/ProjectOpticsStore/Repositories/Implementations/OrderRepository.cs new file mode 100644 index 0000000..be3008c --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Repositories/Implementations/OrderRepository.cs @@ -0,0 +1,17 @@ +namespace ProjectOpticsStore.Repositories.Implementations; + +internal class OrderRepository : IOrderRepository +{ + public void CreateOrder(Order order) + { + } + + public void DeleteOrder(int id) + { + } + + public IEnumerable ReadOrders(DateTime? dateFrom = null, DateTime? dateTo = null, int? customerId = null) + { + return []; + } +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Repositories/Implementations/ProductRepository.cs b/ProjectOpticsStore/ProjectOpticsStore/Repositories/Implementations/ProductRepository.cs new file mode 100644 index 0000000..2c312cd --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Repositories/Implementations/ProductRepository.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ProjectOpticsStore.Entities.Enums; + +namespace ProjectOpticsStore.Repositories.Implementations; + +internal class ProductRepository : IProductRepository +{ + public void CreateProduct(Product product) + { + } + + public void DeleteProduct(int id) + { + } + + public Product ReadProductById(int id) + { + return Product.CreateEntity(0, ProductTypeEnum.None, 0, 0, 0, 0, string.Empty); + } + + public IEnumerable ReadProducts() + { + return []; + } + + public void UpdateProduct(Product product) + { + } +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Repositories/Implementations/StoreRepository.cs b/ProjectOpticsStore/ProjectOpticsStore/Repositories/Implementations/StoreRepository.cs new file mode 100644 index 0000000..f22c8a9 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Repositories/Implementations/StoreRepository.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ProjectOpticsStore.Entities; +using ProjectOpticsStore.Entities.Enums; +namespace ProjectOpticsStore.Repositories.Implementations; + +internal class StoreRepository : IStoreRepository +{ + public void CreateStore(Store store) + { + } + + public void DeleteStore(int id) + { + } + + public Store ReadStoreById(int id) + { + return Store.CreateEntity(0, string.Empty); + } + + public IEnumerable ReadStores() + { + return []; + } + + public void UpdateStore(Store store) + { + } +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Repositories/Implementations/SupplyRepository.cs b/ProjectOpticsStore/ProjectOpticsStore/Repositories/Implementations/SupplyRepository.cs new file mode 100644 index 0000000..536ed71 --- /dev/null +++ b/ProjectOpticsStore/ProjectOpticsStore/Repositories/Implementations/SupplyRepository.cs @@ -0,0 +1,15 @@ +using ProjectOpticsStore.Entities; + +namespace ProjectOpticsStore.Repositories.Implementations; + +internal class SupplyRepository : ISupplyRepository +{ + public void CreateSupply(Supply supply) + { + } + + public IEnumerable ReadSupplies(DateTime? dateFrom = null, DateTime? dateTo = null, int? storeId = null, int? productId = null) + { + return []; + } +} diff --git a/ProjectOpticsStore/ProjectOpticsStore/Resources/Button_Add.png b/ProjectOpticsStore/ProjectOpticsStore/Resources/Button_Add.png new file mode 100644 index 0000000000000000000000000000000000000000..0015091bda64006e994a85641fd26ff6846ea415 GIT binary patch literal 12503 zcmXY21ymGY+}&NeyIZ2d71_6!|Z!C02RpCQgF?8t^3Ynn0HIWD5?EWo6^=N2IzU@|#2@OBI%z z7MI|W)XSn~31ea`W`GzqF|#jicLiSNPt-wzYR_c`J&de;oVC1(PKGd67T)0pmiJO$38>CLplB0 z>rr7?wE)rV7anL}i#w1v2>GNdDwy|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 z0h|6|`L)irk1mfeFCH+P{N2S${xtHlU|IJcqH`)0SId(S+?<0qlU_iRDN$j zZ*W(aNS1(!Vg3$%TXS;$u2xJLM5lLalF*3T9OxFayvN-oYWa{F?JhAOEg0j`*SauN ztw&Q{PI8DK^^o*e>G)6C#G?T(o@wHo9p9Z+$l%Zz?~DlQ*w|wuw3LkWZT2zV>r7#+iZ%s!SSu2vTN5O3fMzAt82i z87gT8x|H?Qu$r6X*df?v2(g5Z*u75^hwZQa*kKN)&e@|fDK3i8?KAijGL)`ZxF2W8 zIEXfIKzMrTvJM|`$^{d?Mzus}0Iz$#YeqJ7VU|Jczg5&htjU46804(CGF4&2jVYJMqz zmCO~M6tUOcqOPM>qg;Tww7$U5Qaq43odTXm$tsa`v%~F-Wbt^caJxv2o1J@})n)T-0 zawto3Jip%S1Wigr7TVDao)*=WHr&Ea9!4C*uk0CquTIJOeGChe7rr($41wb|c~DW~ zZ4|VC_3r?1Un_^*!@Ydo2yN<3e#mK-Is9KhM2&{Q&V%k>d^0s(VcZDT|J@T#AAyD< Xjj>1MlxFBZ696j88cIK3T1EU1nerXo literal 0 HcmV?d00001 diff --git a/ProjectOpticsStore/ProjectOpticsStore/Resources/Button_Delete.png b/ProjectOpticsStore/ProjectOpticsStore/Resources/Button_Delete.png new file mode 100644 index 0000000000000000000000000000000000000000..156cc9ad457f906de101f61cc2600d5f9ea8c692 GIT binary patch literal 20893 zcmYIw1yCH#^Y(E_aJS&@?(Xgy91fS@?(Xgo+%3T&1ef3*B)D5}_XGa-{;IzEw(4qc z_WF8yyXU5Ro@e%A)Kp|q5D5?g004@-oRkIt00nsq1%QWxoD5y7tRN>CHwk$yc*x-o zZxIb?BRI?Hxd8yEga5stG8j<_0RS?9yp*_>civgPmp|cBMpdsM=RYziPmPiq>hBYo z2L(-@yUWL8R$k4G#DW3MD_kRqesO-vdHejE7LWYGjcLl8R{1BX%4bG8dPAwydJ#40 zQjKZ<`X<*OKOu^vgRta+2mN1+OxgO7FAO)`F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20=D0=BC?= =?UTF-8?q?=D0=B0=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD=D0=BE=D0=B2,=20=D0=B0=20?= =?UTF-8?q?=D0=BD=D0=B5=20ID=20=D0=9C=D0=B0=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD?= =?UTF-8?q?=D1=8B=20=D0=BF=D1=80=D0=B8=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83?= =?UTF-8?q?=D0=B7=D0=BA=D0=B5=20=D1=84=D0=BE=D1=80=D0=BC=D1=8B=20=D1=82?= =?UTF-8?q?=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20=D0=BF=D1=80=D0=BE=D0=B3=D1=80?= =?UTF-8?q?=D1=83=D0=B6=D0=B0=D1=8E=D1=82=D1=81=D1=8F=20(Load=20+=3D=20?= =?UTF-8?q?=D0=B2=20=D0=B4=D0=B8=D0=B7=D0=B0=D0=B9=D0=BD=D0=B5=D1=80=D0=B5?= =?UTF-8?q?).=20AutoResizeColumn=20-=20Fill=20=D0=B4=D0=BB=D1=8F=20=D0=B4?= =?UTF-8?q?=D0=B8=D0=B7=D0=B0=D0=B9=D0=BD=D0=B5=D1=80=D0=BE=D0=B2=20=D1=84?= =?UTF-8?q?=D0=BE=D1=80=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectOpticsStore/Entities/Product.cs | 6 ++--- .../Forms/FormCustomers.Designer.cs | 1 + .../ProjectOpticsStore/Forms/FormCustomers.cs | 1 - .../Forms/FormOrders.Designer.cs | 1 + .../ProjectOpticsStore/Forms/FormOrders.cs | 3 --- .../Forms/FormProduct.Designer.cs | 22 ++++++++++--------- .../ProjectOpticsStore/Forms/FormProduct.cs | 6 ++--- .../Forms/FormProducts.Designer.cs | 1 + .../Forms/FormStores.Designer.cs | 2 ++ .../Forms/FormSupplies.Designer.cs | 1 + 10 files changed, 24 insertions(+), 20 deletions(-) diff --git a/ProjectOpticsStore/ProjectOpticsStore/Entities/Product.cs b/ProjectOpticsStore/ProjectOpticsStore/Entities/Product.cs index bc14611..d80ea3b 100644 --- a/ProjectOpticsStore/ProjectOpticsStore/Entities/Product.cs +++ b/ProjectOpticsStore/ProjectOpticsStore/Entities/Product.cs @@ -6,11 +6,11 @@ public class Product public ProductTypeEnum Type { get; private set; } public double Power { get; private set; } public int Price { get; private set; } - public int StoreId { get; private set; } + public int Store { get; private set; } public float Thickness { get; private set; } public string Disease { get; private set; } = string.Empty; - public static Product CreateEntity(int id, ProductTypeEnum type, double power, int price, int storeId, float thickness, string disease) + public static Product CreateEntity(int id, ProductTypeEnum type, double power, int price, int store, float thickness, string disease) { return new Product { @@ -18,7 +18,7 @@ public class Product Type = type, Power = power, Price = price, - StoreId = storeId, + Store = store, Thickness = thickness, Disease = disease ?? string.Empty }; diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomers.Designer.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomers.Designer.cs index 23a697d..12090e8 100644 --- a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomers.Designer.cs +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomers.Designer.cs @@ -85,6 +85,7 @@ // dataGridViewData.AllowUserToAddRows = false; dataGridViewData.AllowUserToDeleteRows = false; + dataGridViewData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; dataGridViewData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; dataGridViewData.Dock = DockStyle.Fill; dataGridViewData.Location = new Point(0, 0); diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomers.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomers.cs index 098e594..fb421c0 100644 --- a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomers.cs +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormCustomers.cs @@ -1,5 +1,4 @@ using ProjectOpticsStore.Repositories; -using ProjectOpticsStore.Repositories.Implementations; using Unity; namespace ProjectOpticsStore.Forms; diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrders.Designer.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrders.Designer.cs index 052b7fc..8c8ba74 100644 --- a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrders.Designer.cs +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrders.Designer.cs @@ -72,6 +72,7 @@ // dataGridViewOrders.AllowUserToAddRows = false; dataGridViewOrders.AllowUserToDeleteRows = false; + dataGridViewOrders.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; dataGridViewOrders.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; dataGridViewOrders.Dock = DockStyle.Fill; dataGridViewOrders.Location = new Point(0, 0); diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrders.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrders.cs index 8980d0b..5b6f721 100644 --- a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrders.cs +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormOrders.cs @@ -1,7 +1,4 @@ using ProjectOpticsStore.Repositories; -using ProjectOpticsStore.Entities; -using ProjectOpticsStore.Repositories.Implementations; - namespace ProjectOpticsStore.Forms; public partial class FormOrders : Form diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProduct.Designer.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProduct.Designer.cs index a379967..b920a82 100644 --- a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProduct.Designer.cs +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProduct.Designer.cs @@ -39,9 +39,9 @@ label6 = new Label(); textBoxPower = new TextBox(); textBoxPrice = new TextBox(); - textBoxStoreID = new TextBox(); textBoxThickness = new TextBox(); textBoxDisease = new TextBox(); + comboBoxStore = new ComboBox(); SuspendLayout(); // // buttonSave @@ -140,13 +140,6 @@ textBoxPrice.Size = new Size(254, 27); textBoxPrice.TabIndex = 12; // - // textBoxStoreID - // - textBoxStoreID.Location = new Point(157, 284); - textBoxStoreID.Name = "textBoxStoreID"; - textBoxStoreID.Size = new Size(254, 27); - textBoxStoreID.TabIndex = 13; - // // textBoxThickness // textBoxThickness.Location = new Point(157, 349); @@ -162,14 +155,23 @@ textBoxDisease.Size = new Size(254, 67); textBoxDisease.TabIndex = 15; // + // comboBoxStore + // + comboBoxStore.DropDownStyle = ComboBoxStyle.DropDownList; + comboBoxStore.FormattingEnabled = true; + comboBoxStore.Location = new Point(157, 287); + comboBoxStore.Name = "comboBoxStore"; + comboBoxStore.Size = new Size(254, 28); + comboBoxStore.TabIndex = 16; + // // FormProduct // AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size(436, 545); + Controls.Add(comboBoxStore); Controls.Add(textBoxDisease); Controls.Add(textBoxThickness); - Controls.Add(textBoxStoreID); Controls.Add(textBoxPrice); Controls.Add(textBoxPower); Controls.Add(label6); @@ -200,8 +202,8 @@ private Label label6; private TextBox textBoxPower; private TextBox textBoxPrice; - private TextBox textBoxStoreID; private TextBox textBoxThickness; private TextBox textBoxDisease; + private ComboBox comboBoxStore; } } \ No newline at end of file diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProduct.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProduct.cs index 72069c6..3381bda 100644 --- a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProduct.cs +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProduct.cs @@ -34,7 +34,7 @@ public partial class FormProduct : Form // Заполнение текстовых полей textBoxPower.Text = product.Power.ToString(); textBoxPrice.Text = product.Price.ToString(); - textBoxStoreID.Text = product.StoreId.ToString(); + comboBoxStore.Text = product.Store.ToString(); textBoxThickness.Text = product.Thickness.ToString("F2"); textBoxDisease.Text = product.Disease; @@ -68,7 +68,7 @@ public partial class FormProduct : Form if (checkedListBoxProductType.CheckedItems.Count == 0 || string.IsNullOrWhiteSpace(textBoxPower.Text) || string.IsNullOrWhiteSpace(textBoxPrice.Text) || - string.IsNullOrWhiteSpace(textBoxStoreID.Text) || + string.IsNullOrWhiteSpace(comboBoxStore.Text) || string.IsNullOrWhiteSpace(textBoxThickness.Text)) { throw new Exception("Имеются незаполненные поля."); @@ -109,7 +109,7 @@ public partial class FormProduct : Form productType, double.Parse(textBoxPower.Text), int.Parse(textBoxPrice.Text), - int.Parse(textBoxStoreID.Text), + int.Parse(comboBoxStore.Text), float.Parse(textBoxThickness.Text), textBoxDisease.Text ); diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProducts.Designer.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProducts.Designer.cs index 890564a..80299ff 100644 --- a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProducts.Designer.cs +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormProducts.Designer.cs @@ -85,6 +85,7 @@ // dataGridViewProducts.AllowUserToAddRows = false; dataGridViewProducts.AllowUserToDeleteRows = false; + dataGridViewProducts.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; dataGridViewProducts.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; dataGridViewProducts.Dock = DockStyle.Fill; dataGridViewProducts.Location = new Point(0, 0); diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormStores.Designer.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormStores.Designer.cs index aff9d97..b8546b4 100644 --- a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormStores.Designer.cs +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormStores.Designer.cs @@ -85,6 +85,7 @@ // dataGridViewStores.AllowUserToAddRows = false; dataGridViewStores.AllowUserToDeleteRows = false; + dataGridViewStores.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; dataGridViewStores.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; dataGridViewStores.Dock = DockStyle.Fill; dataGridViewStores.Location = new Point(0, 0); @@ -105,6 +106,7 @@ Controls.Add(panelButtons); Name = "FormStores"; Text = "Так сказать магазины"; + Load += FormStores_Load; panelButtons.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)dataGridViewStores).EndInit(); ResumeLayout(false); diff --git a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupplies.Designer.cs b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupplies.Designer.cs index 94fba8a..2945ac1 100644 --- a/ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupplies.Designer.cs +++ b/ProjectOpticsStore/ProjectOpticsStore/Forms/FormSupplies.Designer.cs @@ -59,6 +59,7 @@ // dataGridViewSupplies.AllowUserToAddRows = false; dataGridViewSupplies.AllowUserToDeleteRows = false; + dataGridViewSupplies.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; dataGridViewSupplies.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; dataGridViewSupplies.Dock = DockStyle.Fill; dataGridViewSupplies.Location = new Point(0, 0); -- 2.25.1