From 686c850a1ffff095ff41c388d038d338742bf302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=BE=D0=BB=D0=B8=D0=BD=D0=B0=20=D0=A7=D1=83=D0=B1?= =?UTF-8?q?=D1=8B=D0=BA=D0=B8=D0=BD=D0=B0?= Date: Sun, 5 May 2024 16:00:24 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BB=D0=B0=D0=B1=D0=B0=206=20=D0=B2=D1=80?= =?UTF-8?q?=D0=BE=D0=B4=D0=B5=20=D0=B3=D0=BE=D1=82=D0=BE=D0=B2=D0=B0=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/OrderViewModel.cs | 2 +- .../ConfectioneryView/FormMain.Designer.cs | 53 +++++-------------- Confectionery/ConfectioneryView/FormMain.cs | 52 ------------------ 3 files changed, 15 insertions(+), 92 deletions(-) diff --git a/Confectionery/ConfectionaryContracts/ViewModels/OrderViewModel.cs b/Confectionery/ConfectionaryContracts/ViewModels/OrderViewModel.cs index 49fb87d..2a2ef0c 100644 --- a/Confectionery/ConfectionaryContracts/ViewModels/OrderViewModel.cs +++ b/Confectionery/ConfectionaryContracts/ViewModels/OrderViewModel.cs @@ -20,11 +20,11 @@ namespace ConfectioneryContracts.ViewModels [DisplayName("ФИО клиента")] public string ClientFIO { get; set; } = string.Empty; - [DisplayName("Количество")] public int? ImplementerId { get; set; } [DisplayName("ФИО исполнителя")] public string ImplementerFIO { get; set; } = string.Empty; + [DisplayName("Количество")] public int Count { get; set; } [DisplayName("Сумма")] public double Sum { get; set; } diff --git a/Confectionery/ConfectioneryView/FormMain.Designer.cs b/Confectionery/ConfectioneryView/FormMain.Designer.cs index f7cae2a..bb7b953 100644 --- a/Confectionery/ConfectioneryView/FormMain.Designer.cs +++ b/Confectionery/ConfectioneryView/FormMain.Designer.cs @@ -33,6 +33,7 @@ this.компонентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.изделияToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.клиентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.исполнителиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.отчетыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.списокКомпонентовToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.компонентыПоИзделиямToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -40,11 +41,8 @@ this.запускРаботToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.dataGridView = new System.Windows.Forms.DataGridView(); this.ButtonCreateOrder = new System.Windows.Forms.Button(); - this.ButtonTakeOrderInWork = new System.Windows.Forms.Button(); - this.ButtonOrderReady = new System.Windows.Forms.Button(); this.ButtonIssuedOrder = new System.Windows.Forms.Button(); this.ButtonRef = new System.Windows.Forms.Button(); - this.исполнителиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); this.SuspendLayout(); @@ -76,24 +74,31 @@ // компонентыToolStripMenuItem // this.компонентыToolStripMenuItem.Name = "компонентыToolStripMenuItem"; - this.компонентыToolStripMenuItem.Size = new System.Drawing.Size(224, 26); + this.компонентыToolStripMenuItem.Size = new System.Drawing.Size(185, 26); this.компонентыToolStripMenuItem.Text = "Компоненты"; this.компонентыToolStripMenuItem.Click += new System.EventHandler(this.КомпонентыToolStripMenuItem_Click); // // изделияToolStripMenuItem // this.изделияToolStripMenuItem.Name = "изделияToolStripMenuItem"; - this.изделияToolStripMenuItem.Size = new System.Drawing.Size(224, 26); + this.изделияToolStripMenuItem.Size = new System.Drawing.Size(185, 26); this.изделияToolStripMenuItem.Text = "Изделия"; this.изделияToolStripMenuItem.Click += new System.EventHandler(this.ИзделияToolStripMenuItem_Click); // // клиентыToolStripMenuItem // this.клиентыToolStripMenuItem.Name = "клиентыToolStripMenuItem"; - this.клиентыToolStripMenuItem.Size = new System.Drawing.Size(224, 26); + this.клиентыToolStripMenuItem.Size = new System.Drawing.Size(185, 26); this.клиентыToolStripMenuItem.Text = "Клиенты"; this.клиентыToolStripMenuItem.Click += new System.EventHandler(this.КлиентыToolStripMenuItem_Click); // + // исполнителиToolStripMenuItem + // + this.исполнителиToolStripMenuItem.Name = "исполнителиToolStripMenuItem"; + this.исполнителиToolStripMenuItem.Size = new System.Drawing.Size(185, 26); + this.исполнителиToolStripMenuItem.Text = "Исполнители"; + this.исполнителиToolStripMenuItem.Click += new System.EventHandler(this.исполнителиToolStripMenuItem_Click); + // // отчетыToolStripMenuItem // this.отчетыToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -134,6 +139,7 @@ // // dataGridView // + this.dataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridView.Location = new System.Drawing.Point(13, 31); this.dataGridView.Name = "dataGridView"; @@ -152,29 +158,9 @@ this.ButtonCreateOrder.UseVisualStyleBackColor = true; this.ButtonCreateOrder.Click += new System.EventHandler(this.ButtonCreateOrder_Click); // - // ButtonTakeOrderInWork - // - this.ButtonTakeOrderInWork.Location = new System.Drawing.Point(1050, 164); - this.ButtonTakeOrderInWork.Name = "ButtonTakeOrderInWork"; - this.ButtonTakeOrderInWork.Size = new System.Drawing.Size(246, 29); - this.ButtonTakeOrderInWork.TabIndex = 3; - this.ButtonTakeOrderInWork.Text = "Отдать на выполнение"; - this.ButtonTakeOrderInWork.UseVisualStyleBackColor = true; - this.ButtonTakeOrderInWork.Click += new System.EventHandler(this.ButtonTakeOrderInWork_Click); - // - // ButtonOrderReady - // - this.ButtonOrderReady.Location = new System.Drawing.Point(1050, 256); - this.ButtonOrderReady.Name = "ButtonOrderReady"; - this.ButtonOrderReady.Size = new System.Drawing.Size(246, 29); - this.ButtonOrderReady.TabIndex = 4; - this.ButtonOrderReady.Text = "Заказ готов"; - this.ButtonOrderReady.UseVisualStyleBackColor = true; - this.ButtonOrderReady.Click += new System.EventHandler(this.ButtonOrderReady_Click); - // // ButtonIssuedOrder // - this.ButtonIssuedOrder.Location = new System.Drawing.Point(1050, 351); + this.ButtonIssuedOrder.Location = new System.Drawing.Point(1050, 135); this.ButtonIssuedOrder.Name = "ButtonIssuedOrder"; this.ButtonIssuedOrder.Size = new System.Drawing.Size(246, 29); this.ButtonIssuedOrder.TabIndex = 5; @@ -184,7 +170,7 @@ // // ButtonRef // - this.ButtonRef.Location = new System.Drawing.Point(1050, 441); + this.ButtonRef.Location = new System.Drawing.Point(1050, 198); this.ButtonRef.Name = "ButtonRef"; this.ButtonRef.Size = new System.Drawing.Size(246, 29); this.ButtonRef.TabIndex = 6; @@ -192,13 +178,6 @@ this.ButtonRef.UseVisualStyleBackColor = true; this.ButtonRef.Click += new System.EventHandler(this.ButtonRef_Click); // - // исполнителиToolStripMenuItem - // - this.исполнителиToolStripMenuItem.Name = "исполнителиToolStripMenuItem"; - this.исполнителиToolStripMenuItem.Size = new System.Drawing.Size(224, 26); - this.исполнителиToolStripMenuItem.Text = "Исполнители"; - this.исполнителиToolStripMenuItem.Click += new System.EventHandler(this.исполнителиToolStripMenuItem_Click); - // // FormMain // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); @@ -206,8 +185,6 @@ this.ClientSize = new System.Drawing.Size(1376, 569); this.Controls.Add(this.ButtonRef); this.Controls.Add(this.ButtonIssuedOrder); - this.Controls.Add(this.ButtonOrderReady); - this.Controls.Add(this.ButtonTakeOrderInWork); this.Controls.Add(this.ButtonCreateOrder); this.Controls.Add(this.dataGridView); this.Controls.Add(this.menuStrip); @@ -231,8 +208,6 @@ private ToolStripMenuItem изделияToolStripMenuItem; private DataGridView dataGridView; private Button ButtonCreateOrder; - private Button ButtonTakeOrderInWork; - private Button ButtonOrderReady; private Button ButtonIssuedOrder; private Button ButtonRef; private ToolStripMenuItem отчетыToolStripMenuItem; diff --git a/Confectionery/ConfectioneryView/FormMain.cs b/Confectionery/ConfectioneryView/FormMain.cs index 17f55db..e51af24 100644 --- a/Confectionery/ConfectioneryView/FormMain.cs +++ b/Confectionery/ConfectioneryView/FormMain.cs @@ -133,58 +133,6 @@ namespace ConfectioneryView LoadData(); } } - private void ButtonTakeOrderInWork_Click(object sender, EventArgs e) - { - if (dataGridView.SelectedRows.Count == 1) - { - int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); - _logger.LogInformation("Заказ №{id}. Меняется статус на 'В работе'", id); - try - { - var operationResult = _orderLogic.TakeOrderInWork(new - OrderBindingModel - { Id = id }); - if (!operationResult) - { - throw new Exception("Ошибка при сохранении. Дополнительная информация в логах."); - } - LoadData(); - } - catch (Exception ex) - { - _logger.LogError(ex, "Ошибка передачи заказа в работу"); - MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, - MessageBoxIcon.Error); - } - } - } - - private void ButtonOrderReady_Click(object sender, EventArgs e) - { - if (dataGridView.SelectedRows.Count == 1) - { - int id = - Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); - _logger.LogInformation("Заказ №{id}. Меняется статус на 'Готов'", - id); - try - { - var operationResult = _orderLogic.FinishOrder(new - OrderBindingModel - { Id = id }); - if (!operationResult) - { - throw new Exception("Ошибка при сохранении. Дополнительная информация в логах."); - } - LoadData(); - } - catch (Exception ex) - { - _logger.LogError(ex, "Ошибка отметки о готовности заказа"); - MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - } private void ButtonIssuedOrder_Click(object sender, EventArgs e) {