From 8028c36b1a31bbc1a0cd1b1571ae470e17fa5747 Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Sat, 29 Apr 2023 12:30:45 +0400 Subject: [PATCH 01/11] =?UTF-8?q?LabWork08=20=D0=BF=D0=BE=20=D0=A2=D0=97.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataGridViewExtension.cs | 61 +++ .../BlacksmithWorkshop/FormClients.cs | 21 +- .../BlacksmithWorkshop/FormMain.Designer.cs | 425 +++++++++--------- .../BlacksmithWorkshop/FormMain.cs | 59 ++- .../BlacksmithWorkshop/Program.cs | 90 ++-- .../BusinessLogic/BackUpLogic.cs | 125 ++++++ .../Attributes/ColumnAttribute.cs | 32 ++ .../Attributes/GridViewAutoSize.cs | 27 ++ .../BindingModels/BackUpSaveBinidngModel.cs | 14 + .../BlacksmithWorkshopContracts.csproj | 4 + .../BusinessLogicsContracts/IBackUpLogic.cs | 17 + .../DI/DependencyManager.cs | 63 +++ .../DI/IDependencyContainer.cs | 26 ++ .../DI/IImplementationExtension.cs | 19 + .../DI/ServiceProviderLoader.cs | 61 +++ .../StoragesContracts/IBackUpInfo.cs | 18 + .../ViewModels/ClientViewModel.cs | 3 - .../Implements/BackUpInfo.cs | 36 ++ .../ListImplementationExtension.cs | 34 ++ 19 files changed, 845 insertions(+), 290 deletions(-) create mode 100644 BlacksmithWorkshop/BlacksmithWorkshop/DataGridViewExtension.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogic/BackUpLogic.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopContracts/Attributes/ColumnAttribute.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopContracts/Attributes/GridViewAutoSize.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopContracts/BindingModels/BackUpSaveBinidngModel.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopContracts/BusinessLogicsContracts/IBackUpLogic.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/DependencyManager.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/IDependencyContainer.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/IImplementationExtension.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/ServiceProviderLoader.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopContracts/StoragesContracts/IBackUpInfo.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Implements/BackUpInfo.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopListImplement/ListImplementationExtension.cs diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/DataGridViewExtension.cs b/BlacksmithWorkshop/BlacksmithWorkshop/DataGridViewExtension.cs new file mode 100644 index 0000000..5f555c7 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshop/DataGridViewExtension.cs @@ -0,0 +1,61 @@ +using BlacksmithWorkshopContracts.Attributes; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshop +{ + public static class DataGridViewExtension + { + public static void FillandConfigGrid(this DataGridView grid, List? data) + { + if (data == null) + { + return; + } + + grid.DataSource = data; + + var type = typeof(T); + + var properties = type.GetProperties(); + + foreach (DataGridViewColumn column in grid.Columns) + { + var property = properties.FirstOrDefault(x => x.Name == column.Name); + + if (property == null) + { + throw new InvalidOperationException($"В типе {type.Name} не найдено свойство с именем { column.Name }"); + } + + var attribute = property.GetCustomAttributes(typeof(ColumnAttribute), true)?.SingleOrDefault(); + + if (attribute == null) + { + throw new InvalidOperationException($"Не найден атрибут типа ColumnAttribute для свойства { property.Name }"); + } + + // ищем нужный нам атрибут + if (attribute is ColumnAttribute columnAttr) + { + column.HeaderText = columnAttr.Title; + column.Visible = columnAttr.Visible; + + if (columnAttr.IsUseAutoSize) + { + column.AutoSizeMode = (DataGridViewAutoSizeColumnMode)Enum.Parse(typeof(DataGridViewAutoSizeColumnMode), + columnAttr.GridViewAutoSize.ToString()); + } + else + { + column.Width = columnAttr.Width; + } + } + } + } + } + +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormClients.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormClients.cs index 0ed15ea..c271656 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/FormClients.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormClients.cs @@ -36,21 +36,12 @@ namespace BlacksmithWorkshop private void LoadData() { - _logger.LogInformation("Загрузка клиентов"); - - try - { - var list = _clientLogic.ReadList(null); - - if (list != null) - { - dataGridView.DataSource = list; - dataGridView.Columns["ClientFIO"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; - } - - _logger.LogInformation("Успешная загрузка клиентов"); - } - catch (Exception ex) + try + { + dataGridView.FillandConfigGrid(_clientLogic.ReadList(null)); + _logger.LogInformation("Загрузка клиентов"); + } + catch (Exception ex) { _logger.LogError(ex, "Ошибка загрузки клиентов"); MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.Designer.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.Designer.cs index 8899630..0e0f3a9 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.Designer.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.Designer.cs @@ -22,215 +22,224 @@ #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() - { - dataGridView = new DataGridView(); - buttonCreateOrder = new Button(); - buttonIssuedOrder = new Button(); - buttonRef = new Button(); - menuStrip = new MenuStrip(); - toolStripMenuItem = new ToolStripMenuItem(); - workPieceToolStripMenuItem = new ToolStripMenuItem(); - manufactureToolStripMenuItem = new ToolStripMenuItem(); - reportsToolStripMenuItem = new ToolStripMenuItem(); - workPiecesToolStripMenuItem = new ToolStripMenuItem(); - workPieceManufacturesToolStripMenuItem = new ToolStripMenuItem(); - ordersToolStripMenuItem = new ToolStripMenuItem(); - workWithClientsToolStripMenuItem = new ToolStripMenuItem(); - clientsToolStripMenuItem = new ToolStripMenuItem(); - работаСИсполнителямиToolStripMenuItem = new ToolStripMenuItem(); - implementerToolStripMenuItem = new ToolStripMenuItem(); - startingWorkToolStripMenuItem = new ToolStripMenuItem(); - mailsToolStripMenuItem = new ToolStripMenuItem(); - ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); - menuStrip.SuspendLayout(); - SuspendLayout(); - // - // dataGridView - // - dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; - dataGridView.Location = new Point(12, 36); - dataGridView.Name = "dataGridView"; - dataGridView.RowHeadersWidth = 51; - dataGridView.RowTemplate.Height = 29; - dataGridView.Size = new Size(1209, 402); - dataGridView.TabIndex = 0; - // - // buttonCreateOrder - // - buttonCreateOrder.Location = new Point(1247, 70); - buttonCreateOrder.Name = "buttonCreateOrder"; - buttonCreateOrder.Size = new Size(235, 29); - buttonCreateOrder.TabIndex = 1; - buttonCreateOrder.Text = "Создать заказ"; - buttonCreateOrder.UseVisualStyleBackColor = true; - buttonCreateOrder.Click += ButtonCreateOrder_Click; - // - // buttonIssuedOrder - // - buttonIssuedOrder.Location = new Point(1247, 144); - buttonIssuedOrder.Name = "buttonIssuedOrder"; - buttonIssuedOrder.Size = new Size(235, 29); - buttonIssuedOrder.TabIndex = 4; - buttonIssuedOrder.Text = "Заказ выдан"; - buttonIssuedOrder.UseVisualStyleBackColor = true; - buttonIssuedOrder.Click += ButtonIssuedOrder_Click; - // - // buttonRef - // - buttonRef.Location = new Point(1247, 221); - buttonRef.Name = "buttonRef"; - buttonRef.Size = new Size(235, 29); - buttonRef.TabIndex = 5; - buttonRef.Text = "Обновить"; - buttonRef.UseVisualStyleBackColor = true; - buttonRef.Click += ButtonRef_Click; - // - // menuStrip - // - menuStrip.ImageScalingSize = new Size(20, 20); - menuStrip.Items.AddRange(new ToolStripItem[] { toolStripMenuItem, reportsToolStripMenuItem, workWithClientsToolStripMenuItem, работаСИсполнителямиToolStripMenuItem, startingWorkToolStripMenuItem }); - menuStrip.Location = new Point(0, 0); - menuStrip.Name = "menuStrip"; - menuStrip.Size = new Size(1506, 28); - menuStrip.TabIndex = 6; - menuStrip.Text = "menuStrip1"; - // - // toolStripMenuItem - // - toolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { workPieceToolStripMenuItem, manufactureToolStripMenuItem, mailsToolStripMenuItem }); - toolStripMenuItem.Name = "toolStripMenuItem"; - toolStripMenuItem.Size = new Size(117, 24); - toolStripMenuItem.Text = "Справочники"; - // - // workPieceToolStripMenuItem - // - workPieceToolStripMenuItem.Name = "workPieceToolStripMenuItem"; - workPieceToolStripMenuItem.Size = new Size(224, 26); - workPieceToolStripMenuItem.Text = "Заготовки"; - workPieceToolStripMenuItem.Click += WorkPieceToolStripMenuItem_Click; - // - // manufactureToolStripMenuItem - // - manufactureToolStripMenuItem.Name = "manufactureToolStripMenuItem"; - manufactureToolStripMenuItem.Size = new Size(224, 26); - manufactureToolStripMenuItem.Text = "Изделия"; - manufactureToolStripMenuItem.Click += ManufactureToolStripMenuItem_Click; - // - // reportsToolStripMenuItem - // - reportsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { workPiecesToolStripMenuItem, workPieceManufacturesToolStripMenuItem, ordersToolStripMenuItem }); - reportsToolStripMenuItem.Name = "reportsToolStripMenuItem"; - reportsToolStripMenuItem.Size = new Size(73, 24); - reportsToolStripMenuItem.Text = "Отчёты"; - // - // workPiecesToolStripMenuItem - // - workPiecesToolStripMenuItem.Name = "workPiecesToolStripMenuItem"; - workPiecesToolStripMenuItem.Size = new Size(256, 26); - workPiecesToolStripMenuItem.Text = "Список заготовок"; - workPiecesToolStripMenuItem.Click += WorkPiecesToolStripMenuItem_Click; - // - // workPieceManufacturesToolStripMenuItem - // - workPieceManufacturesToolStripMenuItem.Name = "workPieceManufacturesToolStripMenuItem"; - workPieceManufacturesToolStripMenuItem.Size = new Size(256, 26); - workPieceManufacturesToolStripMenuItem.Text = "Заготовки по изделиям"; - workPieceManufacturesToolStripMenuItem.Click += WorkPieceManufacturesToolStripMenuItem_Click; - // - // ordersToolStripMenuItem - // - ordersToolStripMenuItem.Name = "ordersToolStripMenuItem"; - ordersToolStripMenuItem.Size = new Size(256, 26); - ordersToolStripMenuItem.Text = "Список заказов"; - ordersToolStripMenuItem.Click += OrdersToolStripMenuItem_Click; - // - // workWithClientsToolStripMenuItem - // - workWithClientsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { clientsToolStripMenuItem }); - workWithClientsToolStripMenuItem.Name = "workWithClientsToolStripMenuItem"; - workWithClientsToolStripMenuItem.Size = new Size(161, 24); - workWithClientsToolStripMenuItem.Text = "Работа с клиентами"; - // - // clientsToolStripMenuItem - // - clientsToolStripMenuItem.Name = "clientsToolStripMenuItem"; - clientsToolStripMenuItem.Size = new Size(152, 26); - clientsToolStripMenuItem.Text = "Клиенты"; - clientsToolStripMenuItem.Click += ClientsToolStripMenuItem_Click; - // - // работаСИсполнителямиToolStripMenuItem - // - работаСИсполнителямиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { implementerToolStripMenuItem }); - работаСИсполнителямиToolStripMenuItem.Name = "работаСИсполнителямиToolStripMenuItem"; - работаСИсполнителямиToolStripMenuItem.Size = new Size(196, 24); - работаСИсполнителямиToolStripMenuItem.Text = "Работа с исполнителями"; - // - // implementerToolStripMenuItem - // - implementerToolStripMenuItem.Name = "implementerToolStripMenuItem"; - implementerToolStripMenuItem.Size = new Size(185, 26); - implementerToolStripMenuItem.Text = "Исполнители"; - implementerToolStripMenuItem.Click += ImplementerToolStripMenuItem_Click; - // - // startingWorkToolStripMenuItem - // - startingWorkToolStripMenuItem.Name = "startingWorkToolStripMenuItem"; - startingWorkToolStripMenuItem.Size = new Size(114, 24); - startingWorkToolStripMenuItem.Text = "Запуск работ"; - startingWorkToolStripMenuItem.Click += StartingWorkToolStripMenuItem_Click; - // - // mailsToolStripMenuItem - // - mailsToolStripMenuItem.Name = "mailsToolStripMenuItem"; - mailsToolStripMenuItem.Size = new Size(224, 26); - mailsToolStripMenuItem.Text = "Письма"; - mailsToolStripMenuItem.Click += MailsToolStripMenuItem_Click; - // - // FormMain - // - AutoScaleDimensions = new SizeF(8F, 20F); - AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(1506, 450); - Controls.Add(buttonRef); - Controls.Add(buttonIssuedOrder); - Controls.Add(buttonCreateOrder); - Controls.Add(dataGridView); - Controls.Add(menuStrip); - MainMenuStrip = menuStrip; - Name = "FormMain"; - Text = "Кузнечная мастерская"; - Load += FormMain_Load; - ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); - menuStrip.ResumeLayout(false); - menuStrip.PerformLayout(); - ResumeLayout(false); - PerformLayout(); - } + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + dataGridView = new DataGridView(); + buttonCreateOrder = new Button(); + buttonIssuedOrder = new Button(); + buttonRef = new Button(); + menuStrip = new MenuStrip(); + toolStripMenuItem = new ToolStripMenuItem(); + workPieceToolStripMenuItem = new ToolStripMenuItem(); + manufactureToolStripMenuItem = new ToolStripMenuItem(); + mailsToolStripMenuItem = new ToolStripMenuItem(); + reportsToolStripMenuItem = new ToolStripMenuItem(); + workPiecesToolStripMenuItem = new ToolStripMenuItem(); + workPieceManufacturesToolStripMenuItem = new ToolStripMenuItem(); + ordersToolStripMenuItem = new ToolStripMenuItem(); + workWithClientsToolStripMenuItem = new ToolStripMenuItem(); + clientsToolStripMenuItem = new ToolStripMenuItem(); + работаСИсполнителямиToolStripMenuItem = new ToolStripMenuItem(); + implementerToolStripMenuItem = new ToolStripMenuItem(); + startingWorkToolStripMenuItem = new ToolStripMenuItem(); + createBackUpToolStripMenuItem = new ToolStripMenuItem(); + ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); + menuStrip.SuspendLayout(); + SuspendLayout(); + // + // dataGridView + // + dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridView.Location = new Point(12, 36); + dataGridView.Name = "dataGridView"; + dataGridView.RowHeadersWidth = 51; + dataGridView.RowTemplate.Height = 29; + dataGridView.Size = new Size(1209, 402); + dataGridView.TabIndex = 0; + // + // buttonCreateOrder + // + buttonCreateOrder.Location = new Point(1247, 70); + buttonCreateOrder.Name = "buttonCreateOrder"; + buttonCreateOrder.Size = new Size(235, 29); + buttonCreateOrder.TabIndex = 1; + buttonCreateOrder.Text = "Создать заказ"; + buttonCreateOrder.UseVisualStyleBackColor = true; + buttonCreateOrder.Click += ButtonCreateOrder_Click; + // + // buttonIssuedOrder + // + buttonIssuedOrder.Location = new Point(1247, 144); + buttonIssuedOrder.Name = "buttonIssuedOrder"; + buttonIssuedOrder.Size = new Size(235, 29); + buttonIssuedOrder.TabIndex = 4; + buttonIssuedOrder.Text = "Заказ выдан"; + buttonIssuedOrder.UseVisualStyleBackColor = true; + buttonIssuedOrder.Click += ButtonIssuedOrder_Click; + // + // buttonRef + // + buttonRef.Location = new Point(1247, 221); + buttonRef.Name = "buttonRef"; + buttonRef.Size = new Size(235, 29); + buttonRef.TabIndex = 5; + buttonRef.Text = "Обновить"; + buttonRef.UseVisualStyleBackColor = true; + buttonRef.Click += ButtonRef_Click; + // + // menuStrip + // + menuStrip.ImageScalingSize = new Size(20, 20); + menuStrip.Items.AddRange(new ToolStripItem[] { toolStripMenuItem, reportsToolStripMenuItem, workWithClientsToolStripMenuItem, работаСИсполнителямиToolStripMenuItem, startingWorkToolStripMenuItem, createBackUpToolStripMenuItem }); + menuStrip.Location = new Point(0, 0); + menuStrip.Name = "menuStrip"; + menuStrip.Size = new Size(1506, 28); + menuStrip.TabIndex = 6; + menuStrip.Text = "menuStrip1"; + // + // toolStripMenuItem + // + toolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { workPieceToolStripMenuItem, manufactureToolStripMenuItem, mailsToolStripMenuItem }); + toolStripMenuItem.Name = "toolStripMenuItem"; + toolStripMenuItem.Size = new Size(117, 24); + toolStripMenuItem.Text = "Справочники"; + // + // workPieceToolStripMenuItem + // + workPieceToolStripMenuItem.Name = "workPieceToolStripMenuItem"; + workPieceToolStripMenuItem.Size = new Size(162, 26); + workPieceToolStripMenuItem.Text = "Заготовки"; + workPieceToolStripMenuItem.Click += WorkPieceToolStripMenuItem_Click; + // + // manufactureToolStripMenuItem + // + manufactureToolStripMenuItem.Name = "manufactureToolStripMenuItem"; + manufactureToolStripMenuItem.Size = new Size(162, 26); + manufactureToolStripMenuItem.Text = "Изделия"; + manufactureToolStripMenuItem.Click += ManufactureToolStripMenuItem_Click; + // + // mailsToolStripMenuItem + // + mailsToolStripMenuItem.Name = "mailsToolStripMenuItem"; + mailsToolStripMenuItem.Size = new Size(162, 26); + mailsToolStripMenuItem.Text = "Письма"; + mailsToolStripMenuItem.Click += MailsToolStripMenuItem_Click; + // + // reportsToolStripMenuItem + // + reportsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { workPiecesToolStripMenuItem, workPieceManufacturesToolStripMenuItem, ordersToolStripMenuItem }); + reportsToolStripMenuItem.Name = "reportsToolStripMenuItem"; + reportsToolStripMenuItem.Size = new Size(73, 24); + reportsToolStripMenuItem.Text = "Отчёты"; + // + // workPiecesToolStripMenuItem + // + workPiecesToolStripMenuItem.Name = "workPiecesToolStripMenuItem"; + workPiecesToolStripMenuItem.Size = new Size(256, 26); + workPiecesToolStripMenuItem.Text = "Список заготовок"; + workPiecesToolStripMenuItem.Click += WorkPiecesToolStripMenuItem_Click; + // + // workPieceManufacturesToolStripMenuItem + // + workPieceManufacturesToolStripMenuItem.Name = "workPieceManufacturesToolStripMenuItem"; + workPieceManufacturesToolStripMenuItem.Size = new Size(256, 26); + workPieceManufacturesToolStripMenuItem.Text = "Заготовки по изделиям"; + workPieceManufacturesToolStripMenuItem.Click += WorkPieceManufacturesToolStripMenuItem_Click; + // + // ordersToolStripMenuItem + // + ordersToolStripMenuItem.Name = "ordersToolStripMenuItem"; + ordersToolStripMenuItem.Size = new Size(256, 26); + ordersToolStripMenuItem.Text = "Список заказов"; + ordersToolStripMenuItem.Click += OrdersToolStripMenuItem_Click; + // + // workWithClientsToolStripMenuItem + // + workWithClientsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { clientsToolStripMenuItem }); + workWithClientsToolStripMenuItem.Name = "workWithClientsToolStripMenuItem"; + workWithClientsToolStripMenuItem.Size = new Size(161, 24); + workWithClientsToolStripMenuItem.Text = "Работа с клиентами"; + // + // clientsToolStripMenuItem + // + clientsToolStripMenuItem.Name = "clientsToolStripMenuItem"; + clientsToolStripMenuItem.Size = new Size(152, 26); + clientsToolStripMenuItem.Text = "Клиенты"; + clientsToolStripMenuItem.Click += ClientsToolStripMenuItem_Click; + // + // работаСИсполнителямиToolStripMenuItem + // + работаСИсполнителямиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { implementerToolStripMenuItem }); + работаСИсполнителямиToolStripMenuItem.Name = "работаСИсполнителямиToolStripMenuItem"; + работаСИсполнителямиToolStripMenuItem.Size = new Size(196, 24); + работаСИсполнителямиToolStripMenuItem.Text = "Работа с исполнителями"; + // + // implementerToolStripMenuItem + // + implementerToolStripMenuItem.Name = "implementerToolStripMenuItem"; + implementerToolStripMenuItem.Size = new Size(185, 26); + implementerToolStripMenuItem.Text = "Исполнители"; + implementerToolStripMenuItem.Click += ImplementerToolStripMenuItem_Click; + // + // startingWorkToolStripMenuItem + // + startingWorkToolStripMenuItem.Name = "startingWorkToolStripMenuItem"; + startingWorkToolStripMenuItem.Size = new Size(114, 24); + startingWorkToolStripMenuItem.Text = "Запуск работ"; + startingWorkToolStripMenuItem.Click += StartingWorkToolStripMenuItem_Click; + // + // createBackUpToolStripMenuItem + // + createBackUpToolStripMenuItem.Name = "createBackUpToolStripMenuItem"; + createBackUpToolStripMenuItem.Size = new Size(123, 24); + createBackUpToolStripMenuItem.Text = "Создать бекап"; + createBackUpToolStripMenuItem.Click += CreateBackUpToolStripMenuItem_Click; + // + // FormMain + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(1506, 450); + Controls.Add(buttonRef); + Controls.Add(buttonIssuedOrder); + Controls.Add(buttonCreateOrder); + Controls.Add(dataGridView); + Controls.Add(menuStrip); + MainMenuStrip = menuStrip; + Name = "FormMain"; + Text = "Кузнечная мастерская"; + Load += FormMain_Load; + ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); + menuStrip.ResumeLayout(false); + menuStrip.PerformLayout(); + ResumeLayout(false); + PerformLayout(); + } #endregion - private DataGridView dataGridView; - private Button buttonCreateOrder; - private Button buttonIssuedOrder; - private Button buttonRef; - private MenuStrip menuStrip; - private ToolStripMenuItem toolStripMenuItem; - private ToolStripMenuItem workPieceToolStripMenuItem; - private ToolStripMenuItem manufactureToolStripMenuItem; - private ToolStripMenuItem reportsToolStripMenuItem; - private ToolStripMenuItem workPiecesToolStripMenuItem; - private ToolStripMenuItem workPieceManufacturesToolStripMenuItem; - private ToolStripMenuItem ordersToolStripMenuItem; - private ToolStripMenuItem workWithClientsToolStripMenuItem; - private ToolStripMenuItem clientsToolStripMenuItem; - private ToolStripMenuItem startingWorkToolStripMenuItem; - private ToolStripMenuItem работаСИсполнителямиToolStripMenuItem; - private ToolStripMenuItem implementerToolStripMenuItem; - private ToolStripMenuItem mailsToolStripMenuItem; - } + private DataGridView dataGridView; + private Button buttonCreateOrder; + private Button buttonIssuedOrder; + private Button buttonRef; + private MenuStrip menuStrip; + private ToolStripMenuItem toolStripMenuItem; + private ToolStripMenuItem workPieceToolStripMenuItem; + private ToolStripMenuItem manufactureToolStripMenuItem; + private ToolStripMenuItem reportsToolStripMenuItem; + private ToolStripMenuItem workPiecesToolStripMenuItem; + private ToolStripMenuItem workPieceManufacturesToolStripMenuItem; + private ToolStripMenuItem ordersToolStripMenuItem; + private ToolStripMenuItem workWithClientsToolStripMenuItem; + private ToolStripMenuItem clientsToolStripMenuItem; + private ToolStripMenuItem startingWorkToolStripMenuItem; + private ToolStripMenuItem работаСИсполнителямиToolStripMenuItem; + private ToolStripMenuItem implementerToolStripMenuItem; + private ToolStripMenuItem mailsToolStripMenuItem; + private ToolStripMenuItem createBackUpToolStripMenuItem; + } } \ No newline at end of file diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs index ef89681..7e5af01 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs @@ -25,7 +25,9 @@ namespace BlacksmithWorkshop private readonly IWorkProcess _workProcess; - public FormMain(ILogger logger, IOrderLogic orderLogic, IReportLogic reportLogic, IWorkProcess workProcess) + private readonly IBackUpLogic _backUpLogic; + + public FormMain(ILogger logger, IOrderLogic orderLogic, IReportLogic reportLogic, IWorkProcess workProcess, IBackUpLogic backUpLogic) { InitializeComponent(); @@ -33,6 +35,7 @@ namespace BlacksmithWorkshop _orderLogic = orderLogic; _reportLogic = reportLogic; _workProcess = workProcess; + _backUpLogic = backUpLogic; } private void FormMain_Load(object sender, EventArgs e) @@ -192,20 +195,46 @@ namespace BlacksmithWorkshop { var service = Program.ServiceProvider?.GetService(typeof(FormImplementers)); - if (service is FormImplementers form) - { - form.ShowDialog(); - } - } + if (service is FormImplementers form) + { + form.ShowDialog(); + } + } - private void MailsToolStripMenuItem_Click(object sender, EventArgs e) - { - var service = Program.ServiceProvider?.GetService(typeof(FormMails)); + private void MailsToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormMails)); - if (service is FormMails form) - { - form.ShowDialog(); - } - } - } + if (service is FormMails form) + { + form.ShowDialog(); + } + } + + private void CreateBackUpToolStripMenuItem_Click(object sender, EventArgs e) + { + try + { + if (_backUpLogic != null) + { + var fbd = new FolderBrowserDialog(); + + if (fbd.ShowDialog() == DialogResult.OK) + { + _backUpLogic.CreateBackUp(new BackUpSaveBinidngModel + { + FolderName = fbd.SelectedPath + }); + + MessageBox.Show("Бекап создан", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + } + } } \ No newline at end of file diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/Program.cs b/BlacksmithWorkshop/BlacksmithWorkshop/Program.cs index e73215b..484375e 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/Program.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/Program.cs @@ -4,6 +4,7 @@ using BlacksmithWorkshopBusinessLogic.OfficePackage; using BlacksmithWorkshopBusinessLogic.OfficePackage.Implements; using BlacksmithWorkshopContracts.BindingModels; using BlacksmithWorkshopContracts.BusinessLogicsContracts; +using BlacksmithWorkshopContracts.DI; using BlacksmithWorkshopContracts.StoragesContracts; using BlacksmithWorkshopDatabaseImplement.Implements; using Microsoft.Extensions.DependencyInjection; @@ -14,10 +15,6 @@ namespace BlacksmithWorkshop { internal static class Program { - private static ServiceProvider? _serviceProvider; - - public static ServiceProvider? ServiceProvider => _serviceProvider; - /// /// The main entry point for the application. /// @@ -28,13 +25,12 @@ namespace BlacksmithWorkshop // see https://aka.ms/applicationconfiguration. ApplicationConfiguration.Initialize(); var services = new ServiceCollection(); - ConfigureServices(services); - _serviceProvider = services.BuildServiceProvider(); + InitDependency(); - try + try { - var mailSender = _serviceProvider.GetService(); - mailSender?.MailConfig(new MailConfigBindingModel + var mailSender = DependencyManager.Instance.Resolve(); + mailSender?.MailConfig(new MailConfigBindingModel { MailLogin = System.Configuration.ConfigurationManager.AppSettings["MailLogin"] ?? string.Empty, MailPassword = System.Configuration.ConfigurationManager.AppSettings["MailPassword"] ?? string.Empty, @@ -49,60 +45,56 @@ namespace BlacksmithWorkshop } catch (Exception ex) { - var logger = _serviceProvider.GetService(); + var logger = DependencyManager.Instance.Resolve(); - logger?.LogError(ex, " "); + logger?.LogError(ex, " "); } - Application.Run(_serviceProvider.GetRequiredService()); + Application.Run(DependencyManager.Instance.Resolve()); } - private static void ConfigureServices(ServiceCollection services) + private static void InitDependency() { - services.AddLogging(option => + DependencyManager.InitDependency(); + + DependencyManager.Instance.AddLogging(option => { option.SetMinimumLevel(LogLevel.Information); option.AddNLog("nlog.config"); }); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - - services.AddTransient(); - services.AddSingleton(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(true); - 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(); - } + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + } - private static void MailCheck(object obj) => ServiceProvider?.GetService()?.MailCheck(); - } + private static void MailCheck(object obj) => DependencyManager.Instance.Resolve()?.MailCheck(); + } } \ No newline at end of file diff --git a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogic/BackUpLogic.cs b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogic/BackUpLogic.cs new file mode 100644 index 0000000..c59648b --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogic/BackUpLogic.cs @@ -0,0 +1,125 @@ +using BlacksmithWorkshopContracts.BindingModels; +using BlacksmithWorkshopContracts.BusinessLogicsContracts; +using BlacksmithWorkshopContracts.StoragesContracts; +using BlacksmithWorkshopDataModels; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.IO.Compression; +using System.Linq; +using System.Reflection; +using System.Runtime.Serialization.Json; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopBusinessLogic.BusinessLogic +{ + public class BackUpLogic : IBackUpLogic + { + private readonly ILogger _logger; + + private readonly IBackUpInfo _backUpInfo; + public BackUpLogic(ILogger logger, IBackUpInfo backUpInfo) + { + _logger = logger; + _backUpInfo = backUpInfo; + } + + public void CreateBackUp(BackUpSaveBinidngModel model) + { + if (_backUpInfo == null) + { + return; + } + try + { + _logger.LogDebug("Clear folder"); + + // зачистка папки и удаление старого архива + var dirInfo = new DirectoryInfo(model.FolderName); + + if (dirInfo.Exists) + { + foreach (var file in dirInfo.GetFiles()) + { + file.Delete(); + } + } + + _logger.LogDebug("Delete archive"); + + string fileName = $"{model.FolderName}.zip"; + + if (File.Exists(fileName)) + { + File.Delete(fileName); + } + + // берем метод для сохранения + _logger.LogDebug("Get assembly"); + + var typeIId = typeof(IId); + var assembly = typeIId.Assembly; + + if (assembly == null) + { + throw new ArgumentNullException("Сборка не найдена", nameof(assembly)); + } + + var types = assembly.GetTypes(); + var method = GetType().GetMethod("SaveToFile", BindingFlags.NonPublic | BindingFlags.Instance); + + _logger.LogDebug("Find {count} types", types.Length); + + foreach (var type in types) + { + if (type.IsInterface && type.GetInterface(typeIId.Name) != null) + { + var modelType = _backUpInfo.GetTypeByModelInterface(type.Name); + + if (modelType == null) + { + throw new InvalidOperationException($"Не найден класс - модель для { type.Name }"); + } + + _logger.LogDebug("Call SaveToFile method for {name} type", type.Name); + + // вызываем метод на выполнение + method?.MakeGenericMethod(modelType).Invoke(this, new object[] { model.FolderName }); + } + } + + _logger.LogDebug("Create zip and remove folder"); + + // архивируем + ZipFile.CreateFromDirectory(model.FolderName, fileName); + + // удаляем папку + dirInfo.Delete(true); + } + catch (Exception) + { + throw; + } + } + + private void SaveToFile(string folderName) where T : class, new() + { + var records = _backUpInfo.GetList(); + + if (records == null) + { + _logger.LogWarning("{type} type get null list", typeof(T).Name); + + return; + } + + var jsonFormatter = new DataContractJsonSerializer(typeof(List)); + + using var fs = new FileStream(string.Format("{0}/{1}.json", folderName, typeof(T).Name), FileMode.OpenOrCreate); + + jsonFormatter.WriteObject(fs, records); + } + } + +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/Attributes/ColumnAttribute.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/Attributes/ColumnAttribute.cs new file mode 100644 index 0000000..c34a5fe --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/Attributes/ColumnAttribute.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopContracts.Attributes +{ + [AttributeUsage(AttributeTargets.Property)] + public class ColumnAttribute : Attribute + { + public ColumnAttribute(string title = "", bool visible = true, int width = 0, + GridViewAutoSize gridViewAutoSize = GridViewAutoSize.None, bool isUseAutoSize = false) + { + Title = title; + Visible = visible; + Width = width; + GridViewAutoSize = gridViewAutoSize; + IsUseAutoSize = isUseAutoSize; + } + + public string Title { get; private set; } + + public bool Visible { get; private set; } + + public int Width { get; private set; } + + public GridViewAutoSize GridViewAutoSize { get; private set; } + + public bool IsUseAutoSize { get; private set; } + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/Attributes/GridViewAutoSize.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/Attributes/GridViewAutoSize.cs new file mode 100644 index 0000000..9743ae1 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/Attributes/GridViewAutoSize.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopContracts.Attributes +{ + public enum GridViewAutoSize + { + NotSet = 0, + + None = 1, + + ColumnHeader = 2, + + AllCellsExceptHeader = 4, + + AllCells = 6, + + DisplayedCellsExceptHeader = 8, + + DisplayedCells = 10, + + Fill = 16 + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/BindingModels/BackUpSaveBinidngModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BindingModels/BackUpSaveBinidngModel.cs new file mode 100644 index 0000000..df0ac4c --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BindingModels/BackUpSaveBinidngModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopContracts.BindingModels +{ + public class BackUpSaveBinidngModel + { + public string FolderName { get; set; } = string.Empty; + } + +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/BlacksmithWorkshopContracts.csproj b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BlacksmithWorkshopContracts.csproj index f685e06..9e282a5 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/BlacksmithWorkshopContracts.csproj +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BlacksmithWorkshopContracts.csproj @@ -6,6 +6,10 @@ enable + + + + diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/BusinessLogicsContracts/IBackUpLogic.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BusinessLogicsContracts/IBackUpLogic.cs new file mode 100644 index 0000000..7c3cb90 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BusinessLogicsContracts/IBackUpLogic.cs @@ -0,0 +1,17 @@ +using BlacksmithWorkshopContracts.BindingModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopContracts.BusinessLogicsContracts +{ + //интерфейс создания бекапа + public interface IBackUpLogic + { + //путь и имя файла для архивации + void CreateBackUp(BackUpSaveBinidngModel model); + } + +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/DependencyManager.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/DependencyManager.cs new file mode 100644 index 0000000..2335d5e --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/DependencyManager.cs @@ -0,0 +1,63 @@ +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopContracts.DI +{ + /// + /// Менеджер для работы с зависимостями + /// + public class DependencyManager + { + private readonly IDependencyContainer _dependencyManager; + + private static DependencyManager? _manager; + + private static readonly object _locjObject = new(); + + private DependencyManager() + { + _dependencyManager = new ServiceDependencyContainer(); + } + + public static DependencyManager Instance + { + get + { + if (_manager == null) { lock (_locjObject) { _manager = new DependencyManager(); } } + + return _manager; + } + } + + //Иницализация библиотек, в которых идут установки зависомстей + public static void InitDependency() + { + var ext = ServiceProviderLoader.GetImplementationExtensions(); + + if (ext == null) + { + throw new ArgumentNullException("Отсутствуют компоненты для загрузки зависимостей по модулям"); + } + + // регистрируем зависимости + ext.RegisterServices(); + } + + //Регистрация логгера + public void AddLogging(Action configure) => _dependencyManager.AddLogging(configure); + + //Добавление зависимости + public void RegisterType(bool isSingle = false) where U : class, T where T : class => _dependencyManager.RegisterType(isSingle); + + //Добавление зависимости + public void RegisterType(bool isSingle = false) where T : class => _dependencyManager.RegisterType(isSingle); + + //Получение класса со всеми зависмостями + public T Resolve() => _dependencyManager.Resolve(); + } + +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/IDependencyContainer.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/IDependencyContainer.cs new file mode 100644 index 0000000..d4b1f9d --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/IDependencyContainer.cs @@ -0,0 +1,26 @@ +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopContracts.DI +{ + //Интерфейс установки зависмости между элементами + public interface IDependencyContainer + { + //Регистрация логгера + void AddLogging(Action configure); + + //Добавление зависимости + void RegisterType(bool isSingle) where U : class, T where T : + class; + + //Добавление зависимости + void RegisterType(bool isSingle) where T : class; + + //Получение класса со всеми зависмостями + T Resolve(); + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/IImplementationExtension.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/IImplementationExtension.cs new file mode 100644 index 0000000..7a7c24e --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/IImplementationExtension.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopContracts.DI +{ + + //Интерфейс для регистрации зависимостей в модулях + public interface IImplementationExtension + { + public int Priority { get; } + + //Регистрация сервисов + public void RegisterServices(); + } + +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/ServiceProviderLoader.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/ServiceProviderLoader.cs new file mode 100644 index 0000000..12929f0 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/ServiceProviderLoader.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopContracts.DI +{ + //Загрузчик данных + public static partial class ServiceProviderLoader + { + //Загрузка всех классов-реализаций IImplementationExtension + public static IImplementationExtension? GetImplementationExtensions() + { + IImplementationExtension? source = null; + + var files = Directory.GetFiles(TryGetImplementationExtensionsFolder(), "*.dll", SearchOption.AllDirectories); + + foreach (var file in files.Distinct()) + { + Assembly asm = Assembly.LoadFrom(file); + + foreach (var t in asm.GetExportedTypes()) + { + if (t.IsClass && typeof(IImplementationExtension).IsAssignableFrom(t)) + { + if (source == null) + { + source = (IImplementationExtension)Activator.CreateInstance(t)!; + } + else + { + var newSource = (IImplementationExtension)Activator.CreateInstance(t)!; + + if (newSource.Priority > source.Priority) + { + source = newSource; + } + } + } + } + } + + return source; + } + + private static string TryGetImplementationExtensionsFolder() + { + var directory = new DirectoryInfo(Directory.GetCurrentDirectory()); + + while (directory != null && !directory.GetDirectories("ImplementationExtensions", + SearchOption.AllDirectories).Any(x => x.Name == "ImplementationExtensions")) + { + directory = directory.Parent; + } + + return $"{directory?.FullName}\\ImplementationExtensions"; + } + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/StoragesContracts/IBackUpInfo.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/StoragesContracts/IBackUpInfo.cs new file mode 100644 index 0000000..30efc7d --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/StoragesContracts/IBackUpInfo.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopContracts.StoragesContracts +{ + //интерфейс получения данных по всем сущностям + public interface IBackUpInfo + { + //метод получения данных по всем сущностям + List? GetList() where T : class, new(); + + Type? GetTypeByModelInterface(string modelInterfaceName); + } + +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ClientViewModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ClientViewModel.cs index 1f817c6..ca7e87a 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ClientViewModel.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ClientViewModel.cs @@ -12,13 +12,10 @@ namespace BlacksmithWorkshopContracts.ViewModels { public int Id { get; set; } - [DisplayName("ФИО клиента")] public string ClientFIO { get; set; } = string.Empty; - [DisplayName("Логин (эл. почта)")] public string Email { get; set; } = string.Empty; - [DisplayName("Пароль")] public string Password { get; set; } = string.Empty; } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Implements/BackUpInfo.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Implements/BackUpInfo.cs new file mode 100644 index 0000000..aefe94f --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Implements/BackUpInfo.cs @@ -0,0 +1,36 @@ +using BlacksmithWorkshopContracts.StoragesContracts; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopDatabaseImplement.Implements +{ + public class BackUpInfo : IBackUpInfo + { + public List? GetList() where T : class, new() + { + using var context = new BlacksmithWorkshopDatabase(); + + return context.Set().ToList(); + } + + public Type? GetTypeByModelInterface(string modelInterfaceName) + { + var assembly = typeof(BackUpInfo).Assembly; + var types = assembly.GetTypes(); + + foreach (var type in types) + { + if (type.IsClass && type.GetInterface(modelInterfaceName) != null) + { + return type; + } + } + + return null; + } + } + +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopListImplement/ListImplementationExtension.cs b/BlacksmithWorkshop/BlacksmithWorkshopListImplement/ListImplementationExtension.cs new file mode 100644 index 0000000..2f024fd --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopListImplement/ListImplementationExtension.cs @@ -0,0 +1,34 @@ +using BlacksmithWorkshopContracts.DI; +using BlacksmithWorkshopContracts.StoragesContracts; +using BlacksmithWorkshopListImplement.Implements; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopListImplement +{ + public class ListImplementationExtension : IImplementationExtension + { + public int Priority => 0; + + public void RegisterServices() + { + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + } + } + +} -- 2.25.1 From 7097dab6007b104378faad8ecde3bead977ca8f9 Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Sat, 29 Apr 2023 13:35:30 +0400 Subject: [PATCH 02/11] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=BF=D0=BE=20=D0=B7=D0=B0=D0=B2=D0=B8=D1=81=D0=B8=D0=BC=D0=BE?= =?UTF-8?q?=D1=81=D1=82=D1=8F=D0=BC.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BlacksmithWorkshop/FormImplementers.cs | 23 +++---- .../BlacksmithWorkshop/FormMain.cs | 63 ++++++----------- .../BlacksmithWorkshop/FormManufacture.cs | 69 +++++++++---------- .../BlacksmithWorkshop/FormManufactures.cs | 23 +++---- .../BlacksmithWorkshop/FormWorkPieces.cs | 23 +++---- .../DI/ServiceDependencyContainer.cs | 62 +++++++++++++++++ .../Implements/BackUpInfo.cs | 22 ++++++ 7 files changed, 163 insertions(+), 122 deletions(-) create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/ServiceDependencyContainer.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopListImplement/Implements/BackUpInfo.cs diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormImplementers.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormImplementers.cs index 9cc564e..6bf2565 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/FormImplementers.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormImplementers.cs @@ -1,5 +1,6 @@ using BlacksmithWorkshopContracts.BindingModels; using BlacksmithWorkshopContracts.BusinessLogicsContracts; +using BlacksmithWorkshopContracts.DI; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; @@ -58,14 +59,11 @@ namespace BlacksmithWorkshop private void ButtonCreate_Click(object sender, EventArgs e) { - var service = Program.ServiceProvider?.GetService(typeof(FormImplementer)); + var form = DependencyManager.Instance.Resolve(); - if (service is FormImplementer form) + if (form.ShowDialog() == DialogResult.OK) { - if (form.ShowDialog() == DialogResult.OK) - { - LoadData(); - } + LoadData(); } } @@ -73,16 +71,13 @@ namespace BlacksmithWorkshop { if (dataGridView.SelectedRows.Count == 1) { - var service = Program.ServiceProvider?.GetService(typeof(FormImplementer)); + var form = DependencyManager.Instance.Resolve(); - if (service is FormImplementer form) + form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); + + if (form.ShowDialog() == DialogResult.OK) { - form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); - - if (form.ShowDialog() == DialogResult.OK) - { - LoadData(); - } + LoadData(); } } } diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs index 7e5af01..0f833ad 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs @@ -1,6 +1,7 @@ using BlacksmithWorkshopBusinessLogic.BusinessLogic; using BlacksmithWorkshopContracts.BindingModels; using BlacksmithWorkshopContracts.BusinessLogicsContracts; +using BlacksmithWorkshopContracts.DI; using BlacksmithWorkshopDataModels.Enums; using Microsoft.Extensions.Logging; using System; @@ -73,34 +74,24 @@ namespace BlacksmithWorkshop private void WorkPieceToolStripMenuItem_Click(object sender, EventArgs e) { - var service = Program.ServiceProvider?.GetService(typeof(FormWorkPieces)); + var form = DependencyManager.Instance.Resolve(); - if (service is FormWorkPieces form) - { - form.ShowDialog(); - } + form.ShowDialog(); } private void ManufactureToolStripMenuItem_Click(object sender, EventArgs e) { - var service = Program.ServiceProvider?.GetService(typeof(FormManufactures)); + var form = DependencyManager.Instance.Resolve(); - if (service is FormManufactures form) - { - form.ShowDialog(); - } + form.ShowDialog(); } private void ButtonCreateOrder_Click(object sender, EventArgs e) { - var service = Program.ServiceProvider?.GetService(typeof(FormCreateOrder)); - - if (service is FormCreateOrder form) - { - form.ShowDialog(); - LoadData(); - } + var form = DependencyManager.Instance.Resolve(); + form.ShowDialog(); + LoadData(); } private void ButtonIssuedOrder_Click(object sender, EventArgs e) @@ -156,59 +147,45 @@ namespace BlacksmithWorkshop private void WorkPieceManufacturesToolStripMenuItem_Click(object sender, EventArgs e) { - var service = Program.ServiceProvider?.GetService(typeof(FormReportManufactureWorkPieces)); + var form = DependencyManager.Instance.Resolve(); + + form.ShowDialog(); - if (service is FormReportManufactureWorkPieces form) - { - form.ShowDialog(); - } } private void OrdersToolStripMenuItem_Click(object sender, EventArgs e) { - var service = Program.ServiceProvider?.GetService(typeof(FormReportOrders)); + var form = DependencyManager.Instance.Resolve(); - if (service is FormReportOrders form) - { - form.ShowDialog(); - } + form.ShowDialog(); } private void ClientsToolStripMenuItem_Click(object sender, EventArgs e) { - var service = Program.ServiceProvider?.GetService(typeof(FormClients)); + var form = DependencyManager.Instance.Resolve(); - if (service is FormClients form) - { - form.ShowDialog(); - } + form.ShowDialog(); } private void StartingWorkToolStripMenuItem_Click(object sender, EventArgs e) { - _workProcess.DoWork((Program.ServiceProvider?.GetService(typeof(IImplementerLogic)) as IImplementerLogic)!, _orderLogic); + _workProcess.DoWork(DependencyManager.Instance.Resolve()!, _orderLogic); MessageBox.Show("Процесс обработки запущен", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information); } private void ImplementerToolStripMenuItem_Click(object sender, EventArgs e) { - var service = Program.ServiceProvider?.GetService(typeof(FormImplementers)); + var form = DependencyManager.Instance.Resolve(); - if (service is FormImplementers form) - { - form.ShowDialog(); - } + form.ShowDialog(); } private void MailsToolStripMenuItem_Click(object sender, EventArgs e) { - var service = Program.ServiceProvider?.GetService(typeof(FormMails)); + var form = DependencyManager.Instance.Resolve(); - if (service is FormMails form) - { - form.ShowDialog(); - } + form.ShowDialog(); } private void CreateBackUpToolStripMenuItem_Click(object sender, EventArgs e) diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormManufacture.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormManufacture.cs index 1aed36c..055a2a9 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/FormManufacture.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormManufacture.cs @@ -1,5 +1,6 @@ using BlacksmithWorkshopContracts.BindingModels; using BlacksmithWorkshopContracts.BusinessLogicsContracts; +using BlacksmithWorkshopContracts.DI; using BlacksmithWorkshopContracts.SearchModels; using BlacksmithWorkshopDataModels.Models; using Microsoft.Extensions.Logging; @@ -89,30 +90,27 @@ namespace BlacksmithWorkshop private void ButtonAdd_Click(object sender, EventArgs e) { - var service = Program.ServiceProvider?.GetService(typeof(FormManufactureWorkPiece)); - - if (service is FormManufactureWorkPiece form) + var form = DependencyManager.Instance.Resolve(); + + if (form.ShowDialog() == DialogResult.OK) { - if (form.ShowDialog() == DialogResult.OK) + if (form.WorkPieceModel == null) { - if (form.WorkPieceModel == null) - { - return; - } - - _logger.LogInformation("Добавление новой заготовки:{WorkPieceName} - {Count}", form.WorkPieceModel.WorkPieceName, form.Count); - - if (_manufactureWorkPieces.ContainsKey(form.Id)) - { - _manufactureWorkPieces[form.Id] = (form.WorkPieceModel, form.Count); - } - else - { - _manufactureWorkPieces.Add(form.Id, (form.WorkPieceModel, form.Count)); - } - - LoadData(); + return; } + + _logger.LogInformation("Добавление новой заготовки:{WorkPieceName} - {Count}", form.WorkPieceModel.WorkPieceName, form.Count); + + if (_manufactureWorkPieces.ContainsKey(form.Id)) + { + _manufactureWorkPieces[form.Id] = (form.WorkPieceModel, form.Count); + } + else + { + _manufactureWorkPieces.Add(form.Id, (form.WorkPieceModel, form.Count)); + } + + LoadData(); } } @@ -120,26 +118,23 @@ namespace BlacksmithWorkshop { if (dataGridView.SelectedRows.Count == 1) { - var service = Program.ServiceProvider?.GetService(typeof(FormManufactureWorkPiece)); + var form = DependencyManager.Instance.Resolve(); - if (service is FormManufactureWorkPiece form) + int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells[0].Value); + form.Id = id; + form.Count = _manufactureWorkPieces[id].Item2; + + if (form.ShowDialog() == DialogResult.OK) { - int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells[0].Value); - form.Id = id; - form.Count = _manufactureWorkPieces[id].Item2; - - if (form.ShowDialog() == DialogResult.OK) + if (form.WorkPieceModel == null) { - if (form.WorkPieceModel == null) - { - return; - } - - _logger.LogInformation("Изменение компонента:{WorkPieceName} - {Count}", form.WorkPieceModel.WorkPieceName, form.Count); - _manufactureWorkPieces[form.Id] = (form.WorkPieceModel, form.Count); - - LoadData(); + return; } + + _logger.LogInformation("Изменение компонента:{WorkPieceName} - {Count}", form.WorkPieceModel.WorkPieceName, form.Count); + _manufactureWorkPieces[form.Id] = (form.WorkPieceModel, form.Count); + + LoadData(); } } } diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormManufactures.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormManufactures.cs index 00d71a4..a06e1ec 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/FormManufactures.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormManufactures.cs @@ -1,5 +1,6 @@ using BlacksmithWorkshopContracts.BindingModels; using BlacksmithWorkshopContracts.BusinessLogicsContracts; +using BlacksmithWorkshopContracts.DI; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; @@ -58,14 +59,11 @@ namespace BlacksmithWorkshop private void ButtonAdd_Click(object sender, EventArgs e) { - var service = Program.ServiceProvider?.GetService(typeof(FormManufacture)); + var form = DependencyManager.Instance.Resolve(); - if (service is FormManufacture form) + if (form.ShowDialog() == DialogResult.OK) { - if (form.ShowDialog() == DialogResult.OK) - { - LoadData(); - } + LoadData(); } } @@ -73,16 +71,13 @@ namespace BlacksmithWorkshop { if (dataGridView.SelectedRows.Count == 1) { - var service = Program.ServiceProvider?.GetService(typeof(FormManufacture)); + var form = DependencyManager.Instance.Resolve(); - if (service is FormManufacture form) - { - form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); + form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); - if (form.ShowDialog() == DialogResult.OK) - { - LoadData(); - } + if (form.ShowDialog() == DialogResult.OK) + { + LoadData(); } } } diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormWorkPieces.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormWorkPieces.cs index 0007c92..0abe750 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/FormWorkPieces.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormWorkPieces.cs @@ -1,5 +1,6 @@ using BlacksmithWorkshopContracts.BindingModels; using BlacksmithWorkshopContracts.BusinessLogicsContracts; +using BlacksmithWorkshopContracts.DI; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; @@ -57,14 +58,11 @@ namespace BlacksmithWorkshop private void ButtonAdd_Click(object sender, EventArgs e) { - var service = Program.ServiceProvider?.GetService(typeof(FormWorkPiece)); + var form = DependencyManager.Instance.Resolve(); - if (service is FormWorkPiece form) + if (form.ShowDialog() == DialogResult.OK) { - if (form.ShowDialog() == DialogResult.OK) - { - LoadData(); - } + LoadData(); } } @@ -73,15 +71,12 @@ namespace BlacksmithWorkshop { if (dataGridView.SelectedRows.Count == 1) { - var service = Program.ServiceProvider?.GetService(typeof(FormWorkPiece)); - - if (service is FormWorkPiece form) + var form = DependencyManager.Instance.Resolve(); + + form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); + if (form.ShowDialog() == DialogResult.OK) { - form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); - if (form.ShowDialog() == DialogResult.OK) - { - LoadData(); - } + LoadData(); } } } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/ServiceDependencyContainer.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/ServiceDependencyContainer.cs new file mode 100644 index 0000000..bdc7f22 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/ServiceDependencyContainer.cs @@ -0,0 +1,62 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopContracts.DI +{ + public class ServiceDependencyContainer : IDependencyContainer + { + private ServiceProvider? _serviceProvider; + + private readonly ServiceCollection _serviceCollection; + + public ServiceDependencyContainer() + { + _serviceCollection = new ServiceCollection(); + } + + public void AddLogging(Action configure) + { + _serviceCollection.AddLogging(configure); + } + + public void RegisterType(bool isSingle) where U : class, T where T : class + { + if (isSingle) + { + _serviceCollection.AddSingleton(); + } + else + { + _serviceCollection.AddTransient(); + } + _serviceProvider = null; + } + + public void RegisterType(bool isSingle) where T : class + { + if (isSingle) + { + _serviceCollection.AddSingleton(); + } + else + { + _serviceCollection.AddTransient(); + } + _serviceProvider = null; + } + + public T Resolve() + { + if (_serviceProvider == null) + { + _serviceProvider = _serviceCollection.BuildServiceProvider(); + } + return _serviceProvider.GetService()!; + } + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopListImplement/Implements/BackUpInfo.cs b/BlacksmithWorkshop/BlacksmithWorkshopListImplement/Implements/BackUpInfo.cs new file mode 100644 index 0000000..9e150a8 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopListImplement/Implements/BackUpInfo.cs @@ -0,0 +1,22 @@ +using BlacksmithWorkshopContracts.StoragesContracts; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopListImplement.Implements +{ + public class BackUpInfo : IBackUpInfo + { + public List? GetList() where T : class, new() + { + throw new NotImplementedException(); + } + + public Type? GetTypeByModelInterface(string modelInterfaceName) + { + throw new NotImplementedException(); + } + } +} -- 2.25.1 From ebed3c5c1df40ea4b310b83f41ec6e7dc0a3f45b Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Sun, 30 Apr 2023 01:01:54 +0400 Subject: [PATCH 03/11] =?UTF-8?q?LabWork08=20=D0=BF=D0=BE=20=D0=B2=D0=B8?= =?UTF-8?q?=D0=B4=D0=B5=D0=BE.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ BlacksmithWorkshop/BlacksmithWorkshop.sln | 4 ++-- .../BlacksmithWorkshop/DataGridViewExtension.cs | 2 ++ .../BusinessLogic/BackUpLogic.cs | 4 ++++ .../Attributes/ColumnAttribute.cs | 1 + .../BindingModels/MessageInfoBindingModel.cs | 6 ++++-- .../DI/IImplementationExtension.cs | 1 + .../ViewModels/ClientViewModel.cs | 7 ++++++- .../ViewModels/MessageInfoViewModel.cs | 4 +++- .../Models/IMessageInfoModel.cs | 2 +- .../BlacksmithWorkshopDatabaseImplement.csproj | 4 ++++ .../Models/MessageInfo.cs | 4 +++- .../BlacksmithWorkshopFileImplement.csproj | 4 ++++ .../BlacksmithWorkshopFileImplement/Models/MessageInfo.cs | 6 ++++-- .../BlacksmithWorkshopListImplement.csproj | 4 ++++ .../BlacksmithWorkshopListImplement/Models/MessageInfo.cs | 6 ++++-- 16 files changed, 49 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index ca1c7a3..a743e0a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,8 @@ # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs +ImplementationExtensions + # Mono auto generated files mono_crash.* diff --git a/BlacksmithWorkshop/BlacksmithWorkshop.sln b/BlacksmithWorkshop/BlacksmithWorkshop.sln index d66652b..96a37bb 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop.sln +++ b/BlacksmithWorkshop/BlacksmithWorkshop.sln @@ -17,9 +17,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlacksmithWorkshopFileImple EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlacksmithWorkshopDatabaseImplement", "BlacksmithWorkshopDatabaseImplement\BlacksmithWorkshopDatabaseImplement.csproj", "{EE03BAE3-52EE-4E3B-8992-382D89E61E1A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlacksmithWorkshopRestApi", "BlackmithWorkshopRestApi\BlacksmithWorkshopRestApi.csproj", "{23DBD9A3-2107-44AB-8B87-6982BFD2E69A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlacksmithWorkshopRestApi", "BlackmithWorkshopRestApi\BlacksmithWorkshopRestApi.csproj", "{23DBD9A3-2107-44AB-8B87-6982BFD2E69A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlacksmithWorkshopClientApp", "BlacksmithWorkshopClientApp\BlacksmithWorkshopClientApp.csproj", "{FCA95914-11AF-494A-8116-BB7B3253D925}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlacksmithWorkshopClientApp", "BlacksmithWorkshopClientApp\BlacksmithWorkshopClientApp.csproj", "{FCA95914-11AF-494A-8116-BB7B3253D925}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/DataGridViewExtension.cs b/BlacksmithWorkshop/BlacksmithWorkshop/DataGridViewExtension.cs index 5f555c7..fd6b156 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/DataGridViewExtension.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/DataGridViewExtension.cs @@ -18,8 +18,10 @@ namespace BlacksmithWorkshop grid.DataSource = data; + //получаем тип var type = typeof(T); + //получаем свойства var properties = type.GetProperties(); foreach (DataGridViewColumn column in grid.Columns) diff --git a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogic/BackUpLogic.cs b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogic/BackUpLogic.cs index c59648b..6169c15 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogic/BackUpLogic.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogic/BackUpLogic.cs @@ -19,6 +19,7 @@ namespace BlacksmithWorkshopBusinessLogic.BusinessLogic private readonly ILogger _logger; private readonly IBackUpInfo _backUpInfo; + public BackUpLogic(ILogger logger, IBackUpInfo backUpInfo) { _logger = logger; @@ -40,6 +41,7 @@ namespace BlacksmithWorkshopBusinessLogic.BusinessLogic if (dirInfo.Exists) { + //НЕ ВЫБИРАЕМ РАБОЧИЙ СТОЛ, ИНАЧЕ ВСЁ С НЕГО УДАЛИТСЯ foreach (var file in dirInfo.GetFiles()) { file.Delete(); @@ -73,6 +75,7 @@ namespace BlacksmithWorkshopBusinessLogic.BusinessLogic foreach (var type in types) { + //проверка на то, является ли тип интерфейсом и унаследован ли он от IId if (type.IsInterface && type.GetInterface(typeIId.Name) != null) { var modelType = _backUpInfo.GetTypeByModelInterface(type.Name); @@ -114,6 +117,7 @@ namespace BlacksmithWorkshopBusinessLogic.BusinessLogic return; } + //три строчки ниже - сериализация файлов в json var jsonFormatter = new DataContractJsonSerializer(typeof(List)); using var fs = new FileStream(string.Format("{0}/{1}.json", folderName, typeof(T).Name), FileMode.OpenOrCreate); diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/Attributes/ColumnAttribute.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/Attributes/ColumnAttribute.cs index c34a5fe..aec5b3a 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/Attributes/ColumnAttribute.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/Attributes/ColumnAttribute.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; namespace BlacksmithWorkshopContracts.Attributes { + //указываем, что данный атрибут можно прописать только в Property [AttributeUsage(AttributeTargets.Property)] public class ColumnAttribute : Attribute { diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/BindingModels/MessageInfoBindingModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BindingModels/MessageInfoBindingModel.cs index 7d7d454..23b9a70 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/BindingModels/MessageInfoBindingModel.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BindingModels/MessageInfoBindingModel.cs @@ -9,7 +9,9 @@ namespace BlacksmithWorkshopContracts.BindingModels { public class MessageInfoBindingModel : IMessageInfoModel { - public string MessageId { get; set; } = string.Empty; + public int Id { get; set; } + + public string MessageId { get; set; } = string.Empty; public int? ClientId { get; set; } @@ -20,5 +22,5 @@ namespace BlacksmithWorkshopContracts.BindingModels public string Subject { get; set; } = string.Empty; public string Body { get; set; } = string.Empty; - } + } } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/IImplementationExtension.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/IImplementationExtension.cs index 7a7c24e..12b6fd0 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/IImplementationExtension.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/IImplementationExtension.cs @@ -10,6 +10,7 @@ namespace BlacksmithWorkshopContracts.DI //Интерфейс для регистрации зависимостей в модулях public interface IImplementationExtension { + //для установления приоритета public int Priority { get; } //Регистрация сервисов diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ClientViewModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ClientViewModel.cs index ca7e87a..f222404 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ClientViewModel.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ClientViewModel.cs @@ -1,4 +1,5 @@ -using BlacksmithWorkshopDataModels.Models; +using BlacksmithWorkshopContracts.Attributes; +using BlacksmithWorkshopDataModels.Models; using System; using System.Collections.Generic; using System.ComponentModel; @@ -10,12 +11,16 @@ namespace BlacksmithWorkshopContracts.ViewModels { public class ClientViewModel : IClientModel { + [Column(visible: false)] public int Id { get; set; } + [Column(title: "ФИО клиента", width: 150)] public string ClientFIO { get; set; } = string.Empty; + [Column(title: "Логие (эл. почта)", gridViewAutoSize: GridViewAutoSize.Fill, isUseAutoSize: true)] public string Email { get; set; } = string.Empty; + [Column(title: "Пароль", width: 150)] public string Password { get; set; } = string.Empty; } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/MessageInfoViewModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/MessageInfoViewModel.cs index 5933def..8a9a2a1 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/MessageInfoViewModel.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/MessageInfoViewModel.cs @@ -10,7 +10,9 @@ namespace BlacksmithWorkshopContracts.ViewModels { public class MessageInfoViewModel : IMessageInfoModel { - public string MessageId { get; set; } = string.Empty; + public int Id { get; set; } + + public string MessageId { get; set; } = string.Empty; public int? ClientId { get; set; } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDataModels/Models/IMessageInfoModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopDataModels/Models/IMessageInfoModel.cs index a7ac56e..b91d51d 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopDataModels/Models/IMessageInfoModel.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopDataModels/Models/IMessageInfoModel.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace BlacksmithWorkshopDataModels.Models { - public interface IMessageInfoModel + public interface IMessageInfoModel : IId { string MessageId { get; } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/BlacksmithWorkshopDatabaseImplement.csproj b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/BlacksmithWorkshopDatabaseImplement.csproj index bdecbbd..15df830 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/BlacksmithWorkshopDatabaseImplement.csproj +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/BlacksmithWorkshopDatabaseImplement.csproj @@ -20,4 +20,8 @@ + + + + diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/MessageInfo.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/MessageInfo.cs index a42d009..d0f0af4 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/MessageInfo.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/MessageInfo.cs @@ -12,7 +12,9 @@ namespace BlacksmithWorkshopDatabaseImplement.Models { public class MessageInfo : IMessageInfoModel { - [Key] + public int Id { get; set; } + + [Key] public string MessageId { get; set; } = string.Empty; public int? ClientId { get; set; } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/BlacksmithWorkshopFileImplement.csproj b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/BlacksmithWorkshopFileImplement.csproj index b65badc..d1597ab 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/BlacksmithWorkshopFileImplement.csproj +++ b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/BlacksmithWorkshopFileImplement.csproj @@ -11,4 +11,8 @@ + + + + diff --git a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/MessageInfo.cs b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/MessageInfo.cs index 4884680..5d36e6a 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/MessageInfo.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/MessageInfo.cs @@ -14,7 +14,9 @@ namespace BlacksmithWorkshopFileImplement.Models { public class MessageInfo : IMessageInfoModel { - public string MessageId { get; private set; } = string.Empty; + public int Id { get; private set; } + + public string MessageId { get; private set; } = string.Empty; public int? ClientId { get; private set; } @@ -94,5 +96,5 @@ namespace BlacksmithWorkshopFileImplement.Models new XElement("Body", Body), new XElement("Subject", Subject), new XElement("DateDelivery", DateDelivery.ToString())); - } + } } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopListImplement/BlacksmithWorkshopListImplement.csproj b/BlacksmithWorkshop/BlacksmithWorkshopListImplement/BlacksmithWorkshopListImplement.csproj index b65badc..d1597ab 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopListImplement/BlacksmithWorkshopListImplement.csproj +++ b/BlacksmithWorkshop/BlacksmithWorkshopListImplement/BlacksmithWorkshopListImplement.csproj @@ -11,4 +11,8 @@ + + + + diff --git a/BlacksmithWorkshop/BlacksmithWorkshopListImplement/Models/MessageInfo.cs b/BlacksmithWorkshop/BlacksmithWorkshopListImplement/Models/MessageInfo.cs index cfcc629..e116e76 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopListImplement/Models/MessageInfo.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopListImplement/Models/MessageInfo.cs @@ -12,7 +12,9 @@ namespace BlacksmithWorkshopListImplement.Models { public class MessageInfo : IMessageInfoModel { - public string MessageId { get; private set; } = string.Empty; + public int Id { get; private set; } + + public string MessageId { get; private set; } = string.Empty; public int? ClientId { get; private set; } @@ -69,5 +71,5 @@ namespace BlacksmithWorkshopListImplement.Models Subject = Subject, Body = Body }; - } + } } -- 2.25.1 From 5fd72c9524080c21a34bfbf62506e4c6bb87f129 Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Sun, 30 Apr 2023 11:44:13 +0400 Subject: [PATCH 04/11] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83?= =?UTF-8?q?=D0=B7=D0=BA=D0=B8=20dataGridView.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BlacksmithWorkshop/FormImplementers.cs | 19 ++++++------------- .../BlacksmithWorkshop/FormMails.cs | 12 ++---------- .../BlacksmithWorkshop/FormMain.cs | 13 +------------ .../BlacksmithWorkshop/FormManufactures.cs | 13 +++---------- .../BlacksmithWorkshop/FormWorkPieces.cs | 13 +++---------- 5 files changed, 15 insertions(+), 55 deletions(-) diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormImplementers.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormImplementers.cs index 6bf2565..f2f7036 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/FormImplementers.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormImplementers.cs @@ -1,4 +1,5 @@ -using BlacksmithWorkshopContracts.BindingModels; +using BlacksmithWorkshopBusinessLogic.BusinessLogic; +using BlacksmithWorkshopContracts.BindingModels; using BlacksmithWorkshopContracts.BusinessLogicsContracts; using BlacksmithWorkshopContracts.DI; using Microsoft.Extensions.Logging; @@ -35,19 +36,11 @@ namespace BlacksmithWorkshop private void LoadData() { - try - { - var list = _logic.ReadList(null); + try + { + dataGridView.FillandConfigGrid(_logic.ReadList(null)); - //растягиваем колонку Название на всю ширину, колонку Id скрываем - if (list != null) - { - dataGridView.DataSource = list; - dataGridView.Columns["Id"].Visible = false; - dataGridView.Columns["ImplementerFIO"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; - } - - _logger.LogInformation("Загрузка исполнителей"); + _logger.LogInformation("Загрузка исполнителей"); } catch (Exception ex) { diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormMails.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormMails.cs index 56ae275..ab2f6fa 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/FormMails.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormMails.cs @@ -38,17 +38,9 @@ namespace BlacksmithWorkshop try { - var list = _messageLogic.ReadList(null); + dataGridView.FillandConfigGrid(_messageLogic.ReadList(null)); - if (list != null) - { - dataGridView.DataSource = list; - dataGridView.Columns["MessageId"].Visible = false; - dataGridView.Columns["ClientId"].Visible = false; - dataGridView.Columns["Body"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; - } - - _logger.LogInformation("Успешная загрузка писем"); + _logger.LogInformation("Успешная загрузка писем"); } catch (Exception ex) { diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs index 0f833ad..7f3c5c6 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs @@ -50,18 +50,7 @@ namespace BlacksmithWorkshop try { - var list = _orderLogic.ReadList(null); - - if (list != null) - { - dataGridView.DataSource = list; - dataGridView.Columns["ManufactureId"].Visible = false; - dataGridView.Columns["ImplementerId"].Visible = false; - dataGridView.Columns["ClientId"].Visible = false; - dataGridView.Columns["ManufactureName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; - dataGridView.Columns["ClientFIO"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; - dataGridView.Columns["ImplementerFIO"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; - } + dataGridView.FillandConfigGrid(_orderLogic.ReadList(null)); _logger.LogInformation("Загрузка заказов"); } diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormManufactures.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormManufactures.cs index a06e1ec..b2625c4 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/FormManufactures.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormManufactures.cs @@ -1,4 +1,5 @@ -using BlacksmithWorkshopContracts.BindingModels; +using BlacksmithWorkshopBusinessLogic.BusinessLogic; +using BlacksmithWorkshopContracts.BindingModels; using BlacksmithWorkshopContracts.BusinessLogicsContracts; using BlacksmithWorkshopContracts.DI; using Microsoft.Extensions.Logging; @@ -38,15 +39,7 @@ namespace BlacksmithWorkshop { try { - var list = _logic.ReadList(null); - - if (list != null) - { - dataGridView.DataSource = list; - dataGridView.Columns["Id"].Visible = false; - dataGridView.Columns["ManufactureWorkPieces"].Visible = false; - dataGridView.Columns["ManufactureName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; - } + dataGridView.FillandConfigGrid(_logic.ReadList(null)); _logger.LogInformation("Загрузка изделий"); } diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormWorkPieces.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormWorkPieces.cs index 0abe750..b1ebe5e 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/FormWorkPieces.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormWorkPieces.cs @@ -1,4 +1,5 @@ -using BlacksmithWorkshopContracts.BindingModels; +using BlacksmithWorkshopBusinessLogic.BusinessLogic; +using BlacksmithWorkshopContracts.BindingModels; using BlacksmithWorkshopContracts.BusinessLogicsContracts; using BlacksmithWorkshopContracts.DI; using Microsoft.Extensions.Logging; @@ -36,15 +37,7 @@ namespace BlacksmithWorkshop { try { - var list = _logic.ReadList(null); - - //растягиваем колонку Название на всю ширину, колонку Id скрываем - if(list != null) - { - dataGridView.DataSource = list; - dataGridView.Columns["Id"].Visible = false; - dataGridView.Columns["WorkPieceName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; - } + dataGridView.FillandConfigGrid(_logic.ReadList(null)); _logger.LogInformation("Загрузка заготовок"); } -- 2.25.1 From c984bc9462c7e5fe8984ea6d7a9c91d2c4312b33 Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Sun, 30 Apr 2023 12:07:12 +0400 Subject: [PATCH 05/11] =?UTF-8?q?=D0=93=D0=BB=D0=BE=D0=B1=D0=B0=D0=BB?= =?UTF-8?q?=D1=8C=D0=BD=D0=BE=D0=B5=20=D0=BF=D1=80=D0=BE=D0=BC=D0=B5=D0=B6?= =?UTF-8?q?=D1=83=D1=82=D0=BE=D1=87=D0=BD=D0=BE=D0=B5=20=D1=81=D0=BE=D1=85?= =?UTF-8?q?=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataBaseImplementationExtension.cs | 33 +++++++++++++++++ .../Models/Client.cs | 20 ++++++---- .../Models/Implementer.cs | 19 +++++++--- .../Models/Manufacture.cs | 6 +++ .../Models/ManufactureWorkPiece.cs | 6 +++ .../Models/MessageInfo.cs | 17 ++++++--- .../Models/Order.cs | 15 +++++++- .../Models/WorkPiece.cs | 5 +++ .../FileImplementationExtension.cs | 34 +++++++++++++++++ .../Implements/BackUpInfo.cs | 37 +++++++++++++++++++ .../Models/Client.cs | 12 ++++-- .../Models/Implementer.cs | 17 ++++++--- .../Models/Manufacture.cs | 7 +++- .../Models/MessageInfo.cs | 18 ++++++--- .../Models/Order.cs | 17 +++++++-- .../Models/WorkPiece.cs | 5 +++ 16 files changed, 231 insertions(+), 37 deletions(-) create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/DataBaseImplementationExtension.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopFileImplement/FileImplementationExtension.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Implements/BackUpInfo.cs diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/DataBaseImplementationExtension.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/DataBaseImplementationExtension.cs new file mode 100644 index 0000000..8967c2f --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/DataBaseImplementationExtension.cs @@ -0,0 +1,33 @@ +using BlacksmithWorkshopContracts.DI; +using BlacksmithWorkshopContracts.StoragesContracts; +using BlacksmithWorkshopDatabaseImplement.Implements; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopDatabaseImplement +{ + public class DataBaseImplementationExtension : IImplementationExtension + { + public int Priority => 2; + + public void RegisterServices() + { + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + } + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Client.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Client.cs index a2120cb..ad8b63d 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Client.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Client.cs @@ -6,23 +6,29 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; namespace BlacksmithWorkshopDatabaseImplement.Models { - public class Client : IClientModel + [DataContract] + public class Client : IClientModel { - public int Id { get; set; } + [DataMember] + public int Id { get; set; } + + [Required] + [DataMember] + public string ClientFIO { get; set; } = string.Empty; [Required] - public string ClientFIO { get; set; } = string.Empty; + [DataMember] + public string Email { get; set; } = string.Empty; [Required] - public string Email { get; set; } = string.Empty; - - [Required] - public string Password { get; set; } = string.Empty; + [DataMember] + public string Password { get; set; } = string.Empty; //для реализации связи многие ко многим с заказами (так как клиенты могу сделать одинаковый заказ) [ForeignKey("ClientId")] diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Implementer.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Implementer.cs index 972afd3..a45f54e 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Implementer.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Implementer.cs @@ -6,26 +6,33 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; namespace BlacksmithWorkshopDatabaseImplement.Models { - public class Implementer : IImplementerModel + [DataContract] + public class Implementer : IImplementerModel { - public int Id { get; set; } + [DataMember] + public int Id { get; set; } [Required] - public string ImplementerFIO { get; set; } = string.Empty; + [DataMember] + public string ImplementerFIO { get; set; } = string.Empty; [Required] - public string Password { get; set; } = string.Empty; + [DataMember] + public string Password { get; set; } = string.Empty; [Required] - public int WorkExperience { get; set; } + [DataMember] + public int WorkExperience { get; set; } [Required] - public int Qualification { get; set; } + [DataMember] + public int Qualification { get; set; } //для реализации связи один ко многим с заказами [ForeignKey("ImplementerId")] diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Manufacture.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Manufacture.cs index 742aa11..08543ad 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Manufacture.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Manufacture.cs @@ -7,25 +7,31 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; namespace BlacksmithWorkshopDatabaseImplement.Models { + [DataContract] public class Manufacture : IManufactureModel { + [DataMember] public int Id { get; set; } [Required] + [DataMember] public string ManufactureName { get; set; } = string.Empty; [Required] + [DataMember] public double Price { get; set; } public Dictionary? _manufactureWorkPieces = null; //это поле не будет "мапиться" в бд [NotMapped] + [DataMember] public Dictionary ManufactureWorkPieces { get diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/ManufactureWorkPiece.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/ManufactureWorkPiece.cs index dbe90f6..8bfea2a 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/ManufactureWorkPiece.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/ManufactureWorkPiece.cs @@ -2,22 +2,28 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; namespace BlacksmithWorkshopDatabaseImplement.Models { + [DataContract] public class ManufactureWorkPiece { + [DataMember] public int Id { get; set; } [Required] + [DataMember] public int ManufactureId { get; set; } [Required] + [DataMember] public int WorkPieceId { get; set; } [Required] + [DataMember] public int Count { get; set; } public virtual WorkPiece WorkPiece { get; set; } = new(); diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/MessageInfo.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/MessageInfo.cs index d0f0af4..9f67f02 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/MessageInfo.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/MessageInfo.cs @@ -5,31 +5,38 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; namespace BlacksmithWorkshopDatabaseImplement.Models { + [DataContract] public class MessageInfo : IMessageInfoModel { public int Id { get; set; } [Key] - public string MessageId { get; set; } = string.Empty; + [DataMember] + public string MessageId { get; set; } = string.Empty; public int? ClientId { get; set; } [Required] - public string SenderName { get; set; } = string.Empty; + [DataMember] + public string SenderName { get; set; } = string.Empty; [Required] - public DateTime DateDelivery { get; set; } = DateTime.Now; + [DataMember] + public DateTime DateDelivery { get; set; } = DateTime.Now; [Required] - public string Subject { get; set; } = string.Empty; + [DataMember] + public string Subject { get; set; } = string.Empty; [Required] - public string Body { get; set; } = string.Empty; + [DataMember] + public string Body { get; set; } = string.Empty; public virtual Client? Client { get; set; } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Order.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Order.cs index 8ca4b34..0ddcf3d 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Order.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Order.cs @@ -6,36 +6,47 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; using System.Xml.Linq; namespace BlacksmithWorkshopDatabaseImplement.Models { + [DataContract] public class Order : IOrderModel { + [DataMember] public int Id { get; private set; } [Required] + [DataMember] public int ManufactureId { get; private set; } [Required] - public int ClientId { get; private set; } + [DataMember] + public int ClientId { get; private set; } - public int? ImplementerId { get; private set; } + [DataMember] + public int? ImplementerId { get; private set; } [Required] + [DataMember] public int Count { get; private set; } [Required] + [DataMember] public double Sum { get; private set; } [Required] + [DataMember] public OrderStatus Status { get; private set; } = OrderStatus.Неизвестен; [Required] + [DataMember] public DateTime DateCreate { get; private set; } = DateTime.Now; + [DataMember] public DateTime? DateImplement { get; private set; } //для передачи названия изделия diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/WorkPiece.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/WorkPiece.cs index 8ef7ca3..e6c01b7 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/WorkPiece.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/WorkPiece.cs @@ -7,19 +7,24 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Data; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; namespace BlacksmithWorkshopDatabaseImplement.Models { + [DataContract] public class WorkPiece : IWorkPieceModel { + [DataMember] public int Id { get; private set; } [Required] + [DataMember] public string WorkPieceName { get; private set; } = string.Empty; [Required] + [DataMember] public double Cost { get; set; } //для реализации связи многие ко многим с изделиями diff --git a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/FileImplementationExtension.cs b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/FileImplementationExtension.cs new file mode 100644 index 0000000..28d2b45 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/FileImplementationExtension.cs @@ -0,0 +1,34 @@ +using BlacksmithWorkshopContracts.DI; +using BlacksmithWorkshopContracts.StoragesContracts; +using BlacksmithWorkshopFileImplement.Implements; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopFileImplement +{ + //для реализации нужных нам зависимостей в данном варианте хранения информации + public class FileImplementationExtension : IImplementationExtension + { + public int Priority => 1; + + public void RegisterServices() + { + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + } + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Implements/BackUpInfo.cs b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Implements/BackUpInfo.cs new file mode 100644 index 0000000..ae8ab4c --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Implements/BackUpInfo.cs @@ -0,0 +1,37 @@ +using BlacksmithWorkshopContracts.StoragesContracts; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopFileImplement.Implements +{ + public class BackUpInfo : IBackUpInfo + { + public List? GetList() where T : class, new() + { + var source = DataFileSingleton.GetInstance(); + + return (List?)source.GetType().GetProperties() + .FirstOrDefault(x => x.PropertyType.IsGenericType && x.PropertyType.GetGenericArguments()[0] == typeof(T)) + ?.GetValue(source); + } + + public Type? GetTypeByModelInterface(string modelInterfaceName) + { + var assembly = typeof(BackUpInfo).Assembly; + var types = assembly.GetTypes(); + + foreach (var type in types) + { + if (type.IsClass && type.GetInterface(modelInterfaceName) != null) + { + return type; + } + } + + return null; + } + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/Client.cs b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/Client.cs index 85bff7a..2d16557 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/Client.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/Client.cs @@ -7,21 +7,27 @@ using System.Collections.Generic; using System.Data; using System.Linq; using System.Reflection; +using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; using System.Xml.Linq; namespace BlacksmithWorkshopFileImplement.Models { + [DataContract] public class Client : IClientModel { + [DataMember] public int Id { get; private set; } - public string ClientFIO { get; private set; } = string.Empty; + [DataMember] + public string ClientFIO { get; private set; } = string.Empty; - public string Email { get; private set; } = string.Empty; + [DataMember] + public string Email { get; private set; } = string.Empty; - public string Password { get; private set; } = string.Empty; + [DataMember] + public string Password { get; private set; } = string.Empty; public static Client? Create(ClientBindingModel model) { diff --git a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/Implementer.cs b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/Implementer.cs index 21a0148..cb58634 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/Implementer.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/Implementer.cs @@ -5,23 +5,30 @@ using System; using System.Collections.Generic; using System.Linq; using System.Reflection; +using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; using System.Xml.Linq; namespace BlacksmithWorkshopFileImplement.Models { + [DataContract] public class Implementer : IImplementerModel { - public int Id { get; private set; } + [DataMember] + public int Id { get; private set; } - public string ImplementerFIO { get; private set; } = string.Empty; + [DataMember] + public string ImplementerFIO { get; private set; } = string.Empty; - public string Password { get; private set; } = string.Empty; + [DataMember] + public string Password { get; private set; } = string.Empty; - public int WorkExperience { get; private set; } + [DataMember] + public int WorkExperience { get; private set; } - public int Qualification { get; private set; } + [DataMember] + public int Qualification { get; private set; } public static Implementer? Create(ImplementerBindingModel model) { diff --git a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/Manufacture.cs b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/Manufacture.cs index fb73403..40d0062 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/Manufacture.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/Manufacture.cs @@ -4,6 +4,7 @@ using BlacksmithWorkshopDataModels.Models; using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; using System.Xml.Linq; @@ -11,19 +12,23 @@ using System.Xml.Linq; namespace BlacksmithWorkshopFileImplement.Models { //класс реализующий интерфейс модели изделия + [DataContract] public class Manufacture : IManufactureModel { + [DataMember] public int Id { get; private set; } + [DataMember] public string ManufactureName { get; private set; } = string.Empty; + [DataMember] public double Price { get; private set; } public Dictionary WorkPieces { get; private set; } = new(); - private Dictionary? _manufactureWorkPieces = null; + [DataMember] public Dictionary ManufactureWorkPieces { get diff --git a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/MessageInfo.cs b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/MessageInfo.cs index 5d36e6a..84bdd55 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/MessageInfo.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/MessageInfo.cs @@ -6,27 +6,35 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; +using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; using System.Xml.Linq; namespace BlacksmithWorkshopFileImplement.Models { + [DataContract] public class MessageInfo : IMessageInfoModel { public int Id { get; private set; } + [DataMember] public string MessageId { get; private set; } = string.Empty; - public int? ClientId { get; private set; } + [DataMember] + public int? ClientId { get; private set; } - public string SenderName { get; private set; } = string.Empty; + [DataMember] + public string SenderName { get; private set; } = string.Empty; - public DateTime DateDelivery { get; private set; } = DateTime.Now; + [DataMember] + public DateTime DateDelivery { get; private set; } = DateTime.Now; - public string Subject { get; private set; } = string.Empty; + [DataMember] + public string Subject { get; private set; } = string.Empty; - public string Body { get; private set; } = string.Empty; + [DataMember] + public string Body { get; private set; } = string.Empty; public static MessageInfo? Create(MessageInfoBindingModel model) { diff --git a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/Order.cs b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/Order.cs index 7635cd2..2f55887 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/Order.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/Order.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Reflection; +using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; using System.Xml.Linq; @@ -13,24 +14,34 @@ using System.Xml.Linq; namespace BlacksmithWorkshopFileImplement.Models { //класс, реализующий интерфейс модели заказа + [DataContract] public class Order : IOrderModel { + [DataMember] public int Id { get; private set; } - public int ClientId { get; private set; } + [DataMember] + public int ClientId { get; private set; } - public int? ImplementerId { get; private set; } + [DataMember] + public int? ImplementerId { get; private set; } - public int ManufactureId { get; private set; } + [DataMember] + public int ManufactureId { get; private set; } + [DataMember] public int Count { get; private set; } + [DataMember] public double Sum { get; private set; } + [DataMember] public OrderStatus Status { get; private set; } = OrderStatus.Неизвестен; + [DataMember] public DateTime DateCreate { get; private set; } = DateTime.Now; + [DataMember] public DateTime? DateImplement { get; private set; } public static Order? Create(OrderBindingModel model) diff --git a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/WorkPiece.cs b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/WorkPiece.cs index b4f6a61..895100e 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/WorkPiece.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/WorkPiece.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; using System.Xml.Linq; @@ -12,12 +13,16 @@ using System.Xml.Linq; namespace BlacksmithWorkshopFileImplement.Models { //реализация интерфейса модели заготовки + [DataContract] public class WorkPiece : IWorkPieceModel { + [DataMember] public int Id { get; private set; } + [DataMember] public string WorkPieceName { get; private set; } = string.Empty; + [DataMember] public double Cost { get; set; } public static WorkPiece? Create(WorkPieceBindingModel model) -- 2.25.1 From ea70ee1e69ac73c8efdeb8ffe84f205fbee41513 Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Sun, 30 Apr 2023 12:39:36 +0400 Subject: [PATCH 06/11] =?UTF-8?q?=D0=9F=D0=BE=D1=87=D1=82=D0=B8=20=D0=B3?= =?UTF-8?q?=D0=BE=D1=82=D0=BE=D0=B2=D0=BE.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModels/BackUpSaveBinidngModel.cs | 1 - .../BlacksmithWorkshopContracts.csproj | 2 + .../BusinessLogicsContracts/IBackUpLogic.cs | 1 - .../DI/DependencyManager.cs | 2 +- .../DI/UnityDependencyContainer.cs | 43 +++++++++++++++++++ .../ViewModels/ImplementerViewModel.cs | 20 +++++---- .../ViewModels/ManufactureViewModel.cs | 9 ++-- .../ViewModels/MessageInfoViewModel.cs | 16 ++++--- .../ViewModels/OrderViewModel.cs | 30 +++++++------ .../ViewModels/WorkPieceViewModel.cs | 6 ++- 10 files changed, 94 insertions(+), 36 deletions(-) create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/UnityDependencyContainer.cs diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/BindingModels/BackUpSaveBinidngModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BindingModels/BackUpSaveBinidngModel.cs index df0ac4c..01c9bd9 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/BindingModels/BackUpSaveBinidngModel.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BindingModels/BackUpSaveBinidngModel.cs @@ -10,5 +10,4 @@ namespace BlacksmithWorkshopContracts.BindingModels { public string FolderName { get; set; } = string.Empty; } - } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/BlacksmithWorkshopContracts.csproj b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BlacksmithWorkshopContracts.csproj index 9e282a5..2216d57 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/BlacksmithWorkshopContracts.csproj +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BlacksmithWorkshopContracts.csproj @@ -8,6 +8,8 @@ + + diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/BusinessLogicsContracts/IBackUpLogic.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BusinessLogicsContracts/IBackUpLogic.cs index 7c3cb90..0b66910 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/BusinessLogicsContracts/IBackUpLogic.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BusinessLogicsContracts/IBackUpLogic.cs @@ -13,5 +13,4 @@ namespace BlacksmithWorkshopContracts.BusinessLogicsContracts //путь и имя файла для архивации void CreateBackUp(BackUpSaveBinidngModel model); } - } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/DependencyManager.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/DependencyManager.cs index 2335d5e..a8837bb 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/DependencyManager.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/DependencyManager.cs @@ -20,7 +20,7 @@ namespace BlacksmithWorkshopContracts.DI private DependencyManager() { - _dependencyManager = new ServiceDependencyContainer(); + _dependencyManager = new UnityDependencyContainer(); } public static DependencyManager Instance diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/UnityDependencyContainer.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/UnityDependencyContainer.cs new file mode 100644 index 0000000..2ba045b --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/UnityDependencyContainer.cs @@ -0,0 +1,43 @@ +using Microsoft.Extensions.Logging; +using Unity.Microsoft.Logging; +using Unity; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopContracts.DI +{ + public class UnityDependencyContainer : IDependencyContainer + { + private readonly IUnityContainer _container; + + public UnityDependencyContainer() + { + _container = new UnityContainer(); + } + + public void AddLogging(Action configure) + { + var factory = LoggerFactory.Create(configure); + _container.AddExtension(new LoggingExtension(factory)); + } + + public void RegisterType(bool isSingle) where T : class + { + _container.RegisterType(isSingle ? TypeLifetime.Singleton : TypeLifetime.Transient); + + } + + public T Resolve() + { + return _container.Resolve(); + } + + void IDependencyContainer.RegisterType(bool isSingle) + { + _container.RegisterType(isSingle ? TypeLifetime.Singleton : TypeLifetime.Transient); + } + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ImplementerViewModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ImplementerViewModel.cs index 2554098..73c74b8 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ImplementerViewModel.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ImplementerViewModel.cs @@ -1,4 +1,5 @@ -using BlacksmithWorkshopDataModels.Models; +using BlacksmithWorkshopContracts.Attributes; +using BlacksmithWorkshopDataModels.Models; using System; using System.Collections.Generic; using System.ComponentModel; @@ -10,18 +11,19 @@ namespace BlacksmithWorkshopContracts.ViewModels { public class ImplementerViewModel : IImplementerModel { - public int Id { get; set; } + [Column(visible: false)] + public int Id { get; set; } - [DisplayName("ФИО исполнителя")] + [Column(title: "ФИО исполнителя", width: 150)] public string ImplementerFIO { get; set; } = string.Empty; - [DisplayName("Пароль")] - public string Password { get; set; } = string.Empty; + [Column(title: "Пароль", width: 150)] + public string Password { get; set; } = string.Empty; - [DisplayName("Стаж")] - public int WorkExperience { get; set; } + [Column(title: "Стаж", width: 150)] + public int WorkExperience { get; set; } - [DisplayName("Квалификация")] - public int Qualification { get; set; } + [Column(title: "Квалификация", width: 150)] + public int Qualification { get; set; } } } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ManufactureViewModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ManufactureViewModel.cs index 6dca595..c8ccd7f 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ManufactureViewModel.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ManufactureViewModel.cs @@ -1,4 +1,5 @@ -using BlacksmithWorkshopDataModels.Models; +using BlacksmithWorkshopContracts.Attributes; +using BlacksmithWorkshopDataModels.Models; using System; using System.Collections.Generic; using System.ComponentModel; @@ -11,14 +12,16 @@ namespace BlacksmithWorkshopContracts.ViewModels //класс для отображения пользователю информаци о продуктах (изделиях) public class ManufactureViewModel : IManufactureModel { + [Column(visible: false)] public int Id { get; set; } - [DisplayName("Навание изделия")] + [Column(title: "Навание изделия", width: 150)] public string ManufactureName { get; set; } = string.Empty; - [DisplayName("Цена")] + [Column(title: "Цена", width: 150)] public double Price { get; set; } + [Column(visible: false)] public Dictionary ManufactureWorkPieces { get; set; } = new(); } } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/MessageInfoViewModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/MessageInfoViewModel.cs index 8a9a2a1..e487f07 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/MessageInfoViewModel.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/MessageInfoViewModel.cs @@ -1,4 +1,5 @@ -using BlacksmithWorkshopDataModels.Models; +using BlacksmithWorkshopContracts.Attributes; +using BlacksmithWorkshopDataModels.Models; using System; using System.Collections.Generic; using System.ComponentModel; @@ -10,22 +11,25 @@ namespace BlacksmithWorkshopContracts.ViewModels { public class MessageInfoViewModel : IMessageInfoModel { + [Column(visible: false)] public int Id { get; set; } + [Column(visible: false)] public string MessageId { get; set; } = string.Empty; + [Column(visible: false)] public int? ClientId { get; set; } - [DisplayName("Отправитель")] + [Column(title: "Отправитель", width: 150)] public string SenderName { get; set; } = string.Empty; - [DisplayName("Дата отправки")] + [Column(title: "Дата отправки", width: 150)] public DateTime DateDelivery { get; set; } = DateTime.Now; - [DisplayName("Заголовок")] + [Column(title: "Заголовок", width: 150)] public string Subject { get; set; } = string.Empty; - [DisplayName("Текст")] - public string Body { get; set; } = string.Empty; + [Column(title: "Текст", width: 150)] + public string Body { get; set; } = string.Empty; } } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/OrderViewModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/OrderViewModel.cs index b550429..094f1f0 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/OrderViewModel.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/OrderViewModel.cs @@ -1,4 +1,5 @@ -using BlacksmithWorkshopDataModels.Enums; +using BlacksmithWorkshopContracts.Attributes; +using BlacksmithWorkshopDataModels.Enums; using BlacksmithWorkshopDataModels.Models; using System; using System.Collections.Generic; @@ -12,37 +13,40 @@ namespace BlacksmithWorkshopContracts.ViewModels //класс для отображения пользователю информации о заказах public class OrderViewModel : IOrderModel { - [DisplayName("Номер")] + [Column(visible: false)] public int Id { get; set; } - public int ClientId { get; set; } + [Column(visible: false)] + public int ClientId { get; set; } - public int? ImplementerId { get; set; } + [Column(visible: false)] + public int? ImplementerId { get; set; } - public int ManufactureId { get; set; } + [Column(visible: false)] + public int ManufactureId { get; set; } - [DisplayName("ФИО клиента")] + [Column(title: "ФИО клиента", width: 150)] public string ClientFIO { get; set; } = string.Empty; - [DisplayName("Изделие")] + [Column(title: "Изделие", width: 150)] public string ManufactureName { get; set; } = string.Empty; - [DisplayName("ФИО исполнителя")] + [Column(title: "ФИО исполнителя", width: 150)] public string ImplementerFIO { get; set; } = string.Empty; - [DisplayName("Количество")] + [Column(title: "Количество", width: 150)] public int Count { get; set; } - [DisplayName("Сумма")] + [Column(title: "Сумма", width: 150)] public double Sum { get; set; } - [DisplayName("Статус")] + [Column(title: "Статус", width: 150)] public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; - [DisplayName("Дата создания")] + [Column(title: "Дата создания", width: 150)] public DateTime DateCreate { get; set; } = DateTime.Now; - [DisplayName("Дата выполнения")] + [Column(title: "Дата выполнения", width: 150)] public DateTime? DateImplement { get; set; } } } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/WorkPieceViewModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/WorkPieceViewModel.cs index c04bcdc..690f8ea 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/WorkPieceViewModel.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/WorkPieceViewModel.cs @@ -5,18 +5,20 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using BlacksmithWorkshopContracts.Attributes; namespace BlacksmithWorkshopContracts.ViewModels { //класс для отображения пользователю данных о заготовких (заготовках) public class WorkPieceViewModel : IWorkPieceModel { + [Column(visible: false)] public int Id { get; set; } - [DisplayName("Название заготовки")] + [Column(title: "Название заготовки", width: 150)] public string WorkPieceName { get; set; } = string.Empty; - [DisplayName("Цена")] + [Column(title: "Цена", width: 150)] public double Cost { get; set; } } } -- 2.25.1 From 840586d4221a69a201f8f0c33af0ec31a53ebaca Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Sun, 30 Apr 2023 12:56:03 +0400 Subject: [PATCH 07/11] =?UTF-8?q?=D0=9A=D0=B0=D0=B6=D0=B8=D1=81=D1=8C=20?= =?UTF-8?q?=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB,=20=D1=85=D0=BE=D0=BF=20?= =?UTF-8?q?=D1=85=D0=B5=D0=B9=20=D0=BB=D0=B0=D0=BB=D0=B0=D0=BB=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs | 1 - .../ViewModels/ManufactureViewModel.cs | 2 +- .../Models/ManufactureWorkPiece.cs | 4 ---- .../Models/MessageInfo.cs | 10 +--------- 4 files changed, 2 insertions(+), 15 deletions(-) diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs index 7f3c5c6..07305cd 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs @@ -200,7 +200,6 @@ namespace BlacksmithWorkshop { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } - } } } \ No newline at end of file diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ManufactureViewModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ManufactureViewModel.cs index c8ccd7f..d027131 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ManufactureViewModel.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ManufactureViewModel.cs @@ -15,7 +15,7 @@ namespace BlacksmithWorkshopContracts.ViewModels [Column(visible: false)] public int Id { get; set; } - [Column(title: "Навание изделия", width: 150)] + [Column(title: "Навание изделия", gridViewAutoSize: GridViewAutoSize.Fill, isUseAutoSize: true)] public string ManufactureName { get; set; } = string.Empty; [Column(title: "Цена", width: 150)] diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/ManufactureWorkPiece.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/ManufactureWorkPiece.cs index 8bfea2a..09640c9 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/ManufactureWorkPiece.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/ManufactureWorkPiece.cs @@ -11,19 +11,15 @@ namespace BlacksmithWorkshopDatabaseImplement.Models [DataContract] public class ManufactureWorkPiece { - [DataMember] public int Id { get; set; } [Required] - [DataMember] public int ManufactureId { get; set; } [Required] - [DataMember] public int WorkPieceId { get; set; } [Required] - [DataMember] public int Count { get; set; } public virtual WorkPiece WorkPiece { get; set; } = new(); diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/MessageInfo.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/MessageInfo.cs index 9f67f02..c4c08a5 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/MessageInfo.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/MessageInfo.cs @@ -14,7 +14,7 @@ namespace BlacksmithWorkshopDatabaseImplement.Models [DataContract] public class MessageInfo : IMessageInfoModel { - public int Id { get; set; } + public int Id => throw new NotImplementedException(); [Key] [DataMember] @@ -22,20 +22,12 @@ namespace BlacksmithWorkshopDatabaseImplement.Models public int? ClientId { get; set; } - [Required] - [DataMember] public string SenderName { get; set; } = string.Empty; - [Required] - [DataMember] public DateTime DateDelivery { get; set; } = DateTime.Now; - [Required] - [DataMember] public string Subject { get; set; } = string.Empty; - [Required] - [DataMember] public string Body { get; set; } = string.Empty; public virtual Client? Client { get; set; } -- 2.25.1 From 855b5368bb1f51c23d938bce4fd8a2d78e40f694 Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Mon, 1 May 2023 00:21:27 +0400 Subject: [PATCH 08/11] =?UTF-8?q?=D0=9D=D0=B5=20=D0=BD=D1=83=20=D0=BA?= =?UTF-8?q?=D0=B0=D0=BA-=D0=B1=D1=83=D0=B4=D1=82=D0=BE=20=D0=B1=D1=8B=20?= =?UTF-8?q?=D0=B3=D0=BE=D1=82=D0=BE=D0=B2=D0=B0=D1=8F=20LabWork08=5FHard)(?= =?UTF-8?q?((((?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BlacksmithWorkshop/FormMails.cs | 26 +- .../BlacksmithWorkshop/FormMain.Designer.cs | 583 +++++++++--------- .../BlacksmithWorkshop/FormMain.cs | 379 ++++++------ .../BlacksmithWorkshop/FormShops.cs | 43 +- .../BlacksmithWorkshop/Program.cs | 12 +- .../Attributes/ColumnAttribute.cs | 9 +- .../ViewModels/ManufactureViewModel.cs | 2 +- .../ViewModels/MessageInfoViewModel.cs | 13 +- .../ViewModels/OrderViewModel.cs | 6 +- .../ViewModels/ShopViewModel.cs | 28 +- .../ViewModels/WorkPieceViewModel.cs | 2 +- .../DataBaseImplementationExtension.cs | 4 +- .../Models/MessageInfo.cs | 13 +- .../FileImplementationExtension.cs | 4 +- .../Models/MessageInfo.cs | 3 +- .../ListImplementationExtension.cs | 6 +- Бэкап.zip | Bin 0 -> 2926 bytes 17 files changed, 566 insertions(+), 567 deletions(-) create mode 100644 Бэкап.zip diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormMails.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormMails.cs index 7ce6cbd..65ac456 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/FormMails.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormMails.cs @@ -1,5 +1,6 @@ using BlacksmithWorkshopBusinessLogic.BusinessLogic; using BlacksmithWorkshopContracts.BusinessLogicsContracts; +using BlacksmithWorkshopContracts.DI; using BlacksmithWorkshopContracts.ViewModels; using Microsoft.Extensions.Logging; using System; @@ -45,19 +46,11 @@ namespace BlacksmithWorkshop try { - var list = _messageLogic.ReadList(new() + dataGridView.FillandConfigGrid(_messageLogic.ReadList(new() { Page = currentPage, PageSize = pageSize, - }); - - if (list != null) - { - dataGridView.DataSource = list; - dataGridView.Columns["ClientId"].Visible = false; - dataGridView.Columns["MessageId"].Visible = false; - dataGridView.Columns["Body"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; - } + })); _logger.LogInformation("Загрузка списка писем"); @@ -117,16 +110,13 @@ namespace BlacksmithWorkshop { if (dataGridView.SelectedRows.Count == 1) { - var service = Program.ServiceProvider?.GetService(typeof(FormAnswerMail)); + var form = DependencyManager.Instance.Resolve(); - if (service is FormAnswerMail form) + form.MessageId = dataGridView.SelectedRows[0].Cells["MessageId"].Value.ToString(); + + if (form.ShowDialog() == DialogResult.OK) { - form.MessageId = dataGridView.SelectedRows[0].Cells["MessageId"].Value.ToString(); - - if (form.ShowDialog() == DialogResult.OK) - { - LoadData(); - } + LoadData(); } } } diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.Designer.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.Designer.cs index ff8d08c..be44158 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.Designer.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.Designer.cs @@ -1,295 +1,304 @@ 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() - { - dataGridView = new DataGridView(); - buttonCreateOrder = new Button(); - buttonIssuedOrder = new Button(); - buttonRef = new Button(); - menuStrip = new MenuStrip(); - toolStripMenuItem = new ToolStripMenuItem(); - workPieceToolStripMenuItem = new ToolStripMenuItem(); - manufactureToolStripMenuItem = new ToolStripMenuItem(); - shopToolStripMenuItem = new ToolStripMenuItem(); - addManufactureToolStripMenuItem = new ToolStripMenuItem(); - reportToolStripMenuItem = new ToolStripMenuItem(); - groupedOrdersReportToolStripMenuItem = new ToolStripMenuItem(); - ordersReportToolStripMenuItem = new ToolStripMenuItem(); - workloadStoresReportToolStripMenuItem = new ToolStripMenuItem(); - shopsReportToolStripMenuItem = new ToolStripMenuItem(); - reportManufactureToolStripMenuItem = new ToolStripMenuItem(); - workPieceManufacturesToolStripMenuItem = new ToolStripMenuItem(); - workWithImplementerToolStripMenuItem = new ToolStripMenuItem(); - implementerToolStripMenuItem = new ToolStripMenuItem(); - работаСКлиентамиToolStripMenuItem = new ToolStripMenuItem(); - clientsToolStripMenuItem = new ToolStripMenuItem(); - startWorkToolStripMenuItem = new ToolStripMenuItem(); - buttonSellManufacture = new Button(); - messageToolStripMenuItem = new ToolStripMenuItem(); - ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); - menuStrip.SuspendLayout(); - SuspendLayout(); - // - // dataGridView - // - dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; - dataGridView.Location = new Point(11, 36); - dataGridView.Name = "dataGridView"; - dataGridView.RowHeadersWidth = 51; - dataGridView.RowTemplate.Height = 29; - dataGridView.Size = new Size(937, 448); - dataGridView.TabIndex = 0; - // - // buttonCreateOrder - // - buttonCreateOrder.Location = new Point(1014, 67); - buttonCreateOrder.Name = "buttonCreateOrder"; - buttonCreateOrder.Size = new Size(235, 29); - buttonCreateOrder.TabIndex = 1; - buttonCreateOrder.Text = "Создать заказ"; - buttonCreateOrder.UseVisualStyleBackColor = true; - buttonCreateOrder.Click += ButtonCreateOrder_Click; - // - // buttonIssuedOrder - // - buttonIssuedOrder.Location = new Point(1014, 141); - buttonIssuedOrder.Name = "buttonIssuedOrder"; - buttonIssuedOrder.Size = new Size(235, 29); - buttonIssuedOrder.TabIndex = 4; - buttonIssuedOrder.Text = "Заказ выдан"; - buttonIssuedOrder.UseVisualStyleBackColor = true; - buttonIssuedOrder.Click += ButtonIssuedOrder_Click; - // - // buttonRef - // - buttonRef.Location = new Point(1014, 214); - buttonRef.Name = "buttonRef"; - buttonRef.Size = new Size(235, 29); - buttonRef.TabIndex = 5; - buttonRef.Text = "Обновить"; - buttonRef.UseVisualStyleBackColor = true; - buttonRef.Click += ButtonRef_Click; - // - // menuStrip - // - menuStrip.ImageScalingSize = new Size(20, 20); - menuStrip.Items.AddRange(new ToolStripItem[] { toolStripMenuItem, reportToolStripMenuItem, workWithImplementerToolStripMenuItem, работаСКлиентамиToolStripMenuItem, startWorkToolStripMenuItem }); - menuStrip.Location = new Point(0, 0); - menuStrip.Name = "menuStrip"; - menuStrip.Padding = new Padding(6, 3, 0, 3); - menuStrip.Size = new Size(1297, 30); - menuStrip.TabIndex = 6; - menuStrip.Text = "menuStrip1"; - // - // toolStripMenuItem - // - toolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { workPieceToolStripMenuItem, manufactureToolStripMenuItem, shopToolStripMenuItem, addManufactureToolStripMenuItem }); - toolStripMenuItem.Name = "toolStripMenuItem"; - toolStripMenuItem.Size = new Size(117, 24); - toolStripMenuItem.Text = "Справочники"; - // - // workPieceToolStripMenuItem - // - workPieceToolStripMenuItem.Name = "workPieceToolStripMenuItem"; - workPieceToolStripMenuItem.Size = new Size(251, 26); - workPieceToolStripMenuItem.Text = "Заготовки"; - workPieceToolStripMenuItem.Click += WorkPieceToolStripMenuItem_Click; - // - // manufactureToolStripMenuItem - // - manufactureToolStripMenuItem.Name = "manufactureToolStripMenuItem"; - manufactureToolStripMenuItem.Size = new Size(251, 26); - manufactureToolStripMenuItem.Text = "Изделия"; - manufactureToolStripMenuItem.Click += ManufactureToolStripMenuItem_Click; - // - // shopToolStripMenuItem - // - shopToolStripMenuItem.Name = "shopToolStripMenuItem"; - shopToolStripMenuItem.Size = new Size(251, 26); - shopToolStripMenuItem.Text = "Магазины"; - shopToolStripMenuItem.Click += ShopToolStripMenuItem_Click; - // - // addManufactureToolStripMenuItem - // - addManufactureToolStripMenuItem.Name = "addManufactureToolStripMenuItem"; - addManufactureToolStripMenuItem.Size = new Size(251, 26); - addManufactureToolStripMenuItem.Text = "Пополнение магазина"; - addManufactureToolStripMenuItem.Click += AddManufactureToolStripMenuItem_Click; - // - // reportToolStripMenuItem - // - reportToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { groupedOrdersReportToolStripMenuItem, ordersReportToolStripMenuItem, workloadStoresReportToolStripMenuItem, shopsReportToolStripMenuItem, reportManufactureToolStripMenuItem, workPieceManufacturesToolStripMenuItem }); - reportToolStripMenuItem.Name = "reportToolStripMenuItem"; - reportToolStripMenuItem.Size = new Size(73, 24); - reportToolStripMenuItem.Text = "Отчёты"; - // - // groupedOrdersReportToolStripMenuItem - // - groupedOrdersReportToolStripMenuItem.Name = "groupedOrdersReportToolStripMenuItem"; - groupedOrdersReportToolStripMenuItem.Size = new Size(310, 26); - groupedOrdersReportToolStripMenuItem.Text = "Список заказов за весь период"; - groupedOrdersReportToolStripMenuItem.Click += GroupedOrdersReportToolStripMenuItem_Click; - // - // ordersReportToolStripMenuItem - // - ordersReportToolStripMenuItem.Name = "ordersReportToolStripMenuItem"; - ordersReportToolStripMenuItem.Size = new Size(310, 26); - ordersReportToolStripMenuItem.Text = "Список заказов"; - ordersReportToolStripMenuItem.Click += OrdersReportToolStripMenuItem_Click; - // - // workloadStoresReportToolStripMenuItem - // - workloadStoresReportToolStripMenuItem.Name = "workloadStoresReportToolStripMenuItem"; - workloadStoresReportToolStripMenuItem.Size = new Size(310, 26); - workloadStoresReportToolStripMenuItem.Text = "Загруженность магазинов"; - workloadStoresReportToolStripMenuItem.Click += WorkloadStoresReportToolStripMenuItem_Click; - // - // shopsReportToolStripMenuItem - // - shopsReportToolStripMenuItem.Name = "shopsReportToolStripMenuItem"; - shopsReportToolStripMenuItem.Size = new Size(310, 26); - shopsReportToolStripMenuItem.Text = "Таблица магазинов"; - shopsReportToolStripMenuItem.Click += ShopsReportToolStripMenuItem_Click; - // - // reportManufactureToolStripMenuItem - // - reportManufactureToolStripMenuItem.Name = "reportManufactureToolStripMenuItem"; - reportManufactureToolStripMenuItem.Size = new Size(310, 26); - reportManufactureToolStripMenuItem.Text = "Список изделий"; - reportManufactureToolStripMenuItem.Click += ReportManufactureToolStripMenuItem_Click; - // - // workPieceManufacturesToolStripMenuItem - // - workPieceManufacturesToolStripMenuItem.Name = "workPieceManufacturesToolStripMenuItem"; - workPieceManufacturesToolStripMenuItem.Size = new Size(310, 26); - workPieceManufacturesToolStripMenuItem.Text = "Заготовки по изделиям"; - workPieceManufacturesToolStripMenuItem.Click += WorkPieceManufacturesToolStripMenuItem_Click; - // - // workWithImplementerToolStripMenuItem - // - workWithImplementerToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { implementerToolStripMenuItem }); - workWithImplementerToolStripMenuItem.Name = "workWithImplementerToolStripMenuItem"; - workWithImplementerToolStripMenuItem.Size = new Size(196, 24); - workWithImplementerToolStripMenuItem.Text = "Работа с исполнителями"; - // - // implementerToolStripMenuItem - // - implementerToolStripMenuItem.Name = "implementerToolStripMenuItem"; - implementerToolStripMenuItem.Size = new Size(185, 26); - implementerToolStripMenuItem.Text = "Исполнители"; - implementerToolStripMenuItem.Click += ImplementerToolStripMenuItem_Click_1; - // - // работаСКлиентамиToolStripMenuItem - // - работаСКлиентамиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { clientsToolStripMenuItem, messageToolStripMenuItem }); - работаСКлиентамиToolStripMenuItem.Name = "работаСКлиентамиToolStripMenuItem"; - работаСКлиентамиToolStripMenuItem.Size = new Size(161, 24); - работаСКлиентамиToolStripMenuItem.Text = "Работа с клиентами"; - // - // clientsToolStripMenuItem - // - clientsToolStripMenuItem.Name = "clientsToolStripMenuItem"; - clientsToolStripMenuItem.Size = new Size(224, 26); - clientsToolStripMenuItem.Text = "Клиенты"; - clientsToolStripMenuItem.Click += ClientsToolStripMenuItem_Click_1; - // - // startWorkToolStripMenuItem - // - startWorkToolStripMenuItem.Name = "startWorkToolStripMenuItem"; - startWorkToolStripMenuItem.Size = new Size(114, 24); - startWorkToolStripMenuItem.Text = "Запуск работ"; - startWorkToolStripMenuItem.Click += StartWorkToolStripMenuItem_Click; - // - // buttonSellManufacture - // - buttonSellManufacture.Location = new Point(1014, 285); - buttonSellManufacture.Name = "buttonSellManufacture"; - buttonSellManufacture.Size = new Size(233, 29); - buttonSellManufacture.TabIndex = 7; - buttonSellManufacture.Text = "Продажа изделий"; - buttonSellManufacture.UseVisualStyleBackColor = true; - buttonSellManufacture.Click += ButtonSellManufacture_Click; - // - // messageToolStripMenuItem - // - messageToolStripMenuItem.Name = "messageToolStripMenuItem"; - messageToolStripMenuItem.Size = new Size(224, 26); - messageToolStripMenuItem.Text = "Письма"; - messageToolStripMenuItem.Click += MessageToolStripMenuItem_Click; - // - // FormMain - // - AutoScaleDimensions = new SizeF(8F, 20F); - AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(1297, 496); - Controls.Add(buttonSellManufacture); - Controls.Add(buttonRef); - Controls.Add(buttonIssuedOrder); - Controls.Add(buttonCreateOrder); - Controls.Add(dataGridView); - Controls.Add(menuStrip); - MainMenuStrip = menuStrip; - Name = "FormMain"; - Text = "Кузнечная мастерская"; - Load += FormMain_Load; - ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); - menuStrip.ResumeLayout(false); - menuStrip.PerformLayout(); - ResumeLayout(false); - PerformLayout(); - } + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + dataGridView = new DataGridView(); + buttonCreateOrder = new Button(); + buttonIssuedOrder = new Button(); + buttonRef = new Button(); + menuStrip = new MenuStrip(); + toolStripMenuItem = new ToolStripMenuItem(); + workPieceToolStripMenuItem = new ToolStripMenuItem(); + manufactureToolStripMenuItem = new ToolStripMenuItem(); + shopToolStripMenuItem = new ToolStripMenuItem(); + addManufactureToolStripMenuItem = new ToolStripMenuItem(); + reportToolStripMenuItem = new ToolStripMenuItem(); + groupedOrdersReportToolStripMenuItem = new ToolStripMenuItem(); + ordersReportToolStripMenuItem = new ToolStripMenuItem(); + workloadStoresReportToolStripMenuItem = new ToolStripMenuItem(); + shopsReportToolStripMenuItem = new ToolStripMenuItem(); + reportManufactureToolStripMenuItem = new ToolStripMenuItem(); + workPieceManufacturesToolStripMenuItem = new ToolStripMenuItem(); + workWithImplementerToolStripMenuItem = new ToolStripMenuItem(); + implementerToolStripMenuItem = new ToolStripMenuItem(); + работаСКлиентамиToolStripMenuItem = new ToolStripMenuItem(); + clientsToolStripMenuItem = new ToolStripMenuItem(); + messageToolStripMenuItem = new ToolStripMenuItem(); + startWorkToolStripMenuItem = new ToolStripMenuItem(); + buttonSellManufacture = new Button(); + createBackUpToolStripMenuItem = new ToolStripMenuItem(); + ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); + menuStrip.SuspendLayout(); + SuspendLayout(); + // + // dataGridView + // + dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridView.Location = new Point(11, 36); + dataGridView.Name = "dataGridView"; + dataGridView.RowHeadersWidth = 51; + dataGridView.RowTemplate.Height = 29; + dataGridView.Size = new Size(937, 448); + dataGridView.TabIndex = 0; + // + // buttonCreateOrder + // + buttonCreateOrder.Location = new Point(1014, 67); + buttonCreateOrder.Name = "buttonCreateOrder"; + buttonCreateOrder.Size = new Size(235, 29); + buttonCreateOrder.TabIndex = 1; + buttonCreateOrder.Text = "Создать заказ"; + buttonCreateOrder.UseVisualStyleBackColor = true; + buttonCreateOrder.Click += ButtonCreateOrder_Click; + // + // buttonIssuedOrder + // + buttonIssuedOrder.Location = new Point(1014, 141); + buttonIssuedOrder.Name = "buttonIssuedOrder"; + buttonIssuedOrder.Size = new Size(235, 29); + buttonIssuedOrder.TabIndex = 4; + buttonIssuedOrder.Text = "Заказ выдан"; + buttonIssuedOrder.UseVisualStyleBackColor = true; + buttonIssuedOrder.Click += ButtonIssuedOrder_Click; + // + // buttonRef + // + buttonRef.Location = new Point(1014, 214); + buttonRef.Name = "buttonRef"; + buttonRef.Size = new Size(235, 29); + buttonRef.TabIndex = 5; + buttonRef.Text = "Обновить"; + buttonRef.UseVisualStyleBackColor = true; + buttonRef.Click += ButtonRef_Click; + // + // menuStrip + // + menuStrip.ImageScalingSize = new Size(20, 20); + menuStrip.Items.AddRange(new ToolStripItem[] { toolStripMenuItem, reportToolStripMenuItem, workWithImplementerToolStripMenuItem, работаСКлиентамиToolStripMenuItem, startWorkToolStripMenuItem, createBackUpToolStripMenuItem }); + menuStrip.Location = new Point(0, 0); + menuStrip.Name = "menuStrip"; + menuStrip.Padding = new Padding(6, 3, 0, 3); + menuStrip.Size = new Size(1297, 30); + menuStrip.TabIndex = 6; + menuStrip.Text = "menuStrip1"; + // + // toolStripMenuItem + // + toolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { workPieceToolStripMenuItem, manufactureToolStripMenuItem, shopToolStripMenuItem, addManufactureToolStripMenuItem }); + toolStripMenuItem.Name = "toolStripMenuItem"; + toolStripMenuItem.Size = new Size(117, 24); + toolStripMenuItem.Text = "Справочники"; + // + // workPieceToolStripMenuItem + // + workPieceToolStripMenuItem.Name = "workPieceToolStripMenuItem"; + workPieceToolStripMenuItem.Size = new Size(251, 26); + workPieceToolStripMenuItem.Text = "Заготовки"; + workPieceToolStripMenuItem.Click += WorkPieceToolStripMenuItem_Click; + // + // manufactureToolStripMenuItem + // + manufactureToolStripMenuItem.Name = "manufactureToolStripMenuItem"; + manufactureToolStripMenuItem.Size = new Size(251, 26); + manufactureToolStripMenuItem.Text = "Изделия"; + manufactureToolStripMenuItem.Click += ManufactureToolStripMenuItem_Click; + // + // shopToolStripMenuItem + // + shopToolStripMenuItem.Name = "shopToolStripMenuItem"; + shopToolStripMenuItem.Size = new Size(251, 26); + shopToolStripMenuItem.Text = "Магазины"; + shopToolStripMenuItem.Click += ShopToolStripMenuItem_Click; + // + // addManufactureToolStripMenuItem + // + addManufactureToolStripMenuItem.Name = "addManufactureToolStripMenuItem"; + addManufactureToolStripMenuItem.Size = new Size(251, 26); + addManufactureToolStripMenuItem.Text = "Пополнение магазина"; + addManufactureToolStripMenuItem.Click += AddManufactureToolStripMenuItem_Click; + // + // reportToolStripMenuItem + // + reportToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { groupedOrdersReportToolStripMenuItem, ordersReportToolStripMenuItem, workloadStoresReportToolStripMenuItem, shopsReportToolStripMenuItem, reportManufactureToolStripMenuItem, workPieceManufacturesToolStripMenuItem }); + reportToolStripMenuItem.Name = "reportToolStripMenuItem"; + reportToolStripMenuItem.Size = new Size(73, 24); + reportToolStripMenuItem.Text = "Отчёты"; + // + // groupedOrdersReportToolStripMenuItem + // + groupedOrdersReportToolStripMenuItem.Name = "groupedOrdersReportToolStripMenuItem"; + groupedOrdersReportToolStripMenuItem.Size = new Size(310, 26); + groupedOrdersReportToolStripMenuItem.Text = "Список заказов за весь период"; + groupedOrdersReportToolStripMenuItem.Click += GroupedOrdersReportToolStripMenuItem_Click; + // + // ordersReportToolStripMenuItem + // + ordersReportToolStripMenuItem.Name = "ordersReportToolStripMenuItem"; + ordersReportToolStripMenuItem.Size = new Size(310, 26); + ordersReportToolStripMenuItem.Text = "Список заказов"; + ordersReportToolStripMenuItem.Click += OrdersReportToolStripMenuItem_Click; + // + // workloadStoresReportToolStripMenuItem + // + workloadStoresReportToolStripMenuItem.Name = "workloadStoresReportToolStripMenuItem"; + workloadStoresReportToolStripMenuItem.Size = new Size(310, 26); + workloadStoresReportToolStripMenuItem.Text = "Загруженность магазинов"; + workloadStoresReportToolStripMenuItem.Click += WorkloadStoresReportToolStripMenuItem_Click; + // + // shopsReportToolStripMenuItem + // + shopsReportToolStripMenuItem.Name = "shopsReportToolStripMenuItem"; + shopsReportToolStripMenuItem.Size = new Size(310, 26); + shopsReportToolStripMenuItem.Text = "Таблица магазинов"; + shopsReportToolStripMenuItem.Click += ShopsReportToolStripMenuItem_Click; + // + // reportManufactureToolStripMenuItem + // + reportManufactureToolStripMenuItem.Name = "reportManufactureToolStripMenuItem"; + reportManufactureToolStripMenuItem.Size = new Size(310, 26); + reportManufactureToolStripMenuItem.Text = "Список изделий"; + reportManufactureToolStripMenuItem.Click += ReportManufactureToolStripMenuItem_Click; + // + // workPieceManufacturesToolStripMenuItem + // + workPieceManufacturesToolStripMenuItem.Name = "workPieceManufacturesToolStripMenuItem"; + workPieceManufacturesToolStripMenuItem.Size = new Size(310, 26); + workPieceManufacturesToolStripMenuItem.Text = "Заготовки по изделиям"; + workPieceManufacturesToolStripMenuItem.Click += WorkPieceManufacturesToolStripMenuItem_Click; + // + // workWithImplementerToolStripMenuItem + // + workWithImplementerToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { implementerToolStripMenuItem }); + workWithImplementerToolStripMenuItem.Name = "workWithImplementerToolStripMenuItem"; + workWithImplementerToolStripMenuItem.Size = new Size(196, 24); + workWithImplementerToolStripMenuItem.Text = "Работа с исполнителями"; + // + // implementerToolStripMenuItem + // + implementerToolStripMenuItem.Name = "implementerToolStripMenuItem"; + implementerToolStripMenuItem.Size = new Size(185, 26); + implementerToolStripMenuItem.Text = "Исполнители"; + implementerToolStripMenuItem.Click += ImplementerToolStripMenuItem_Click_1; + // + // работаСКлиентамиToolStripMenuItem + // + работаСКлиентамиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { clientsToolStripMenuItem, messageToolStripMenuItem }); + работаСКлиентамиToolStripMenuItem.Name = "работаСКлиентамиToolStripMenuItem"; + работаСКлиентамиToolStripMenuItem.Size = new Size(161, 24); + работаСКлиентамиToolStripMenuItem.Text = "Работа с клиентами"; + // + // clientsToolStripMenuItem + // + clientsToolStripMenuItem.Name = "clientsToolStripMenuItem"; + clientsToolStripMenuItem.Size = new Size(152, 26); + clientsToolStripMenuItem.Text = "Клиенты"; + clientsToolStripMenuItem.Click += ClientsToolStripMenuItem_Click_1; + // + // messageToolStripMenuItem + // + messageToolStripMenuItem.Name = "messageToolStripMenuItem"; + messageToolStripMenuItem.Size = new Size(152, 26); + messageToolStripMenuItem.Text = "Письма"; + messageToolStripMenuItem.Click += MessageToolStripMenuItem_Click; + // + // startWorkToolStripMenuItem + // + startWorkToolStripMenuItem.Name = "startWorkToolStripMenuItem"; + startWorkToolStripMenuItem.Size = new Size(114, 24); + startWorkToolStripMenuItem.Text = "Запуск работ"; + startWorkToolStripMenuItem.Click += StartWorkToolStripMenuItem_Click; + // + // buttonSellManufacture + // + buttonSellManufacture.Location = new Point(1014, 285); + buttonSellManufacture.Name = "buttonSellManufacture"; + buttonSellManufacture.Size = new Size(233, 29); + buttonSellManufacture.TabIndex = 7; + buttonSellManufacture.Text = "Продажа изделий"; + buttonSellManufacture.UseVisualStyleBackColor = true; + buttonSellManufacture.Click += ButtonSellManufacture_Click; + // + // createBackUpToolStripMenuItem + // + createBackUpToolStripMenuItem.Name = "createBackUpToolStripMenuItem"; + createBackUpToolStripMenuItem.Size = new Size(122, 24); + createBackUpToolStripMenuItem.Text = "Создать бэкап"; + createBackUpToolStripMenuItem.Click += CreateBackUpToolStripMenuItem_Click_1; + // + // FormMain + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(1297, 496); + Controls.Add(buttonSellManufacture); + Controls.Add(buttonRef); + Controls.Add(buttonIssuedOrder); + Controls.Add(buttonCreateOrder); + Controls.Add(dataGridView); + Controls.Add(menuStrip); + MainMenuStrip = menuStrip; + Name = "FormMain"; + Text = "Кузнечная мастерская"; + Load += FormMain_Load; + ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); + menuStrip.ResumeLayout(false); + menuStrip.PerformLayout(); + ResumeLayout(false); + PerformLayout(); + } - #endregion + #endregion - private DataGridView dataGridView; - private Button buttonCreateOrder; - private Button buttonIssuedOrder; - private Button buttonRef; - private MenuStrip menuStrip; - private ToolStripMenuItem toolStripMenuItem; - private ToolStripMenuItem workPieceToolStripMenuItem; - private ToolStripMenuItem manufactureToolStripMenuItem; - private ToolStripMenuItem shopToolStripMenuItem; - private ToolStripMenuItem addManufactureToolStripMenuItem; - private Button buttonSellManufacture; - private ToolStripMenuItem reportToolStripMenuItem; - private ToolStripMenuItem groupedOrdersReportToolStripMenuItem; - private ToolStripMenuItem ordersReportToolStripMenuItem; - private ToolStripMenuItem workloadStoresReportToolStripMenuItem; - private ToolStripMenuItem shopsReportToolStripMenuItem; - private ToolStripMenuItem reportManufactureToolStripMenuItem; - private ToolStripMenuItem workPieceManufacturesToolStripMenuItem; - private ToolStripMenuItem workWithImplementerToolStripMenuItem; - private ToolStripMenuItem implementerToolStripMenuItem; - private ToolStripMenuItem работаСКлиентамиToolStripMenuItem; - private ToolStripMenuItem clientsToolStripMenuItem; - private ToolStripMenuItem startWorkToolStripMenuItem; - private ToolStripMenuItem messageToolStripMenuItem; - } + private DataGridView dataGridView; + private Button buttonCreateOrder; + private Button buttonIssuedOrder; + private Button buttonRef; + private MenuStrip menuStrip; + private ToolStripMenuItem toolStripMenuItem; + private ToolStripMenuItem workPieceToolStripMenuItem; + private ToolStripMenuItem manufactureToolStripMenuItem; + private ToolStripMenuItem shopToolStripMenuItem; + private ToolStripMenuItem addManufactureToolStripMenuItem; + private Button buttonSellManufacture; + private ToolStripMenuItem reportToolStripMenuItem; + private ToolStripMenuItem groupedOrdersReportToolStripMenuItem; + private ToolStripMenuItem ordersReportToolStripMenuItem; + private ToolStripMenuItem workloadStoresReportToolStripMenuItem; + private ToolStripMenuItem shopsReportToolStripMenuItem; + private ToolStripMenuItem reportManufactureToolStripMenuItem; + private ToolStripMenuItem workPieceManufacturesToolStripMenuItem; + private ToolStripMenuItem workWithImplementerToolStripMenuItem; + private ToolStripMenuItem implementerToolStripMenuItem; + private ToolStripMenuItem работаСКлиентамиToolStripMenuItem; + private ToolStripMenuItem clientsToolStripMenuItem; + private ToolStripMenuItem startWorkToolStripMenuItem; + private ToolStripMenuItem messageToolStripMenuItem; + private ToolStripMenuItem createBackUpToolStripMenuItem; + } } \ No newline at end of file diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs index 89a5119..36d8270 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs @@ -16,252 +16,239 @@ 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; - private readonly IReportLogic _reportLogic; + private readonly IReportLogic _reportLogic; - private readonly IWorkProcess _workProcess; + private readonly IWorkProcess _workProcess; - private readonly IBackUpLogic _backUpLogic; + private readonly IBackUpLogic _backUpLogic; - public FormMain(ILogger logger, IOrderLogic orderLogic, IReportLogic reportLogic, IWorkProcess workProcess, IBackUpLogic backUpLogic) - { - InitializeComponent(); + public FormMain(ILogger logger, IOrderLogic orderLogic, IReportLogic reportLogic, IWorkProcess workProcess, IBackUpLogic backUpLogic) + { + InitializeComponent(); - _logger = logger; - _orderLogic = orderLogic; - _reportLogic = reportLogic; - _workProcess = workProcess; - _backUpLogic = backUpLogic; - } + _logger = logger; + _orderLogic = orderLogic; + _reportLogic = reportLogic; + _workProcess = workProcess; + _backUpLogic = backUpLogic; + } - 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 - { - dataGridView.FillandConfigGrid(_orderLogic.ReadList(null)); + try + { + dataGridView.FillandConfigGrid(_orderLogic.ReadList(null)); - _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 form = DependencyManager.Instance.Resolve(); + private void WorkPieceToolStripMenuItem_Click(object sender, EventArgs e) + { + var form = DependencyManager.Instance.Resolve(); - form.ShowDialog(); - } + form.ShowDialog(); + } - private void ManufactureToolStripMenuItem_Click(object sender, EventArgs e) - { - var form = DependencyManager.Instance.Resolve(); + private void ManufactureToolStripMenuItem_Click(object sender, EventArgs e) + { + var form = DependencyManager.Instance.Resolve(); - form.ShowDialog(); - } + form.ShowDialog(); + } - private void ButtonCreateOrder_Click(object sender, EventArgs e) - { - var form = DependencyManager.Instance.Resolve(); + private void ButtonCreateOrder_Click(object sender, EventArgs e) + { + var form = DependencyManager.Instance.Resolve(); - form.ShowDialog(); - LoadData(); - } + form.ShowDialog(); + LoadData(); + } - 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 ButtonSellManufacture_Click(object sender, EventArgs e) - { - var service = Program.ServiceProvider?.GetService(typeof(FormSellManufacture)); - if (service is FormSellManufacture form) - { - form.ShowDialog(); - LoadData(); - } - } + private void ButtonSellManufacture_Click(object sender, EventArgs e) + { + var form = DependencyManager.Instance.Resolve(); - private void ShopToolStripMenuItem_Click(object sender, EventArgs e) - { - var service = Program.ServiceProvider?.GetService(typeof(FormShops)); + form.ShowDialog(); + LoadData(); - if (service is FormShops form) - { - form.ShowDialog(); - } - } + } - private void AddManufactureToolStripMenuItem_Click(object sender, EventArgs e) - { - var service = Program.ServiceProvider?.GetService(typeof(FormAddManufacture)); + private void ShopToolStripMenuItem_Click(object sender, EventArgs e) + { + var form = DependencyManager.Instance.Resolve(); - if (service is FormAddManufacture form) - { - form.ShowDialog(); - LoadData(); - } - } + form.ShowDialog(); + } - private void GroupedOrdersReportToolStripMenuItem_Click(object sender, EventArgs e) - { - var service = Program.ServiceProvider?.GetService(typeof(FormReportGroupedOrders)); + private void AddManufactureToolStripMenuItem_Click(object sender, EventArgs e) + { + var form = DependencyManager.Instance.Resolve(); - if (service is FormReportGroupedOrders form) - { - form.ShowDialog(); - } - } + form.ShowDialog(); + LoadData(); + } - private void WorkloadStoresReportToolStripMenuItem_Click(object sender, EventArgs e) - { - var service = Program.ServiceProvider?.GetService(typeof(FormReportShopManufactures)); + private void GroupedOrdersReportToolStripMenuItem_Click(object sender, EventArgs e) + { + var form = DependencyManager.Instance.Resolve(); - if (service is FormReportShopManufactures form) - { - form.ShowDialog(); - } - } + form.ShowDialog(); + } - private void ShopsReportToolStripMenuItem_Click(object sender, EventArgs e) - { - using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; + private void WorkloadStoresReportToolStripMenuItem_Click(object sender, EventArgs e) + { + var form = DependencyManager.Instance.Resolve(); - if (dialog.ShowDialog() == DialogResult.OK) - { - _reportLogic.SaveShopsToWordFile(new ReportBindingModel { FileName = dialog.FileName }); - MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } + form.ShowDialog(); + } - private void WorkPieceManufacturesToolStripMenuItem_Click(object sender, EventArgs e) - { - var form = DependencyManager.Instance.Resolve(); + private void ShopsReportToolStripMenuItem_Click(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; - form.ShowDialog(); + if (dialog.ShowDialog() == DialogResult.OK) + { + _reportLogic.SaveShopsToWordFile(new ReportBindingModel { FileName = dialog.FileName }); + MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } - } + private void WorkPieceManufacturesToolStripMenuItem_Click(object sender, EventArgs e) + { + var form = DependencyManager.Instance.Resolve(); - private void ImplementerToolStripMenuItem_Click_1(object sender, EventArgs e) - { - var form = DependencyManager.Instance.Resolve(); + form.ShowDialog(); - form.ShowDialog(); - } + } - private void ClientsToolStripMenuItem_Click_1(object sender, EventArgs e) - { - var form = DependencyManager.Instance.Resolve(); + private void ImplementerToolStripMenuItem_Click_1(object sender, EventArgs e) + { + var form = DependencyManager.Instance.Resolve(); - form.ShowDialog(); - } + form.ShowDialog(); + } - private void StartWorkToolStripMenuItem_Click(object sender, EventArgs e) - { - _workProcess.DoWork(DependencyManager.Instance.Resolve()!, _orderLogic); + private void ClientsToolStripMenuItem_Click_1(object sender, EventArgs e) + { + var form = DependencyManager.Instance.Resolve(); - MessageBox.Show("Процесс обработки запущен", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information); - } + form.ShowDialog(); + } - private void ReportManufactureToolStripMenuItem_Click(object sender, EventArgs e) - { - using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; + private void StartWorkToolStripMenuItem_Click(object sender, EventArgs e) + { + _workProcess.DoWork(DependencyManager.Instance.Resolve()!, _orderLogic); - if (dialog.ShowDialog() == DialogResult.OK) - { - _reportLogic.SaveManufacturesToWordFile(new ReportBindingModel - { - FileName = dialog.FileName - }); + MessageBox.Show("Процесс обработки запущен", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information); + } - MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } + private void ReportManufactureToolStripMenuItem_Click(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; - private void OrdersReportToolStripMenuItem_Click(object sender, EventArgs e) - { - var form = DependencyManager.Instance.Resolve(); + if (dialog.ShowDialog() == DialogResult.OK) + { + _reportLogic.SaveManufacturesToWordFile(new ReportBindingModel + { + FileName = dialog.FileName + }); - form.ShowDialog(); - } + MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } - private void MailsToolStripMenuItem_Click(object sender, EventArgs e) - { - var form = DependencyManager.Instance.Resolve(); + private void OrdersReportToolStripMenuItem_Click(object sender, EventArgs e) + { + var form = DependencyManager.Instance.Resolve(); - form.ShowDialog(); - } + form.ShowDialog(); + } - private void CreateBackUpToolStripMenuItem_Click(object sender, EventArgs e) - { - try - { - if (_backUpLogic != null) - { - var fbd = new FolderBrowserDialog(); + private void MessageToolStripMenuItem_Click(object sender, EventArgs e) + { + var form = DependencyManager.Instance.Resolve(); - if (fbd.ShowDialog() == DialogResult.OK) - { - _backUpLogic.CreateBackUp(new BackUpSaveBinidngModel - { - FolderName = fbd.SelectedPath - }); + form.ShowDialog(); + } - MessageBox.Show("Бекап создан", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - } - } - catch (Exception ex) - { - MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - } + private void CreateBackUpToolStripMenuItem_Click_1(object sender, EventArgs e) + { + try + { + if (_backUpLogic != null) + { + var fbd = new FolderBrowserDialog(); + + if (fbd.ShowDialog() == DialogResult.OK) + { + _backUpLogic.CreateBackUp(new BackUpSaveBinidngModel + { + FolderName = fbd.SelectedPath + }); + + MessageBox.Show("Бекап создан", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } } \ No newline at end of file diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormShops.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormShops.cs index 9c33261..74aef2b 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/FormShops.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormShops.cs @@ -1,5 +1,7 @@ -using BlacksmithWorkshopContracts.BindingModels; +using BlacksmithWorkshopBusinessLogic.BusinessLogic; +using BlacksmithWorkshopContracts.BindingModels; using BlacksmithWorkshopContracts.BusinessLogicsContracts; +using BlacksmithWorkshopContracts.DI; using BlacksmithWorkshopContracts.SearchModels; using BlacksmithWorkshopDataModels.Models; using Microsoft.Extensions.Logging; @@ -18,6 +20,7 @@ namespace BlacksmithWorkshop public partial class FormShops : Form { private readonly ILogger _logger; + private readonly IShopLogic _logic; public FormShops(ILogger logger, IShopLogic logic) @@ -33,20 +36,12 @@ namespace BlacksmithWorkshop } private void LoadData() - { - try + { + try { - var list = _logic.ReadList(null); + dataGridView.FillandConfigGrid(_logic.ReadList(null)); - if (list != null) - { - dataGridView.DataSource = list; - dataGridView.Columns["Id"].Visible = false; - dataGridView.Columns["ShopManufactures"].Visible = false; - dataGridView.Columns["ShopName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; - } - - _logger.LogInformation("Загрузка магазинов"); + _logger.LogInformation("Загрузка магазинов"); } catch (Exception ex) { @@ -57,13 +52,11 @@ namespace BlacksmithWorkshop private void ButtonAdd_Click(object sender, EventArgs e) { - var service = Program.ServiceProvider?.GetService(typeof(FormShop)); - if (service is FormShop form) + var form = DependencyManager.Instance.Resolve(); + + if (form.ShowDialog() == DialogResult.OK) { - if (form.ShowDialog() == DialogResult.OK) - { - LoadData(); - } + LoadData(); } } @@ -71,14 +64,12 @@ namespace BlacksmithWorkshop { if (dataGridView.SelectedRows.Count == 1) { - var service = Program.ServiceProvider?.GetService(typeof(FormShop)); - if (service is FormShop form) + var form = DependencyManager.Instance.Resolve(); + + form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); + if (form.ShowDialog() == DialogResult.OK) { - form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); - if (form.ShowDialog() == DialogResult.OK) - { - LoadData(); - } + LoadData(); } } } diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/Program.cs b/BlacksmithWorkshop/BlacksmithWorkshop/Program.cs index 57c8290..8b23862 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/Program.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/Program.cs @@ -69,7 +69,8 @@ namespace BlacksmithWorkshop DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); @@ -93,7 +94,14 @@ namespace BlacksmithWorkshop DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); - } + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + } private static void MailCheck(object obj) => DependencyManager.Instance.Resolve()?.MailCheck(); } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/Attributes/ColumnAttribute.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/Attributes/ColumnAttribute.cs index aec5b3a..5fd65f0 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/Attributes/ColumnAttribute.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/Attributes/ColumnAttribute.cs @@ -11,14 +11,15 @@ namespace BlacksmithWorkshopContracts.Attributes public class ColumnAttribute : Attribute { public ColumnAttribute(string title = "", bool visible = true, int width = 0, - GridViewAutoSize gridViewAutoSize = GridViewAutoSize.None, bool isUseAutoSize = false) + GridViewAutoSize gridViewAutoSize = GridViewAutoSize.None, bool isUseAutoSize = false, string format = "") { Title = title; Visible = visible; Width = width; GridViewAutoSize = gridViewAutoSize; IsUseAutoSize = isUseAutoSize; - } + Format = format; + } public string Title { get; private set; } @@ -29,5 +30,7 @@ namespace BlacksmithWorkshopContracts.Attributes public GridViewAutoSize GridViewAutoSize { get; private set; } public bool IsUseAutoSize { get; private set; } - } + + public string Format { get; private set; } + } } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ManufactureViewModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ManufactureViewModel.cs index d027131..705c066 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ManufactureViewModel.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ManufactureViewModel.cs @@ -18,7 +18,7 @@ namespace BlacksmithWorkshopContracts.ViewModels [Column(title: "Навание изделия", gridViewAutoSize: GridViewAutoSize.Fill, isUseAutoSize: true)] public string ManufactureName { get; set; } = string.Empty; - [Column(title: "Цена", width: 150)] + [Column(title: "Цена", width: 150, format: "0.00")] public double Price { get; set; } [Column(visible: false)] diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/MessageInfoViewModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/MessageInfoViewModel.cs index cbf7aef..ab5f80b 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/MessageInfoViewModel.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/MessageInfoViewModel.cs @@ -23,7 +23,7 @@ namespace BlacksmithWorkshopContracts.ViewModels [Column(title: "Отправитель", width: 150)] public string SenderName { get; set; } = string.Empty; - [Column(title: "Дата отправки", width: 150)] + [Column(title: "Дата отправки", width: 150, format: "D")] public DateTime DateDelivery { get; set; } = DateTime.Now; [Column(title: "Заголовок", width: 150)] @@ -31,14 +31,11 @@ namespace BlacksmithWorkshopContracts.ViewModels [Column(title: "Текст", width: 150)] public string Body { get; set; } = string.Empty; - } - [DisplayName("Текст")] - public string Body { get; set; } = string.Empty; - [DisplayName("Прочитано")] - public bool IsRead { get; set; } = false; + [Column(title: "Прочитано", width: 150)] + public bool IsRead { get; set; } = false; - [DisplayName("Ответ")] - public string? Answer { get; set; } + [Column(title: "Ответ", width: 150)] + public string Answer { get; set; } } } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/OrderViewModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/OrderViewModel.cs index 094f1f0..1183a9d 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/OrderViewModel.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/OrderViewModel.cs @@ -37,16 +37,16 @@ namespace BlacksmithWorkshopContracts.ViewModels [Column(title: "Количество", width: 150)] public int Count { get; set; } - [Column(title: "Сумма", width: 150)] + [Column(title: "Сумма", width: 150, format: "0.00")] public double Sum { get; set; } [Column(title: "Статус", width: 150)] public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; - [Column(title: "Дата создания", width: 150)] + [Column(title: "Дата создания", width: 150, format: "D")] public DateTime DateCreate { get; set; } = DateTime.Now; - [Column(title: "Дата выполнения", width: 150)] + [Column(title: "Дата выполнения", width: 150, format: "f")] public DateTime? DateImplement { get; set; } } } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ShopViewModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ShopViewModel.cs index 7118e49..9aa9f18 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ShopViewModel.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ShopViewModel.cs @@ -1,4 +1,5 @@ -using BlacksmithWorkshopDataModels.Models; +using BlacksmithWorkshopContracts.Attributes; +using BlacksmithWorkshopDataModels.Models; using System; using System.Collections.Generic; using System.ComponentModel; @@ -10,22 +11,25 @@ namespace BlacksmithWorkshopContracts.ViewModels { public class ShopViewModel { - public int Id { get; set; } + [Column(visible: false)] + public int Id { get; set; } - [DisplayName("Название магазина")] - public string ShopName { get; set; } = string.Empty; + [Column(title: "Название магазина", gridViewAutoSize: GridViewAutoSize.AllCells, isUseAutoSize: true)] + public string ShopName { get; set; } = string.Empty; - [DisplayName("Адрес магазина")] - public string Address { get; set; } = string.Empty; + [Column(title: "Адрес магазина", gridViewAutoSize: GridViewAutoSize.Fill, isUseAutoSize: true)] + public string Address { get; set; } = string.Empty; - [DisplayName("Дата открытия")] - public DateTime DateOpen { get; set; } = DateTime.Now; + [Column(title: "Время открытия", gridViewAutoSize: GridViewAutoSize.AllCells, isUseAutoSize: true, format: "f")] + public DateTime DateOpen { get; set; } = DateTime.Now; - public Dictionary ShopManufactures { get; set; } = new(); + [Column(visible: false)] + public Dictionary ShopManufactures { get; set; } = new(); - [DisplayName("Вместимость магазина")] - public int MaxCountManufactures { get; set; } + [Column(title:"Вместимость магазина", gridViewAutoSize: GridViewAutoSize.DisplayedCells, isUseAutoSize: true)] + public int MaxCountManufactures { get; set; } - public List> ShopManufactureList { get; set; } = new(); + [Column(visible: false)] + public List> ShopManufactureList { get; set; } = new(); } } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/WorkPieceViewModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/WorkPieceViewModel.cs index 690f8ea..6b08138 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/WorkPieceViewModel.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/WorkPieceViewModel.cs @@ -15,7 +15,7 @@ namespace BlacksmithWorkshopContracts.ViewModels [Column(visible: false)] public int Id { get; set; } - [Column(title: "Название заготовки", width: 150)] + [Column(title: "Название заготовки", width: 150, format: "0.00")] public string WorkPieceName { get; set; } = string.Empty; [Column(title: "Цена", width: 150)] diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/DataBaseImplementationExtension.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/DataBaseImplementationExtension.cs index 8967c2f..bd68eab 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/DataBaseImplementationExtension.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/DataBaseImplementationExtension.cs @@ -27,7 +27,9 @@ namespace BlacksmithWorkshopDatabaseImplement DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); } } } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/MessageInfo.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/MessageInfo.cs index a5c72de..9d729ba 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/MessageInfo.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/MessageInfo.cs @@ -20,20 +20,25 @@ namespace BlacksmithWorkshopDatabaseImplement.Models [DataMember] public string MessageId { get; set; } = string.Empty; + [DataMember] public int? ClientId { get; set; } public bool IsRead { get; private set; } = false; [Required] + [DataMember] public string SenderName { get; set; } = string.Empty; - public DateTime DateDelivery { get; set; } = DateTime.Now; + [DataMember] + public DateTime DateDelivery { get; set; } = DateTime.Now; - public string Subject { get; set; } = string.Empty; + [DataMember] + public string Subject { get; set; } = string.Empty; - public string Body { get; set; } = string.Empty; + [DataMember] + public string Body { get; set; } = string.Empty; - public string? Answer { get; private set; } = string.Empty; + public string? Answer { get; private set; } = string.Empty; public virtual Client? Client { get; set; } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/FileImplementationExtension.cs b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/FileImplementationExtension.cs index 28d2b45..6d7ec31 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/FileImplementationExtension.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/FileImplementationExtension.cs @@ -28,7 +28,9 @@ namespace BlacksmithWorkshopFileImplement DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); } } } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/MessageInfo.cs b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/MessageInfo.cs index 1d93c71..a3fd1a5 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/MessageInfo.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/MessageInfo.cs @@ -26,9 +26,8 @@ namespace BlacksmithWorkshopFileImplement.Models [DataMember] public string SenderName { get; private set; } = string.Empty; - public bool IsRead { get; private set; } = false; - public string SenderName { get; private set; } = string.Empty; + public bool IsRead { get; private set; } = false; [DataMember] public DateTime DateDelivery { get; private set; } = DateTime.Now; diff --git a/BlacksmithWorkshop/BlacksmithWorkshopListImplement/ListImplementationExtension.cs b/BlacksmithWorkshop/BlacksmithWorkshopListImplement/ListImplementationExtension.cs index 2f024fd..993fb9b 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopListImplement/ListImplementationExtension.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopListImplement/ListImplementationExtension.cs @@ -26,8 +26,10 @@ namespace BlacksmithWorkshopListImplement DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); - - DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); } } diff --git a/Бэкап.zip b/Бэкап.zip new file mode 100644 index 0000000000000000000000000000000000000000..83ae114a00d827fe47c6c6142f9b867be741f317 GIT binary patch literal 2926 zcmZ`*c{r47AD*!_*+Oat$C3!gGBQO<%gHjvm>O!3P&4*r7-K(aP{xrhl=Bq%Vs+JQXKZQHLK{CU~2#=gODg*`8E#K72%FCL#S zA3NR;{o)z`+HVZbJrAF4<_l+nD}5b@?8yC?zCN%Y8Z!tVLicy;oxUiov)=0zm2-5HdiZh@=2d zB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urr8-{uU_ctF};uz^9 Date: Mon, 1 May 2023 00:46:02 +0400 Subject: [PATCH 09/11] =?UTF-8?q?=D0=92=D0=BE=D1=82=20=D1=82=D0=B5=D0=BF?= =?UTF-8?q?=D0=B5=D1=80=D1=8C=20=D0=B1=D0=BE=D0=BB=D1=8C=D1=88=D0=B5=20?= =?UTF-8?q?=D0=BF=D0=BE=D1=85=D0=BE=D0=B6=D0=B5=20=D0=BD=D0=B0=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=B4=D1=83=20:)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataGridViewExtension.cs | 7 ++- .../BlacksmithWorkshop/FormMain.cs | 2 +- .../BlacksmithWorkshop/Program.cs | 17 ------- .../BlacksmithWorkshopBusinessLogic.csproj | 4 ++ .../BusinessLogicImplementationExtension.cs | 40 +++++++++++++++ .../DI/DependencyManager.cs | 12 ++++- .../IBusinessLogicImplementationExtension.cs | 16 ++++++ .../DI/ServiceProviderLoader.cs | 48 +++++++++++++++++- .../BlacksmithWorkshopBusinessLogic.dll | Bin 0 -> 75264 bytes .../BlacksmithWorkshopContracts.dll | Bin 0 -> 38912 bytes .../BlacksmithWorkshopDataModels.dll | Bin 0 -> 7168 bytes 11 files changed, 124 insertions(+), 22 deletions(-) create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogicImplementationExtension.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/IBusinessLogicImplementationExtension.cs create mode 100644 BlacksmithWorkshop/BusinessLogicImplementationExtensions/BlacksmithWorkshopBusinessLogic.dll create mode 100644 BlacksmithWorkshop/BusinessLogicImplementationExtensions/BlacksmithWorkshopContracts.dll create mode 100644 BlacksmithWorkshop/BusinessLogicImplementationExtensions/BlacksmithWorkshopDataModels.dll diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/DataGridViewExtension.cs b/BlacksmithWorkshop/BlacksmithWorkshop/DataGridViewExtension.cs index fd6b156..5c3f776 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/DataGridViewExtension.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/DataGridViewExtension.cs @@ -55,8 +55,11 @@ namespace BlacksmithWorkshop { column.Width = columnAttr.Width; } - } - } + + + column.DefaultCellStyle.Format = columnAttr.Format; + } + } } } diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs index 36d8270..5ea1d74 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormMain.cs @@ -178,7 +178,7 @@ namespace BlacksmithWorkshop private void ImplementerToolStripMenuItem_Click_1(object sender, EventArgs e) { - var form = DependencyManager.Instance.Resolve(); + var form = DependencyManager.Instance.Resolve(); form.ShowDialog(); } diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/Program.cs b/BlacksmithWorkshop/BlacksmithWorkshop/Program.cs index 8b23862..2362d2f 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/Program.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/Program.cs @@ -64,23 +64,6 @@ namespace BlacksmithWorkshop option.AddNLog("nlog.config"); }); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(); - - DependencyManager.Instance.RegisterType(); - DependencyManager.Instance.RegisterType(true); - DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); diff --git a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BlacksmithWorkshopBusinessLogic.csproj b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BlacksmithWorkshopBusinessLogic.csproj index 40f0332..5507a90 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BlacksmithWorkshopBusinessLogic.csproj +++ b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BlacksmithWorkshopBusinessLogic.csproj @@ -21,4 +21,8 @@ + + + + diff --git a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogicImplementationExtension.cs b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogicImplementationExtension.cs new file mode 100644 index 0000000..75c998d --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogicImplementationExtension.cs @@ -0,0 +1,40 @@ +using BlacksmithWorkshopBusinessLogic.BusinessLogic; +using BlacksmithWorkshopBusinessLogic.MailWorker; +using BlacksmithWorkshopBusinessLogic.OfficePackage.Implements; +using BlacksmithWorkshopBusinessLogic.OfficePackage; +using BlacksmithWorkshopContracts.BusinessLogicsContracts; +using BlacksmithWorkshopContracts.DI; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopBusinessLogic +{ + public class BusinessLogicImplementationExtension : IBusinessLogicImplementationExtension + { + public int Priority => 0; + + public void RegisterServices() + { + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(true); + + DependencyManager.Instance.RegisterType(); + } + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/DependencyManager.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/DependencyManager.cs index a8837bb..47cf397 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/DependencyManager.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/DependencyManager.cs @@ -45,7 +45,17 @@ namespace BlacksmithWorkshopContracts.DI // регистрируем зависимости ext.RegisterServices(); - } + + var extBusiness = ServiceProviderLoader.GetBusinessLogicImplementationExtensions(); + + if (extBusiness == null) + { + throw new ArgumentNullException("Отсутствуют компоненты для загрузки зависимостей по модулям"); + } + + // регистрируем зависимости + extBusiness.RegisterServices(); + } //Регистрация логгера public void AddLogging(Action configure) => _dependencyManager.AddLogging(configure); diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/IBusinessLogicImplementationExtension.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/IBusinessLogicImplementationExtension.cs new file mode 100644 index 0000000..052ea0e --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/IBusinessLogicImplementationExtension.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopContracts.DI +{ + public interface IBusinessLogicImplementationExtension + { + public int Priority { get; } + + //Регистрация сервисов + public void RegisterServices(); + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/ServiceProviderLoader.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/ServiceProviderLoader.cs index 12929f0..9343eeb 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/ServiceProviderLoader.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/ServiceProviderLoader.cs @@ -57,5 +57,51 @@ namespace BlacksmithWorkshopContracts.DI return $"{directory?.FullName}\\ImplementationExtensions"; } - } + + public static IBusinessLogicImplementationExtension? GetBusinessLogicImplementationExtensions() + { + IBusinessLogicImplementationExtension? source = null; + + var files = Directory.GetFiles(TryGetBusinessLogicImplementationExtensionsFolder(), "*.dll", SearchOption.AllDirectories); + + foreach (var file in files.Distinct()) + { + Assembly asm = Assembly.LoadFrom(file); + + foreach (var t in asm.GetExportedTypes()) + { + if (t.IsClass && typeof(IBusinessLogicImplementationExtension).IsAssignableFrom(t)) + { + if (source == null) + { + source = (IBusinessLogicImplementationExtension)Activator.CreateInstance(t)!; + } + else + { + var newSource = (IBusinessLogicImplementationExtension)Activator.CreateInstance(t)!; + + if (newSource.Priority > source.Priority) + { + source = newSource; + } + } + } + } + } + + return source; + } + + private static string TryGetBusinessLogicImplementationExtensionsFolder() + { + var directory = new DirectoryInfo(Directory.GetCurrentDirectory()); + + while (directory != null && !directory.GetDirectories("BusinessLogicImplementationExtensions", SearchOption.AllDirectories).Any(x => x.Name == "BusinessLogicImplementationExtensions")) + { + directory = directory.Parent; + } + + return $"{directory?.FullName}\\BusinessLogicImplementationExtensions"; + } + } } diff --git a/BlacksmithWorkshop/BusinessLogicImplementationExtensions/BlacksmithWorkshopBusinessLogic.dll b/BlacksmithWorkshop/BusinessLogicImplementationExtensions/BlacksmithWorkshopBusinessLogic.dll new file mode 100644 index 0000000000000000000000000000000000000000..82a2522dd714b60cb6812e4a71e993f53b1a0746 GIT binary patch literal 75264 zcmd>n33wD$_V2BwtM??GPP&s2$R0ZBBqRY55S6f~D2fOws0aa~1d)PnP%#7v;DVwf z?kFlCI)ghd1jQ-#I-uJ%mMf=p*?m6e4 zyVkAh=J?aD7Mc)3$LHsth4=%m^f!#*!NC%U(+VC>6OVXbD*A&m=B1(uGnN2SFsHD2PT|P0;|tFSUC zLSXkhN<`Pcsfq}IS9+KtCUlh@j4l+ykg`?S0IQl^fcR6r$qZHrmz|lr2zSn{K9Jt?sBfpk@)C{KZh?z!sC2Ak# z+KXPbx^N>%#2gZ;X2PB!)Z`JklqJBNYYrq%S=1cFSIum|)f~b^#5|m?CLB|t<8diV zpf+>O(JW6u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y#?$fpnRZr7VUYX0>A95Bjcldd}f<;@`fJ! z6wU9UpFso;VLvaRAG{qgf`3Tv*5)1C{E@E5QJ+K4_@L+SkFJ+wUih>FA1tlP zttjE>f7gBtc#LI~JWUbeZ=IEJP7I!h=ll(0&Z3V@r=c0mGa0tgc?3(sKZJbiko#YU NLeM{@{{P{?{{_bCmhAul literal 0 HcmV?d00001 diff --git a/BlacksmithWorkshop/BusinessLogicImplementationExtensions/BlacksmithWorkshopContracts.dll b/BlacksmithWorkshop/BusinessLogicImplementationExtensions/BlacksmithWorkshopContracts.dll new file mode 100644 index 0000000000000000000000000000000000000000..f00c4931c32e5ed423b9f0ab8a25a750c058a476 GIT binary patch literal 38912 zcmeHw34D~*)%Us2ESZ_?8)3;ZVGR%>t1KcWB%rZuLO`ihG9*J7O)_C7EJ4wUh>D`3 ztyHZ`0%&Vn_Z^gmg0{BW2D@5q4WDSGYDKME7ybU{JokBKLZYwr*Y|sW-|zbd=0E5B z&$;KW&%O7#vt<6)caVdKoOpir8PVf-T7efr@w4%Lf^sx8&;>Xpz=ZkCBgrfeI zNVp*qX!6$unw!I|{#8MLWL>jA)a^gAAi*e6 zBI@RbIPuX#lmc$rJw!Dp+P+Bl6L}Ks9_VKz=w+?JjjgO-ho>J;uB$FLBzgFWYRe+g zNF6jOTNebb=nZ%#Jj&5sWszWG7>-<4>cNv^?Zh+TQBE{FK^5^uZdW|GYzDdL)=5OS zwh^HfztUresGQ%YB)BF z00NaZ2@ycJEJ6ej7$&BN2zMD5qtAVt*Hga{yVEJ6ejxfUS;hyfNM0*E||5COzMix44uyg_sI z$kI*2#nB??Ym@+en>k0#a$Z{GT#NymId(!-2SJtbA_DRpY!M=W7-A73fXKH95kM4J zga{xCEkXnkMHV3f2){*$0HW9;L;x|=B18Z&%pybpG29|V_^YlamqCl1yB0ZLBX={$ z(v8GX653$|RA~nh5PhUYhyY@gMQ9;@6_i*O5#T!7B18Z&#v(+p1|Yi|QS_E?GxG_h z8Eg5AfB>Zy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=?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BlacksmithWorkshopContracts/DI/DependencyManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/DependencyManager.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/DependencyManager.cs index 47cf397..00543bc 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/DependencyManager.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DI/DependencyManager.cs @@ -43,7 +43,7 @@ namespace BlacksmithWorkshopContracts.DI throw new ArgumentNullException("Отсутствуют компоненты для загрузки зависимостей по модулям"); } - // регистрируем зависимости + //регистрируем зависимости хранилищ ext.RegisterServices(); var extBusiness = ServiceProviderLoader.GetBusinessLogicImplementationExtensions(); @@ -53,7 +53,7 @@ namespace BlacksmithWorkshopContracts.DI throw new ArgumentNullException("Отсутствуют компоненты для загрузки зависимостей по модулям"); } - // регистрируем зависимости + //регистрируем зависимости бизнес-логики extBusiness.RegisterServices(); } -- 2.25.1 From 1311954a4a712273398454f2a311d26280e21e6e Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Wed, 3 May 2023 10:00:44 +0400 Subject: [PATCH 11/11] =?UTF-8?q?=D0=A1=D0=94=D0=90=D0=9B=20=D0=9B=D0=90?= =?UTF-8?q?=D0=91=D0=AB!!!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BlacksmithWorkshopContracts.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/BlacksmithWorkshopContracts.csproj b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BlacksmithWorkshopContracts.csproj index 2216d57..941f69e 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/BlacksmithWorkshopContracts.csproj +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BlacksmithWorkshopContracts.csproj @@ -8,8 +8,8 @@ - - + + -- 2.25.1