Убрал лишнее
This commit is contained in:
parent
994d876b42
commit
9f8ec53755
@ -40,45 +40,6 @@ namespace PlumbingRepairBusinessLogic.BusinessLogic
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public bool StatusUpdate(OrderBindingModel model, OrderStatus newStatus)
|
|
||||||
{
|
|
||||||
CheckModel(model, false);
|
|
||||||
|
|
||||||
OrderViewModel? order = _orderStorage.GetElement(new OrderSearchModel
|
|
||||||
{
|
|
||||||
Id = model.Id
|
|
||||||
});
|
|
||||||
|
|
||||||
if (order == null)
|
|
||||||
{
|
|
||||||
_logger.LogWarning("Status update to " + newStatus.ToString() + " operation failed. Order not found.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
model.Status = order.Status;
|
|
||||||
if (!model.ImplementerId.HasValue) model.ImplementerId = order.ImplementerId;
|
|
||||||
|
|
||||||
if (model.Status + 1 != newStatus)
|
|
||||||
{
|
|
||||||
_logger.LogWarning("Status update to " + newStatus.ToString() + " operation failed. Incorrect Order status.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
model.Status = newStatus;
|
|
||||||
|
|
||||||
if (newStatus == OrderStatus.Готов)
|
|
||||||
{
|
|
||||||
model.DateImplement = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_orderStorage.Update(model) == null)
|
|
||||||
{
|
|
||||||
_logger.LogWarning("Update operation failed");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}*/
|
|
||||||
public bool StatusUpdate(OrderBindingModel model, OrderStatus newStatus)
|
public bool StatusUpdate(OrderBindingModel model, OrderStatus newStatus)
|
||||||
{
|
{
|
||||||
var viewModel = _orderStorage.GetElement(new OrderSearchModel { Id = model.Id });
|
var viewModel = _orderStorage.GetElement(new OrderSearchModel { Id = model.Id });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user