diff --git a/SushiBar/SushiBar/Forms/FormImplementers.Designer.cs b/SushiBar/SushiBar/Forms/FormImplementers.Designer.cs index e85c556..e04b343 100644 --- a/SushiBar/SushiBar/Forms/FormImplementers.Designer.cs +++ b/SushiBar/SushiBar/Forms/FormImplementers.Designer.cs @@ -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; diff --git a/SushiBar/SushiBarBusinessLogic/BusinessLogics/OrderLogic.cs b/SushiBar/SushiBarBusinessLogic/BusinessLogics/OrderLogic.cs index e7e4df4..f47a449 100644 --- a/SushiBar/SushiBarBusinessLogic/BusinessLogics/OrderLogic.cs +++ b/SushiBar/SushiBarBusinessLogic/BusinessLogics/OrderLogic.cs @@ -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) { diff --git a/SushiBar/SushiBarDatabaseImplement/Models/Order.cs b/SushiBar/SushiBarDatabaseImplement/Models/Order.cs index 078f441..3000751 100644 --- a/SushiBar/SushiBarDatabaseImplement/Models/Order.cs +++ b/SushiBar/SushiBarDatabaseImplement/Models/Order.cs @@ -57,6 +57,8 @@ namespace SushiBarDatabaseImplement.Models } Status = model.Status; DateImplement = model.DateImplement; + ClientId = model.ClientId; + ImplementerId = model.ImplementerId; } public OrderViewModel GetViewModel => new() {