Шаг 2.не знаю - fix "готово"
This commit is contained in:
parent
1d143d2846
commit
aff68c7469
@ -168,7 +168,7 @@ namespace PrecastConcretePlantView
|
||||
try
|
||||
{
|
||||
var operationResult = _orderLogic.DeliveryOrder(new OrderBindingModel
|
||||
{
|
||||
{
|
||||
Id = id,
|
||||
ReinforcedId = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["ReinforcedId"].Value),
|
||||
ReinforcedName = DataGridView.SelectedRows[0].Cells["ReinforcedName"].Value.ToString(),
|
||||
|
@ -59,12 +59,17 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogic
|
||||
}
|
||||
|
||||
if (viewModel.Status + 1 != newStatus)
|
||||
{
|
||||
_logger.LogWarning("Status update to " + newStatus.ToString() + " operation failed. Order status incorrect.");
|
||||
return false;
|
||||
}
|
||||
|
||||
model.Status = newStatus;
|
||||
model.Status = newStatus;
|
||||
|
||||
if (model.Status == OrderStatus.Готов)
|
||||
{
|
||||
model.DateImplement = DateTime.Now;
|
||||
|
||||
var reinforced = _reinforcedStorage.GetElement(new() { Id = viewModel.ReinforcedId });
|
||||
|
||||
if (reinforced == null)
|
||||
@ -83,10 +88,12 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogic
|
||||
}
|
||||
|
||||
CheckModel(model, false);
|
||||
|
||||
if (_orderStorage.Update(model) == null)
|
||||
{
|
||||
model.Status--;
|
||||
_logger.LogWarning("Update operation failed");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user