From 46c4c1441fc4c02923a0d8818213c56e8ba7a725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D0=B8=D1=80=20=D0=9D=D1=83=D0=B3=D0=B0?= =?UTF-8?q?=D0=B5=D0=B2?= Date: Sat, 3 Jun 2023 23:24:13 +0400 Subject: [PATCH] LabWorkHard01 --- .../BusinessLogic/ShopLogic.cs | 12 + .../BindingModels/ShopBindingModel.cs | 12 + .../BusinessLogicsContracts/IShopLogic.cs | 12 + .../SearchModels/ShopSearchModel.cs | 12 + .../StoragesContracts/IShopStorage.cs | 12 + .../ViewModels/ShopViewModel.cs | 26 ++ .../Models/IShopModel.cs | 25 ++ .../DataListSingleton.cs | 54 +-- .../Implements/ShopStorage.cs | 128 +++++++ .../Models/Shop.cs | 12 + .../FormAddManufacture.Designer.cs | 39 ++ .../FormAddManufacture.cs | 20 + .../FormAddManufacture.resx | 120 ++++++ .../FormMain.Designer.cs | 362 ++++++++++-------- .../BlacksmithWorkshopView/FormMain.cs | 300 ++++++++------- .../FormShop.Designer.cs | 39 ++ .../BlacksmithWorkshopView/FormShop.cs | 20 + .../BlacksmithWorkshopView/FormShop.resx | 120 ++++++ .../FormShops.Designer.cs | 39 ++ .../BlacksmithWorkshopView/FormShops.cs | 20 + .../BlacksmithWorkshopView/FormShops.resx | 120 ++++++ .../BlacksmithWorkshopView/Program.cs | 87 +++-- 22 files changed, 1220 insertions(+), 371 deletions(-) create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogic/ShopLogic.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopContracts/BindingModels/ShopBindingModel.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopContracts/BusinessLogicsContracts/IShopLogic.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopContracts/SearchModels/ShopSearchModel.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopContracts/StoragesContracts/IShopStorage.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ShopViewModel.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopDataModels/Models/IShopModel.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopListImplement/Implements/ShopStorage.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopListImplement/Models/Shop.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopView/FormAddManufacture.Designer.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopView/FormAddManufacture.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopView/FormAddManufacture.resx create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopView/FormShop.Designer.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopView/FormShop.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopView/FormShop.resx create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopView/FormShops.Designer.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopView/FormShops.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopView/FormShops.resx diff --git a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogic/ShopLogic.cs b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogic/ShopLogic.cs new file mode 100644 index 0000000..f124753 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogic/ShopLogic.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopBusinessLogic.BusinessLogic +{ + internal class ShopLogic + { + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/BindingModels/ShopBindingModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BindingModels/ShopBindingModel.cs new file mode 100644 index 0000000..b442a18 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BindingModels/ShopBindingModel.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopContracts.BindingModels +{ + internal class ShopBindingModel + { + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/BusinessLogicsContracts/IShopLogic.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BusinessLogicsContracts/IShopLogic.cs new file mode 100644 index 0000000..da751d8 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BusinessLogicsContracts/IShopLogic.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopContracts.BusinessLogicsContracts +{ + internal class IShopLogic + { + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/SearchModels/ShopSearchModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/SearchModels/ShopSearchModel.cs new file mode 100644 index 0000000..12e9b4e --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/SearchModels/ShopSearchModel.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopContracts.SearchModels +{ + internal class ShopSearchModel + { + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/StoragesContracts/IShopStorage.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/StoragesContracts/IShopStorage.cs new file mode 100644 index 0000000..d4ca333 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/StoragesContracts/IShopStorage.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopContracts.StoragesContracts +{ + internal class IShopStorage + { + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ShopViewModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ShopViewModel.cs new file mode 100644 index 0000000..08b7fc2 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ShopViewModel.cs @@ -0,0 +1,26 @@ +using BlacksmithWorkshopDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopContracts.ViewModels +{ + public class ShopViewModel + { + public int Id { get; set; } + + [DisplayName("Название магазина")] + public string ShopName { get; set; } = string.Empty; + + [DisplayName("Адрес магазина")] + public string Address { get; set; } = string.Empty; + + [DisplayName("Дата открытия")] + public DateTime DateOpen { get; set; } = DateTime.Now; + + public Dictionary Manufactures { get; set; } = new(); + } +} \ No newline at end of file diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDataModels/Models/IShopModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopDataModels/Models/IShopModel.cs new file mode 100644 index 0000000..bec2496 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopDataModels/Models/IShopModel.cs @@ -0,0 +1,25 @@ +using BlacksmithWorkshopDataModels.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopDataModels.Models +{ + //интерфес сущности "Магазин" + public interface IShopModel : IId + { + //название магазина + string ShopName { get; } + + //адрес магазина + string Address { get; } + + //дата открытия магазина + DateTime DateOpen { get; } + + //изделия в магазине + Dictionary Manufactures { get; } + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopListImplement/DataListSingleton.cs b/BlacksmithWorkshop/BlacksmithWorkshopListImplement/DataListSingleton.cs index 9ee2626..a509749 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopListImplement/DataListSingleton.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopListImplement/DataListSingleton.cs @@ -7,35 +7,39 @@ using System.Threading.Tasks; namespace BlacksmithWorkshopListImplement { - //класс для списков, в которых будет храниться информация при работе приложения - public class DataListSingleton - { - private static DataListSingleton? _instance; + //класс для списков, в которых будет храниться информация при работе приложения + public class DataListSingleton + { + private static DataListSingleton? _instance; - //список для хранения заготовок - public List WorkPieces { get; set; } + //список для хранения заготовок + public List WorkPieces { get; set; } - //список для хранения изделий - public List Manufactures { get; set; } + //список для хранения изделий + public List Manufactures { get; set; } - //список для хранения заказов - public List Orders { get; set; } + //список для хранения заказов + public List Orders { get; set; } - public DataListSingleton() - { - WorkPieces = new List(); - Manufactures = new List(); - Orders = new List(); - } + //список для хранения Магазинов + public List Shops { get; set; } - public static DataListSingleton GetInstance() - { - if (_instance == null) - { - _instance = new DataListSingleton(); - } + public DataListSingleton() + { + WorkPieces = new List(); + Manufactures = new List(); + Orders = new List(); + Shops = new List(); + } - return _instance; - } - } + public static DataListSingleton GetInstance() + { + if (_instance == null) + { + _instance = new DataListSingleton(); + } + + return _instance; + } + } } \ No newline at end of file diff --git a/BlacksmithWorkshop/BlacksmithWorkshopListImplement/Implements/ShopStorage.cs b/BlacksmithWorkshop/BlacksmithWorkshopListImplement/Implements/ShopStorage.cs new file mode 100644 index 0000000..d8256be --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopListImplement/Implements/ShopStorage.cs @@ -0,0 +1,128 @@ +using BlacksmithWorkshopContracts.BindingModels; +using BlacksmithWorkshopContracts.SearchModels; +using BlacksmithWorkshopContracts.StoragesContracts; +using BlacksmithWorkshopContracts.ViewModels; +using BlacksmithWorkshopListImplement.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopListImplement.Implements +{ + public class ShopStorage : IShopStorage + { + private readonly DataListSingleton _source; + + public ShopStorage() + { + _source = DataListSingleton.GetInstance(); + } + + public ShopViewModel? GetElement(ShopSearchModel model) + { + if (string.IsNullOrEmpty(model.ShopName) && !model.Id.HasValue) + { + return null; + } + + foreach (var shop in _source.Shops) + { + if ((!string.IsNullOrEmpty(model.ShopName) && shop.ShopName == model.ShopName) || (model.Id.HasValue && shop.Id == model.Id)) + { + return shop.GetViewModel; + } + } + + return null; + } + + public List GetFilteredList(ShopSearchModel model) + { + var result = new List(); + + if (string.IsNullOrEmpty(model.ShopName)) + { + return result; + } + + foreach (var shop in _source.Shops) + { + if (shop.ShopName.Contains(model.ShopName)) + { + result.Add(shop.GetViewModel); + } + } + + return result; + } + + public List GetFullList() + { + var result = new List(); + + foreach (var shop in _source.Shops) + { + result.Add(shop.GetViewModel); + } + + return result; + } + + public ShopViewModel? Insert(ShopBindingModel model) + { + model.Id = 1; + + foreach (var shop in _source.Shops) + { + if (model.Id <= shop.Id) + { + model.Id = shop.Id + 1; + } + } + + var newShop = Shop.Create(model); + + if (newShop == null) + { + return null; + } + + _source.Shops.Add(newShop); + + return newShop.GetViewModel; + } + + public ShopViewModel? Update(ShopBindingModel model) + { + foreach (var shop in _source.Shops) + { + if (shop.Id == model.Id) + { + shop.Update(model); + + return shop.GetViewModel; + } + } + + return null; + } + + public ShopViewModel? Delete(ShopBindingModel model) + { + for (int i = 0; i < _source.Shops.Count; ++i) + { + if (_source.Shops[i].Id == model.Id) + { + var element = _source.Shops[i]; + _source.Shops.RemoveAt(i); + + return element.GetViewModel; + } + } + + return null; + } + } +} \ No newline at end of file diff --git a/BlacksmithWorkshop/BlacksmithWorkshopListImplement/Models/Shop.cs b/BlacksmithWorkshop/BlacksmithWorkshopListImplement/Models/Shop.cs new file mode 100644 index 0000000..99c7936 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopListImplement/Models/Shop.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopListImplement.Models +{ + internal class Shop + { + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopView/FormAddManufacture.Designer.cs b/BlacksmithWorkshop/BlacksmithWorkshopView/FormAddManufacture.Designer.cs new file mode 100644 index 0000000..7c2cdd3 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopView/FormAddManufacture.Designer.cs @@ -0,0 +1,39 @@ +namespace BlacksmithWorkshopView +{ + partial class FormAddManufacture + { + /// + /// 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 = "FormAddManufacture"; + } + + #endregion + } +} \ No newline at end of file diff --git a/BlacksmithWorkshop/BlacksmithWorkshopView/FormAddManufacture.cs b/BlacksmithWorkshop/BlacksmithWorkshopView/FormAddManufacture.cs new file mode 100644 index 0000000..26a825d --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopView/FormAddManufacture.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace BlacksmithWorkshopView +{ + public partial class FormAddManufacture : Form + { + public FormAddManufacture() + { + InitializeComponent(); + } + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopView/FormAddManufacture.resx b/BlacksmithWorkshop/BlacksmithWorkshopView/FormAddManufacture.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopView/FormAddManufacture.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/BlacksmithWorkshop/BlacksmithWorkshopView/FormMain.Designer.cs b/BlacksmithWorkshop/BlacksmithWorkshopView/FormMain.Designer.cs index 018e907..b24bdad 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopView/FormMain.Designer.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopView/FormMain.Designer.cs @@ -1,176 +1,204 @@ namespace BlacksmithWorkshop { - partial class FormMain - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; + partial class FormMain + { + /// + /// 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); - } + /// + /// 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 + #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.dataGridView = new System.Windows.Forms.DataGridView(); - this.buttonCreateOrder = new System.Windows.Forms.Button(); - this.buttonTakeOrderInWork = new System.Windows.Forms.Button(); - this.buttonOrderReady = new System.Windows.Forms.Button(); - this.buttonIssuedOrder = new System.Windows.Forms.Button(); - this.buttonRef = new System.Windows.Forms.Button(); - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); - this.toolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.workPieceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.manufactureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); - this.menuStrip1.SuspendLayout(); - this.SuspendLayout(); - // - // dataGridView - // - this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dataGridView.Location = new System.Drawing.Point(12, 36); - this.dataGridView.Name = "dataGridView"; - this.dataGridView.RowHeadersWidth = 51; - this.dataGridView.RowTemplate.Height = 29; - this.dataGridView.Size = new System.Drawing.Size(937, 402); - this.dataGridView.TabIndex = 0; - // - // buttonCreateOrder - // - this.buttonCreateOrder.Location = new System.Drawing.Point(1014, 66); - this.buttonCreateOrder.Name = "buttonCreateOrder"; - this.buttonCreateOrder.Size = new System.Drawing.Size(235, 29); - this.buttonCreateOrder.TabIndex = 1; - this.buttonCreateOrder.Text = "Создать заказ"; - this.buttonCreateOrder.UseVisualStyleBackColor = true; - this.buttonCreateOrder.Click += new System.EventHandler(this.ButtonCreateOrder_Click); - // - // buttonTakeOrderInWork - // - this.buttonTakeOrderInWork.Location = new System.Drawing.Point(1014, 143); - this.buttonTakeOrderInWork.Name = "buttonTakeOrderInWork"; - this.buttonTakeOrderInWork.Size = new System.Drawing.Size(235, 29); - this.buttonTakeOrderInWork.TabIndex = 2; - this.buttonTakeOrderInWork.Text = "Отдать на выполнение"; - this.buttonTakeOrderInWork.UseVisualStyleBackColor = true; - this.buttonTakeOrderInWork.Click += new System.EventHandler(this.ButtonTakeOrderInWork_Click); - // - // buttonOrderReady - // - this.buttonOrderReady.Location = new System.Drawing.Point(1014, 220); - this.buttonOrderReady.Name = "buttonOrderReady"; - this.buttonOrderReady.Size = new System.Drawing.Size(235, 29); - this.buttonOrderReady.TabIndex = 3; - this.buttonOrderReady.Text = "Заказ готов"; - this.buttonOrderReady.UseVisualStyleBackColor = true; - this.buttonOrderReady.Click += new System.EventHandler(this.ButtonOrderReady_Click); - // - // buttonIssuedOrder - // - this.buttonIssuedOrder.Location = new System.Drawing.Point(1014, 296); - this.buttonIssuedOrder.Name = "buttonIssuedOrder"; - this.buttonIssuedOrder.Size = new System.Drawing.Size(235, 29); - this.buttonIssuedOrder.TabIndex = 4; - this.buttonIssuedOrder.Text = "Заказ выдан"; - this.buttonIssuedOrder.UseVisualStyleBackColor = true; - this.buttonIssuedOrder.Click += new System.EventHandler(this.ButtonIssuedOrder_Click); - // - // buttonRef - // - this.buttonRef.Location = new System.Drawing.Point(1014, 369); - this.buttonRef.Name = "buttonRef"; - this.buttonRef.Size = new System.Drawing.Size(235, 29); - this.buttonRef.TabIndex = 5; - this.buttonRef.Text = "Обновить"; - this.buttonRef.UseVisualStyleBackColor = true; - this.buttonRef.Click += new System.EventHandler(this.ButtonRef_Click); - // - // menuStrip1 - // - this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); - this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripMenuItem}); - this.menuStrip1.Location = new System.Drawing.Point(0, 0); - this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(1297, 28); - this.menuStrip1.TabIndex = 6; - this.menuStrip1.Text = "menuStrip1"; - // - // toolStripMenuItem - // - this.toolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.workPieceToolStripMenuItem, - this.manufactureToolStripMenuItem}); - this.toolStripMenuItem.Name = "toolStripMenuItem"; - this.toolStripMenuItem.Size = new System.Drawing.Size(117, 24); - this.toolStripMenuItem.Text = "Справочники"; - // - // workPieceToolStripMenuItem - // - this.workPieceToolStripMenuItem.Name = "workPieceToolStripMenuItem"; - this.workPieceToolStripMenuItem.Size = new System.Drawing.Size(162, 26); - this.workPieceToolStripMenuItem.Text = "Заготовки"; - this.workPieceToolStripMenuItem.Click += new System.EventHandler(this.WorkPieceToolStripMenuItem_Click); - // - // manufactureToolStripMenuItem - // - this.manufactureToolStripMenuItem.Name = "manufactureToolStripMenuItem"; - this.manufactureToolStripMenuItem.Size = new System.Drawing.Size(162, 26); - this.manufactureToolStripMenuItem.Text = "Изделия"; - this.manufactureToolStripMenuItem.Click += new System.EventHandler(this.ManufactureToolStripMenuItem_Click); - // - // FormMain - // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1297, 450); - this.Controls.Add(this.buttonRef); - this.Controls.Add(this.buttonIssuedOrder); - this.Controls.Add(this.buttonOrderReady); - this.Controls.Add(this.buttonTakeOrderInWork); - this.Controls.Add(this.buttonCreateOrder); - this.Controls.Add(this.dataGridView); - this.Controls.Add(this.menuStrip1); - this.MainMenuStrip = this.menuStrip1; - this.Name = "FormMain"; - this.Text = "Кузнечная мастерская"; - this.Load += new System.EventHandler(this.FormMain_Load); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); - this.menuStrip1.ResumeLayout(false); - this.menuStrip1.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.dataGridView = new System.Windows.Forms.DataGridView(); + this.buttonCreateOrder = new System.Windows.Forms.Button(); + this.buttonTakeOrderInWork = new System.Windows.Forms.Button(); + this.buttonOrderReady = new System.Windows.Forms.Button(); + this.buttonIssuedOrder = new System.Windows.Forms.Button(); + this.buttonRef = new System.Windows.Forms.Button(); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.toolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.workPieceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.manufactureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.shopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.addManufactureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); + this.menuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // dataGridView + // + this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView.Location = new System.Drawing.Point(10, 27); + this.dataGridView.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.dataGridView.Name = "dataGridView"; + this.dataGridView.RowHeadersWidth = 51; + this.dataGridView.RowTemplate.Height = 29; + this.dataGridView.Size = new System.Drawing.Size(820, 302); + this.dataGridView.TabIndex = 0; + // + // buttonCreateOrder + // + this.buttonCreateOrder.Location = new System.Drawing.Point(887, 50); + this.buttonCreateOrder.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.buttonCreateOrder.Name = "buttonCreateOrder"; + this.buttonCreateOrder.Size = new System.Drawing.Size(206, 22); + this.buttonCreateOrder.TabIndex = 1; + this.buttonCreateOrder.Text = "Создать заказ"; + this.buttonCreateOrder.UseVisualStyleBackColor = true; + this.buttonCreateOrder.Click += new System.EventHandler(this.ButtonCreateOrder_Click); + // + // buttonTakeOrderInWork + // + this.buttonTakeOrderInWork.Location = new System.Drawing.Point(887, 107); + this.buttonTakeOrderInWork.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.buttonTakeOrderInWork.Name = "buttonTakeOrderInWork"; + this.buttonTakeOrderInWork.Size = new System.Drawing.Size(206, 22); + this.buttonTakeOrderInWork.TabIndex = 2; + this.buttonTakeOrderInWork.Text = "Отдать на выполнение"; + this.buttonTakeOrderInWork.UseVisualStyleBackColor = true; + this.buttonTakeOrderInWork.Click += new System.EventHandler(this.ButtonTakeOrderInWork_Click); + // + // buttonOrderReady + // + this.buttonOrderReady.Location = new System.Drawing.Point(887, 165); + this.buttonOrderReady.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.buttonOrderReady.Name = "buttonOrderReady"; + this.buttonOrderReady.Size = new System.Drawing.Size(206, 22); + this.buttonOrderReady.TabIndex = 3; + this.buttonOrderReady.Text = "Заказ готов"; + this.buttonOrderReady.UseVisualStyleBackColor = true; + this.buttonOrderReady.Click += new System.EventHandler(this.ButtonOrderReady_Click); + // + // buttonIssuedOrder + // + this.buttonIssuedOrder.Location = new System.Drawing.Point(887, 222); + this.buttonIssuedOrder.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.buttonIssuedOrder.Name = "buttonIssuedOrder"; + this.buttonIssuedOrder.Size = new System.Drawing.Size(206, 22); + this.buttonIssuedOrder.TabIndex = 4; + this.buttonIssuedOrder.Text = "Заказ выдан"; + this.buttonIssuedOrder.UseVisualStyleBackColor = true; + this.buttonIssuedOrder.Click += new System.EventHandler(this.ButtonIssuedOrder_Click); + // + // buttonRef + // + this.buttonRef.Location = new System.Drawing.Point(887, 277); + this.buttonRef.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.buttonRef.Name = "buttonRef"; + this.buttonRef.Size = new System.Drawing.Size(206, 22); + this.buttonRef.TabIndex = 5; + this.buttonRef.Text = "Обновить"; + this.buttonRef.UseVisualStyleBackColor = true; + this.buttonRef.Click += new System.EventHandler(this.ButtonRef_Click); + // + // menuStrip1 + // + this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Padding = new System.Windows.Forms.Padding(5, 2, 0, 2); + this.menuStrip1.Size = new System.Drawing.Size(1135, 24); + this.menuStrip1.TabIndex = 6; + this.menuStrip1.Text = "menuStrip1"; + // + // toolStripMenuItem + // + this.toolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.workPieceToolStripMenuItem, + this.manufactureToolStripMenuItem, + this.shopToolStripMenuItem, + this.addManufactureToolStripMenuItem}); + this.toolStripMenuItem.Name = "toolStripMenuItem"; + this.toolStripMenuItem.Size = new System.Drawing.Size(94, 20); + this.toolStripMenuItem.Text = "Справочники"; + // + // workPieceToolStripMenuItem + // + this.workPieceToolStripMenuItem.Name = "workPieceToolStripMenuItem"; + this.workPieceToolStripMenuItem.Size = new System.Drawing.Size(198, 22); + this.workPieceToolStripMenuItem.Text = "Заготовки"; + this.workPieceToolStripMenuItem.Click += new System.EventHandler(this.WorkPieceToolStripMenuItem_Click); + // + // manufactureToolStripMenuItem + // + this.manufactureToolStripMenuItem.Name = "manufactureToolStripMenuItem"; + this.manufactureToolStripMenuItem.Size = new System.Drawing.Size(198, 22); + this.manufactureToolStripMenuItem.Text = "Изделия"; + this.manufactureToolStripMenuItem.Click += new System.EventHandler(this.ManufactureToolStripMenuItem_Click); + // + // shopToolStripMenuItem + // + this.shopToolStripMenuItem.Name = "shopToolStripMenuItem"; + this.shopToolStripMenuItem.Size = new System.Drawing.Size(198, 22); + this.shopToolStripMenuItem.Text = "Магазины"; + this.shopToolStripMenuItem.Click += new System.EventHandler(this.ShopToolStripMenuItem_Click); + // + // addManufactureToolStripMenuItem + // + this.addManufactureToolStripMenuItem.Name = "addManufactureToolStripMenuItem"; + this.addManufactureToolStripMenuItem.Size = new System.Drawing.Size(198, 22); + this.addManufactureToolStripMenuItem.Text = "Пополнение магазина"; + this.addManufactureToolStripMenuItem.Click += new System.EventHandler(this.AddManufactureToolStripMenuItem_Click); + // + // FormMain + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1135, 338); + this.Controls.Add(this.buttonRef); + this.Controls.Add(this.buttonIssuedOrder); + this.Controls.Add(this.buttonOrderReady); + this.Controls.Add(this.buttonTakeOrderInWork); + this.Controls.Add(this.buttonCreateOrder); + this.Controls.Add(this.dataGridView); + this.Controls.Add(this.menuStrip1); + this.MainMenuStrip = this.menuStrip1; + this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.Name = "FormMain"; + this.Text = "Кузнечная мастерская"; + this.Load += new System.EventHandler(this.FormMain_Load); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); - } + } - #endregion + #endregion - private DataGridView dataGridView; - private Button buttonCreateOrder; - private Button buttonTakeOrderInWork; - private Button buttonOrderReady; - private Button buttonIssuedOrder; - private Button buttonRef; - private MenuStrip menuStrip1; - private ToolStripMenuItem toolStripMenuItem; - private ToolStripMenuItem workPieceToolStripMenuItem; - private ToolStripMenuItem manufactureToolStripMenuItem; - } + private DataGridView dataGridView; + private Button buttonCreateOrder; + private Button buttonTakeOrderInWork; + private Button buttonOrderReady; + private Button buttonIssuedOrder; + private Button buttonRef; + private MenuStrip menuStrip1; + private ToolStripMenuItem toolStripMenuItem; + private ToolStripMenuItem workPieceToolStripMenuItem; + private ToolStripMenuItem manufactureToolStripMenuItem; + private ToolStripMenuItem shopToolStripMenuItem; + private ToolStripMenuItem addManufactureToolStripMenuItem; + } } \ No newline at end of file diff --git a/BlacksmithWorkshop/BlacksmithWorkshopView/FormMain.cs b/BlacksmithWorkshop/BlacksmithWorkshopView/FormMain.cs index 879038a..70f746a 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopView/FormMain.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopView/FormMain.cs @@ -14,172 +14,194 @@ using System.Windows.Forms; namespace BlacksmithWorkshop { - public partial class FormMain : Form - { - private readonly ILogger _logger; + public partial class FormMain : Form + { + private readonly ILogger _logger; - private readonly IOrderLogic _orderLogic; + private readonly IOrderLogic _orderLogic; - public FormMain(ILogger logger, IOrderLogic orderLogic) - { - InitializeComponent(); + public FormMain(ILogger logger, IOrderLogic orderLogic) + { + InitializeComponent(); - _logger = logger; - _orderLogic = orderLogic; - } + _logger = logger; + _orderLogic = orderLogic; + } - private void FormMain_Load(object sender, EventArgs e) - { - LoadData(); - } + private void FormMain_Load(object sender, EventArgs e) + { + LoadData(); + } - private void LoadData() - { - _logger.LogInformation("Загрузка заказов"); + private void LoadData() + { + _logger.LogInformation("Загрузка заказов"); - try - { - var list = _orderLogic.ReadList(null); + try + { + var list = _orderLogic.ReadList(null); - if (list != null) - { - dataGridView.DataSource = list; - dataGridView.Columns["ManufactureId"].Visible = false; - } + if (list != null) + { + dataGridView.DataSource = list; + dataGridView.Columns["ManufactureId"].Visible = false; + } - _logger.LogInformation("Загрузка заказов"); - } - catch (Exception ex) - { - _logger.LogError(ex, "Ошибка загрузки заказов"); - MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } + _logger.LogInformation("Загрузка заказов"); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки заказов"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } - private void WorkPieceToolStripMenuItem_Click(object sender, EventArgs e) - { - var service = Program.ServiceProvider?.GetService(typeof(FormWorkPieces)); + private void WorkPieceToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormWorkPieces)); - if (service is FormWorkPieces form) - { - form.ShowDialog(); - } - } + if (service is FormWorkPieces form) + { + form.ShowDialog(); + } + } - private void ManufactureToolStripMenuItem_Click(object sender, EventArgs e) - { - var service = Program.ServiceProvider?.GetService(typeof(FormManufactures)); + private void ManufactureToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormManufactures)); - if (service is FormManufactures form) - { - form.ShowDialog(); - } - } + if (service is FormManufactures form) + { + form.ShowDialog(); + } + } - private void ButtonCreateOrder_Click(object sender, EventArgs e) - { - var service = Program.ServiceProvider?.GetService(typeof(FormCreateOrder)); + private void ButtonCreateOrder_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormCreateOrder)); - if (service is FormCreateOrder form) - { - form.ShowDialog(); - LoadData(); - } + if (service is FormCreateOrder form) + { + form.ShowDialog(); + LoadData(); + } - } + } - private void ButtonTakeOrderInWork_Click(object sender, EventArgs e) - { - if (dataGridView.SelectedRows.Count == 1) - { - int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); - _logger.LogInformation("Заказ №{id}. Меняется статус на 'В работе'", id); + private void ButtonTakeOrderInWork_Click(object sender, EventArgs e) + { + if (dataGridView.SelectedRows.Count == 1) + { + int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); + _logger.LogInformation("Заказ №{id}. Меняется статус на 'В работе'", id); - try - { - var operationResult = _orderLogic.TakeOrderInWork(new OrderBindingModel - { - Id = id - }); + try + { + var operationResult = _orderLogic.TakeOrderInWork(new OrderBindingModel + { + Id = id + }); - if (!operationResult) - { - throw new Exception("Ошибка при сохранении. Дополнительная информация в логах."); - } + if (!operationResult) + { + throw new Exception("Ошибка при сохранении. Дополнительная информация в логах."); + } - LoadData(); - } - catch (Exception ex) - { - _logger.LogError(ex, "Ошибка передачи заказа в работу"); - MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - } + LoadData(); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка передачи заказа в работу"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } - private void ButtonOrderReady_Click(object sender, EventArgs e) - { - if (dataGridView.SelectedRows.Count == 1) - { - int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); - _logger.LogInformation("Заказ №{id}. Меняется статус на 'Готов'", id); + private void ButtonOrderReady_Click(object sender, EventArgs e) + { + if (dataGridView.SelectedRows.Count == 1) + { + int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); + _logger.LogInformation("Заказ №{id}. Меняется статус на 'Готов'", id); - try - { - var operationResult = _orderLogic.FinishOrder(new OrderBindingModel - { - Id = id - }); + try + { + var operationResult = _orderLogic.FinishOrder(new OrderBindingModel + { + Id = id + }); - if (!operationResult) - { - throw new Exception("Ошибка при сохранении. Дополнительная информация в логах."); - } + if (!operationResult) + { + throw new Exception("Ошибка при сохранении. Дополнительная информация в логах."); + } - LoadData(); - } - catch (Exception ex) - { - _logger.LogError(ex, "Ошибка отметки о готовности заказа"); - MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - } + LoadData(); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка отметки о готовности заказа"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } - private void ButtonIssuedOrder_Click(object sender, EventArgs e) - { - if (dataGridView.SelectedRows.Count == 1) - { - int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); - _logger.LogInformation("Заказ №{id}. Меняется статус на 'Выдан'", id); + private void ButtonIssuedOrder_Click(object sender, EventArgs e) + { + if (dataGridView.SelectedRows.Count == 1) + { + int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); + _logger.LogInformation("Заказ №{id}. Меняется статус на 'Выдан'", id); - try - { - var operationResult = _orderLogic.DeliveryOrder(new OrderBindingModel - { - Id = id - }); + try + { + var operationResult = _orderLogic.DeliveryOrder(new OrderBindingModel + { + Id = id + }); - if (!operationResult) - { - throw new Exception("Ошибка при сохранении. Дополнительная информация в логах."); - } + if (!operationResult) + { + throw new Exception("Ошибка при сохранении. Дополнительная информация в логах."); + } - _logger.LogInformation("Заказ №{id} выдан", id); + _logger.LogInformation("Заказ №{id} выдан", id); - LoadData(); - } - catch (Exception ex) - { - _logger.LogError(ex, "Ошибка отметки о выдачи заказа"); - MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - } + LoadData(); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка отметки о выдачи заказа"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } - private void ButtonRef_Click(object sender, EventArgs e) - { - LoadData(); - } - } + private void ButtonRef_Click(object sender, EventArgs e) + { + LoadData(); + } + + private void ShopToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormShops)); + + if (service is FormShops form) + { + form.ShowDialog(); + } + } + + + private void AddManufactureToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormAddManufacture)); + + if (service is FormAddManufacture form) + { + form.ShowDialog(); + LoadData(); + } + } + } } \ No newline at end of file diff --git a/BlacksmithWorkshop/BlacksmithWorkshopView/FormShop.Designer.cs b/BlacksmithWorkshop/BlacksmithWorkshopView/FormShop.Designer.cs new file mode 100644 index 0000000..64ce68f --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopView/FormShop.Designer.cs @@ -0,0 +1,39 @@ +namespace BlacksmithWorkshopView +{ + partial class FormShop + { + /// + /// 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 = "FormShop"; + } + + #endregion + } +} \ No newline at end of file diff --git a/BlacksmithWorkshop/BlacksmithWorkshopView/FormShop.cs b/BlacksmithWorkshop/BlacksmithWorkshopView/FormShop.cs new file mode 100644 index 0000000..b51f8b8 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopView/FormShop.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace BlacksmithWorkshopView +{ + public partial class FormShop : Form + { + public FormShop() + { + InitializeComponent(); + } + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopView/FormShop.resx b/BlacksmithWorkshop/BlacksmithWorkshopView/FormShop.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopView/FormShop.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/BlacksmithWorkshop/BlacksmithWorkshopView/FormShops.Designer.cs b/BlacksmithWorkshop/BlacksmithWorkshopView/FormShops.Designer.cs new file mode 100644 index 0000000..8a189d3 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopView/FormShops.Designer.cs @@ -0,0 +1,39 @@ +namespace BlacksmithWorkshopView +{ + partial class FormShops + { + /// + /// 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 = "FormShops"; + } + + #endregion + } +} \ No newline at end of file diff --git a/BlacksmithWorkshop/BlacksmithWorkshopView/FormShops.cs b/BlacksmithWorkshop/BlacksmithWorkshopView/FormShops.cs new file mode 100644 index 0000000..6ad9270 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopView/FormShops.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace BlacksmithWorkshopView +{ + public partial class FormShops : Form + { + public FormShops() + { + InitializeComponent(); + } + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopView/FormShops.resx b/BlacksmithWorkshop/BlacksmithWorkshopView/FormShops.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopView/FormShops.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/BlacksmithWorkshop/BlacksmithWorkshopView/Program.cs b/BlacksmithWorkshop/BlacksmithWorkshopView/Program.cs index b6b3059..076c662 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopView/Program.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopView/Program.cs @@ -6,50 +6,57 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using NLog.Extensions.Logging; +using System.Drawing; + namespace BlacksmithWorkshop { - internal static class Program - { - private static ServiceProvider? _serviceProvider; - public static ServiceProvider? ServiceProvider => _serviceProvider; - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - // To customize application configuration such as set high DPI settings or default font; - // see https://aka.ms/applicationconfiguration. - ApplicationConfiguration.Initialize(); - var services = new ServiceCollection(); - ConfigureServices(services); - _serviceProvider = services.BuildServiceProvider(); - Application.Run(_serviceProvider.GetRequiredService()); - } - private static void ConfigureServices(ServiceCollection services) - { - services.AddLogging(option => - { - option.SetMinimumLevel(LogLevel.Information); - option.AddNLog("nlog.config"); - }); + internal static class Program + { + private static ServiceProvider? _serviceProvider; + public static ServiceProvider? ServiceProvider => _serviceProvider; + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + // To customize application configuration such as set high DPI settings or default font; + // see https://aka.ms/applicationconfiguration. + ApplicationConfiguration.Initialize(); + var services = new ServiceCollection(); + ConfigureServices(services); + _serviceProvider = services.BuildServiceProvider(); + Application.Run(_serviceProvider.GetRequiredService()); + } + private static void ConfigureServices(ServiceCollection services) + { + services.AddLogging(option => + { + option.SetMinimumLevel(LogLevel.Information); + option.AddNLog("nlog.config"); + }); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - } + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + } - } + } } \ No newline at end of file