private InventoryEvent ToEvent(global::PartialFoods.Services.Activity activity) { InventoryEvent evt = null; if (activity.ActivityType == PartialFoods.Services.ActivityType.Released) { evt = new InventoryReleasedEvent(); } else if (activity.ActivityType == PartialFoods.Services.ActivityType.Reserved) { evt = new InventoryReservedEvent(); } else if (activity.ActivityType == PartialFoods.Services.ActivityType.Stockadd) { evt = new InventoryStockEvent(); } if (evt != null) { evt.SKU = activity.SKU; evt.EventTime = activity.Timestamp; evt.UserID = ""; evt.Quantity = activity.Quantity; evt.OrderID = activity.OrderID; evt.EventID = activity.ActivityID; } return(evt); }
private static InventoryEvent ToEvent(Activity activity) { InventoryEvent evt = null; switch (activity.ActivityType) { case ActivityType.Released: evt = new InventoryReleasedEvent(); break; case ActivityType.Reserved: evt = new InventoryReservedEvent(); break; case ActivityType.Stockadd: evt = new InventoryStockEvent(); break; } if (evt != null) { evt.SKU = activity.SKU; evt.EventTime = activity.Timestamp; evt.UserId = ""; evt.Quantity = activity.Quantity; evt.OrderId = activity.OrderID; evt.EventId = activity.ActivityID; } return(evt); }