public static Order GetEntity(this OrderPrimitive primitive) { Order result = new Order(); result.Id = primitive.Id; result.Recipe_Id = primitive.Recipe_Id; result.ClientBuilding_Id = primitive.ClientBuilding_Id; result.Amount = primitive.Amount; result.DateOfOrder = primitive.DateOfOrder; result.Deleted = primitive.Deleted; result.Deactivated = primitive.Deactivated; result.Canceled = primitive.Canceled; result.Pump = primitive.Pump; result.Notice = primitive.Notice; result.PlannedDeliveryTime = primitive.PlannedDeliveryTime; return result; }
private void FixupOrder(Order previousValue) { if (previousValue != null && previousValue.DeliveryNotes.Contains(this)) { previousValue.DeliveryNotes.Remove(this); } if (Order != null) { if (!Order.DeliveryNotes.Contains(this)) { Order.DeliveryNotes.Add(this); } if (Order_Id != Order.Id) { Order_Id = Order.Id; } } else if (!_settingFK) { Order_Id = null; } }