public override void When(ShipmentCommands.Import c) { var shipment = new CreateShipment(); shipment.ShipmentId = c.ShipmentId; shipment.ShipmentTypeId = c.ShipmentTypeId; shipment.OriginFacilityId = c.OriginFacilityId; shipment.DestinationFacilityId = c.DestinationFacilityId; shipment.PartyIdFrom = c.PartyIdFrom; shipment.PartyIdTo = c.PartyIdTo; if (c.ShipmentTypeId == ShipmentTypeIds.PurchaseShipment || c.ShipmentTypeId == ShipmentTypeIds.IncomingShipment) { shipment.StatusId = StatusItemIds.PurchShipCreated; } else { shipment.StatusId = StatusItemIds.ShipmentInput; } //todo More properties... var shipItems = new List <ICreateShipmentItem>(); int i = 0; foreach (var d in c.ShipmentItems) { var shipItem = CreateShipmentItem(i, d); shipment.ShipmentItems.Add(shipItem); i++; } When(shipment); }
private string CreateShipment_1(CreateProduct prd_1) { var shipmentId = DateTime.Now.Ticks.ToString(); var shipImport = new ShipmentCommands.Import(); shipImport.ShipmentId = shipmentId; var prdId = prd_1.ProductId; var rollId_1 = "H71051402A"; var shipItem_1 = NewImportingShipmentItem(prdId, rollId_1); var rollId_2 = "H00000000A"; var shipItem_2 = NewImportingShipmentItem(prdId, rollId_2); shipImport.ShipmentItems = new HashSet <ImportingShipmentItem>(new ImportingShipmentItem[] { shipItem_1, shipItem_2, }); shipImport.ShipmentTypeId = ShipmentTypeIds.IncomingShipment; shipImport.DestinationFacilityId = "TEST_1"; shipmentApplicationService.When(shipImport); return(shipmentId); }
public void When(ShipmentCommands.Import c) { throw new NotImplementedException();//todo }