From a1de87096f6bfcc0df4ccb063d2c0eb907f4b2d1 Mon Sep 17 00:00:00 2001 From: Factorino73 Date: Mon, 22 Apr 2024 16:36:41 +0400 Subject: [PATCH] Fixes --- .../BusinessLogics/OrderLogic.cs | 3 +- .../BusinessLogics/WorkModeling.cs | 6 +- .../FormImplementer.Designer.cs | 260 +++++++++--------- 3 files changed, 135 insertions(+), 134 deletions(-) diff --git a/AircraftPlant/AircraftPlantBusinessLogic/BusinessLogics/OrderLogic.cs b/AircraftPlant/AircraftPlantBusinessLogic/BusinessLogics/OrderLogic.cs index c7b560e..274c92a 100644 --- a/AircraftPlant/AircraftPlantBusinessLogic/BusinessLogics/OrderLogic.cs +++ b/AircraftPlant/AircraftPlantBusinessLogic/BusinessLogics/OrderLogic.cs @@ -193,7 +193,7 @@ orderStorage) model.Status = newStatus; - if (model.Status == OrderStatus.Выдан) + if (model.Status == OrderStatus.Готов) { model.DateImplement = DateTime.Now; } @@ -201,6 +201,7 @@ orderStorage) { model.DateImplement = element.DateImplement; } + CheckModel(model, false); if (_orderStorage.Update(model) == null) { diff --git a/AircraftPlant/AircraftPlantBusinessLogic/BusinessLogics/WorkModeling.cs b/AircraftPlant/AircraftPlantBusinessLogic/BusinessLogics/WorkModeling.cs index fabbb3f..7a3e68b 100644 --- a/AircraftPlant/AircraftPlantBusinessLogic/BusinessLogics/WorkModeling.cs +++ b/AircraftPlant/AircraftPlantBusinessLogic/BusinessLogics/WorkModeling.cs @@ -95,7 +95,7 @@ namespace AircraftPlantBusinessLogic.BusinessLogics _logger.LogDebug("DoWork. Worker {Id} try get order {Order}", implementer.Id, order.Id); // пытаемся назначить заказ на исполнителя lock (orderLock) - { + { _orderLogic.TakeOrderInWork(new OrderBindingModel { Id = order.Id, @@ -106,7 +106,7 @@ namespace AircraftPlantBusinessLogic.BusinessLogics // делаем работу Thread.Sleep(implementer.WorkExperience * _rnd.Next(100, 1000) * order.Count); _logger.LogDebug("DoWork. Worker {Id} finish order {Order}", implementer.Id, order.Id); - _orderLogic.FinishOrder(new OrderBindingModel + _orderLogic.DeliveryOrder(new OrderBindingModel { Id = order.Id }); @@ -156,7 +156,7 @@ namespace AircraftPlantBusinessLogic.BusinessLogics // доделываем работу Thread.Sleep(implementer.WorkExperience * _rnd.Next(100, 300) * runOrder.Count); _logger.LogDebug("DoWork. Worker {Id} finish order {Order}", implementer.Id, runOrder.Id); - _orderLogic.FinishOrder(new OrderBindingModel + _orderLogic.DeliveryOrder(new OrderBindingModel { Id = runOrder.Id }); diff --git a/AircraftPlant/AircraftPlantView/FormImplementer.Designer.cs b/AircraftPlant/AircraftPlantView/FormImplementer.Designer.cs index b2fe207..eb92254 100644 --- a/AircraftPlant/AircraftPlantView/FormImplementer.Designer.cs +++ b/AircraftPlant/AircraftPlantView/FormImplementer.Designer.cs @@ -20,139 +20,139 @@ 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() - { - textBoxImplementerFIO = new TextBox(); - textBoxPassword = new TextBox(); - numericUpDownWorkExperience = new NumericUpDown(); - numericUpDownQualification = new NumericUpDown(); - buttonCancel = new Button(); - labelImplementerFIO = new Label(); - labelPassword = new Label(); - labelWorkExperience = new Label(); - labelQualification = new Label(); - buttonSave = new Button(); - ((System.ComponentModel.ISupportInitialize)numericUpDownWorkExperience).BeginInit(); - ((System.ComponentModel.ISupportInitialize)numericUpDownQualification).BeginInit(); - SuspendLayout(); - // - // textBoxImplementerFIO - // - textBoxImplementerFIO.Location = new Point(108, 12); - textBoxImplementerFIO.Name = "textBoxImplementerFIO"; - textBoxImplementerFIO.Size = new Size(264, 23); - textBoxImplementerFIO.TabIndex = 0; - // - // textBoxPassword - // - textBoxPassword.Location = new Point(108, 41); - textBoxPassword.Name = "textBoxPassword"; - textBoxPassword.Size = new Size(264, 23); - textBoxPassword.TabIndex = 1; - // - // numericUpDownWorkExperience - // - numericUpDownWorkExperience.Location = new Point(108, 70); - numericUpDownWorkExperience.Name = "numericUpDownWorkExperience"; - numericUpDownWorkExperience.Size = new Size(264, 23); - numericUpDownWorkExperience.TabIndex = 2; - // - // numericUpDownQualification - // - numericUpDownQualification.Location = new Point(108, 99); - numericUpDownQualification.Name = "numericUpDownQualification"; - numericUpDownQualification.Size = new Size(264, 23); - numericUpDownQualification.TabIndex = 3; - // - // buttonCancel - // - buttonCancel.Location = new Point(297, 134); - buttonCancel.Name = "buttonCancel"; - buttonCancel.Size = new Size(75, 23); - buttonCancel.TabIndex = 4; - buttonCancel.Text = "Отмена"; - buttonCancel.UseVisualStyleBackColor = true; - buttonCancel.Click += buttonCancel_Click; - // - // labelImplementerFIO - // - labelImplementerFIO.AutoSize = true; - labelImplementerFIO.Location = new Point(12, 15); - labelImplementerFIO.Name = "labelImplementerFIO"; - labelImplementerFIO.Size = new Size(37, 15); - labelImplementerFIO.TabIndex = 5; - labelImplementerFIO.Text = "ФИО:"; - // - // labelPassword - // - labelPassword.AutoSize = true; - labelPassword.Location = new Point(11, 44); - labelPassword.Name = "labelPassword"; - labelPassword.Size = new Size(52, 15); - labelPassword.TabIndex = 6; - labelPassword.Text = "Пароль:"; - // - // labelWorkExperience - // - labelWorkExperience.AutoSize = true; - labelWorkExperience.Location = new Point(12, 72); - labelWorkExperience.Name = "labelWorkExperience"; - labelWorkExperience.Size = new Size(38, 15); - labelWorkExperience.TabIndex = 7; - labelWorkExperience.Text = "label1"; - // - // labelQualification - // - labelQualification.AutoSize = true; - labelQualification.Location = new Point(11, 101); - labelQualification.Name = "labelQualification"; - labelQualification.Size = new Size(91, 15); - labelQualification.TabIndex = 8; - labelQualification.Text = "Квалификация:"; - // - // buttonSave - // - buttonSave.Location = new Point(216, 134); - buttonSave.Name = "buttonSave"; - buttonSave.Size = new Size(75, 23); - buttonSave.TabIndex = 9; - buttonSave.Text = "Сохранить"; - buttonSave.UseVisualStyleBackColor = true; - buttonSave.Click += buttonSave_Click; - // - // FormImplementer - // - AutoScaleDimensions = new SizeF(7F, 15F); - AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(384, 169); - Controls.Add(buttonSave); - Controls.Add(labelQualification); - Controls.Add(labelWorkExperience); - Controls.Add(labelPassword); - Controls.Add(labelImplementerFIO); - Controls.Add(buttonCancel); - Controls.Add(numericUpDownQualification); - Controls.Add(numericUpDownWorkExperience); - Controls.Add(textBoxPassword); - Controls.Add(textBoxImplementerFIO); - Name = "FormImplementer"; - Text = "Исполнитель"; - Load += FormImplementer_Load; - ((System.ComponentModel.ISupportInitialize)numericUpDownWorkExperience).EndInit(); - ((System.ComponentModel.ISupportInitialize)numericUpDownQualification).EndInit(); - ResumeLayout(false); - PerformLayout(); - } + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + textBoxImplementerFIO = new TextBox(); + textBoxPassword = new TextBox(); + numericUpDownWorkExperience = new NumericUpDown(); + numericUpDownQualification = new NumericUpDown(); + buttonCancel = new Button(); + labelImplementerFIO = new Label(); + labelPassword = new Label(); + labelWorkExperience = new Label(); + labelQualification = new Label(); + buttonSave = new Button(); + ((System.ComponentModel.ISupportInitialize)numericUpDownWorkExperience).BeginInit(); + ((System.ComponentModel.ISupportInitialize)numericUpDownQualification).BeginInit(); + SuspendLayout(); + // + // textBoxImplementerFIO + // + textBoxImplementerFIO.Location = new Point(108, 12); + textBoxImplementerFIO.Name = "textBoxImplementerFIO"; + textBoxImplementerFIO.Size = new Size(264, 23); + textBoxImplementerFIO.TabIndex = 0; + // + // textBoxPassword + // + textBoxPassword.Location = new Point(108, 41); + textBoxPassword.Name = "textBoxPassword"; + textBoxPassword.Size = new Size(264, 23); + textBoxPassword.TabIndex = 1; + // + // numericUpDownWorkExperience + // + numericUpDownWorkExperience.Location = new Point(108, 70); + numericUpDownWorkExperience.Name = "numericUpDownWorkExperience"; + numericUpDownWorkExperience.Size = new Size(264, 23); + numericUpDownWorkExperience.TabIndex = 2; + // + // numericUpDownQualification + // + numericUpDownQualification.Location = new Point(108, 99); + numericUpDownQualification.Name = "numericUpDownQualification"; + numericUpDownQualification.Size = new Size(264, 23); + numericUpDownQualification.TabIndex = 3; + // + // buttonCancel + // + buttonCancel.Location = new Point(297, 134); + buttonCancel.Name = "buttonCancel"; + buttonCancel.Size = new Size(75, 23); + buttonCancel.TabIndex = 4; + buttonCancel.Text = "Отмена"; + buttonCancel.UseVisualStyleBackColor = true; + buttonCancel.Click += buttonCancel_Click; + // + // labelImplementerFIO + // + labelImplementerFIO.AutoSize = true; + labelImplementerFIO.Location = new Point(12, 15); + labelImplementerFIO.Name = "labelImplementerFIO"; + labelImplementerFIO.Size = new Size(37, 15); + labelImplementerFIO.TabIndex = 5; + labelImplementerFIO.Text = "ФИО:"; + // + // labelPassword + // + labelPassword.AutoSize = true; + labelPassword.Location = new Point(11, 44); + labelPassword.Name = "labelPassword"; + labelPassword.Size = new Size(52, 15); + labelPassword.TabIndex = 6; + labelPassword.Text = "Пароль:"; + // + // labelWorkExperience + // + labelWorkExperience.AutoSize = true; + labelWorkExperience.Location = new Point(12, 72); + labelWorkExperience.Name = "labelWorkExperience"; + labelWorkExperience.Size = new Size(84, 15); + labelWorkExperience.TabIndex = 7; + labelWorkExperience.Text = "Опыт работы:"; + // + // labelQualification + // + labelQualification.AutoSize = true; + labelQualification.Location = new Point(11, 101); + labelQualification.Name = "labelQualification"; + labelQualification.Size = new Size(91, 15); + labelQualification.TabIndex = 8; + labelQualification.Text = "Квалификация:"; + // + // buttonSave + // + buttonSave.Location = new Point(216, 134); + buttonSave.Name = "buttonSave"; + buttonSave.Size = new Size(75, 23); + buttonSave.TabIndex = 9; + buttonSave.Text = "Сохранить"; + buttonSave.UseVisualStyleBackColor = true; + buttonSave.Click += buttonSave_Click; + // + // FormImplementer + // + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(384, 169); + Controls.Add(buttonSave); + Controls.Add(labelQualification); + Controls.Add(labelWorkExperience); + Controls.Add(labelPassword); + Controls.Add(labelImplementerFIO); + Controls.Add(buttonCancel); + Controls.Add(numericUpDownQualification); + Controls.Add(numericUpDownWorkExperience); + Controls.Add(textBoxPassword); + Controls.Add(textBoxImplementerFIO); + Name = "FormImplementer"; + Text = "Исполнитель"; + Load += FormImplementer_Load; + ((System.ComponentModel.ISupportInitialize)numericUpDownWorkExperience).EndInit(); + ((System.ComponentModel.ISupportInitialize)numericUpDownQualification).EndInit(); + ResumeLayout(false); + PerformLayout(); + } - #endregion + #endregion - private TextBox textBoxImplementerFIO; + private TextBox textBoxImplementerFIO; private TextBox textBoxPassword; private NumericUpDown numericUpDownWorkExperience; private NumericUpDown numericUpDownQualification;