This commit is contained in:
parent 0fd7b8dc85
commit a1de87096f
3 changed files with 135 additions and 134 deletions

View File

@ -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)
{

View File

@ -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
});

View File

@ -20,139 +20,139 @@
base.Dispose(disposing);
}
#region Windows Form Designer generated code
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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();
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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;