пофиксил исполнение

This commit is contained in:
bekodeg 2024-05-08 10:57:02 +04:00
parent b32e33a11e
commit 4848aa8f6b
3 changed files with 13 additions and 2 deletions

View File

@ -44,6 +44,7 @@
dataGridView.Name = "dataGridView";
dataGridView.RowHeadersWidth = 51;
dataGridView.RowTemplate.Height = 29;
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView.Size = new Size(565, 426);
dataGridView.TabIndex = 0;
//
@ -91,7 +92,7 @@
RefreshButton.UseVisualStyleBackColor = true;
RefreshButton.Click += RefreshButton_Click;
//
// ImplementersForm
// FormImplementers
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
@ -101,7 +102,7 @@
Controls.Add(ChangeButton);
Controls.Add(CreateButton);
Controls.Add(dataGridView);
Name = "ImplementersForm";
Name = "FormImplementers";
Text = "Исполнители";
WindowState = FormWindowState.Maximized;
Load += ImplementersForm_Load;

View File

@ -84,6 +84,12 @@ namespace SushiBarBusinessLogic.BusinessLogics
{
throw new ArgumentNullException(nameof(element));
}
_logger.LogDebug($"{model.Id}\n{orderStatus} {element.Status}\n{model.ImplementerId}_{element.ImplementerId}");
if (element.ImplementerId != null && model.ImplementerId != null && model.ImplementerId != element.ImplementerId)
{
throw new InvalidOperationException(nameof(model.ImplementerId));
}
model.SushiId = element.SushiId;
model.DateCreate = element.DateCreate;
@ -91,6 +97,8 @@ namespace SushiBarBusinessLogic.BusinessLogics
model.Status = element.Status;
model.Count = element.Count;
model.Sum = element.Sum;
model.ClientId = element.ClientId;
model.ImplementerId = element.ImplementerId.HasValue ? element.ImplementerId : model.ImplementerId;
if (model.Status != orderStatus - 1)
{

View File

@ -57,6 +57,8 @@ namespace SushiBarDatabaseImplement.Models
}
Status = model.Status;
DateImplement = model.DateImplement;
ClientId = model.ClientId;
ImplementerId = model.ImplementerId;
}
public OrderViewModel GetViewModel => new()
{