protected virtual IItemIssuanceMvoStateCreated Map(ICreateItemIssuanceMvo c) { var stateEventId = new ItemIssuanceMvoEventId(c.ShipmentItemIssuanceId, c.ShipmentVersion); IItemIssuanceMvoStateCreated e = NewItemIssuanceMvoStateCreated(stateEventId); e.OrderId = c.OrderId; e.OrderItemSeqId = c.OrderItemSeqId; e.ShipGroupSeqId = c.ShipGroupSeqId; e.ProductId = c.ProductId; e.LocatorId = c.LocatorId; e.AttributeSetInstanceId = c.AttributeSetInstanceId; e.ShipmentItemSeqId = c.ShipmentItemSeqId; e.FixedAssetId = c.FixedAssetId; e.MaintHistSeqId = c.MaintHistSeqId; e.IssuedDateTime = c.IssuedDateTime; e.IssuedByUserLoginId = c.IssuedByUserLoginId; e.Quantity = c.Quantity; e.CancelQuantity = c.CancelQuantity; e.Version = c.Version; e.Active = c.Active; e.ShipmentShipmentTypeId = c.ShipmentShipmentTypeId; e.ShipmentStatusId = c.ShipmentStatusId; e.ShipmentPrimaryOrderId = c.ShipmentPrimaryOrderId; e.ShipmentPrimaryReturnId = c.ShipmentPrimaryReturnId; e.ShipmentPrimaryShipGroupSeqId = c.ShipmentPrimaryShipGroupSeqId; e.ShipmentPicklistBinId = c.ShipmentPicklistBinId; e.ShipmentEstimatedReadyDate = c.ShipmentEstimatedReadyDate; e.ShipmentEstimatedShipDate = c.ShipmentEstimatedShipDate; e.ShipmentEstimatedShipWorkEffId = c.ShipmentEstimatedShipWorkEffId; e.ShipmentEstimatedArrivalDate = c.ShipmentEstimatedArrivalDate; e.ShipmentEstimatedArrivalWorkEffId = c.ShipmentEstimatedArrivalWorkEffId; e.ShipmentLatestCancelDate = c.ShipmentLatestCancelDate; e.ShipmentEstimatedShipCost = c.ShipmentEstimatedShipCost; e.ShipmentCurrencyUomId = c.ShipmentCurrencyUomId; e.ShipmentHandlingInstructions = c.ShipmentHandlingInstructions; e.ShipmentOriginFacilityId = c.ShipmentOriginFacilityId; e.ShipmentDestinationFacilityId = c.ShipmentDestinationFacilityId; e.ShipmentOriginContactMechId = c.ShipmentOriginContactMechId; e.ShipmentOriginTelecomNumberId = c.ShipmentOriginTelecomNumberId; e.ShipmentDestinationContactMechId = c.ShipmentDestinationContactMechId; e.ShipmentDestinationTelecomNumberId = c.ShipmentDestinationTelecomNumberId; e.ShipmentPartyIdTo = c.ShipmentPartyIdTo; e.ShipmentPartyIdFrom = c.ShipmentPartyIdFrom; e.ShipmentAdditionalShippingCharge = c.ShipmentAdditionalShippingCharge; e.ShipmentAddtlShippingChargeDesc = c.ShipmentAddtlShippingChargeDesc; e.ShipmentCreatedBy = c.ShipmentCreatedBy; e.ShipmentCreatedAt = c.ShipmentCreatedAt; e.ShipmentUpdatedBy = c.ShipmentUpdatedBy; e.ShipmentUpdatedAt = c.ShipmentUpdatedAt; e.ShipmentActive = c.ShipmentActive; e.CommandId = c.CommandId; e.CreatedBy = (string)c.RequesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); var shipmentVersion = c.ShipmentVersion; return(e); }
public virtual void Initialize(IItemIssuanceMvoStateCreated stateCreated) { var aggregateId = stateCreated.ItemIssuanceMvoEventId.ShipmentItemIssuanceId; var state = new ItemIssuanceMvoState(); state.ShipmentItemIssuanceId = aggregateId; var aggregate = (ItemIssuanceMvoAggregate)GetItemIssuanceMvoAggregate(state); var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId); aggregate.Apply(stateCreated); Persist(eventStoreAggregateId, aggregate, state); }
public virtual void When(IItemIssuanceMvoStateCreated e) { ThrowOnWrongEvent(e); this.OrderId = e.OrderId; this.OrderItemSeqId = e.OrderItemSeqId; this.ShipGroupSeqId = e.ShipGroupSeqId; this.ProductId = e.ProductId; this.LocatorId = e.LocatorId; this.AttributeSetInstanceId = e.AttributeSetInstanceId; this.ShipmentItemSeqId = e.ShipmentItemSeqId; this.FixedAssetId = e.FixedAssetId; this.MaintHistSeqId = e.MaintHistSeqId; this.IssuedDateTime = e.IssuedDateTime; this.IssuedByUserLoginId = e.IssuedByUserLoginId; this.Quantity = e.Quantity; this.CancelQuantity = e.CancelQuantity; this.Version = (e.Version != null && e.Version.HasValue) ? e.Version.Value : default(long); this.Active = (e.Active != null && e.Active.HasValue) ? e.Active.Value : default(bool); this.ShipmentShipmentTypeId = e.ShipmentShipmentTypeId; this.ShipmentStatusId = e.ShipmentStatusId; this.ShipmentPrimaryOrderId = e.ShipmentPrimaryOrderId; this.ShipmentPrimaryReturnId = e.ShipmentPrimaryReturnId; this.ShipmentPrimaryShipGroupSeqId = e.ShipmentPrimaryShipGroupSeqId; this.ShipmentPicklistBinId = e.ShipmentPicklistBinId; this.ShipmentEstimatedReadyDate = e.ShipmentEstimatedReadyDate; this.ShipmentEstimatedShipDate = e.ShipmentEstimatedShipDate; this.ShipmentEstimatedShipWorkEffId = e.ShipmentEstimatedShipWorkEffId; this.ShipmentEstimatedArrivalDate = e.ShipmentEstimatedArrivalDate; this.ShipmentEstimatedArrivalWorkEffId = e.ShipmentEstimatedArrivalWorkEffId; this.ShipmentLatestCancelDate = e.ShipmentLatestCancelDate; this.ShipmentEstimatedShipCost = e.ShipmentEstimatedShipCost; this.ShipmentCurrencyUomId = e.ShipmentCurrencyUomId; this.ShipmentHandlingInstructions = e.ShipmentHandlingInstructions; this.ShipmentOriginFacilityId = e.ShipmentOriginFacilityId; this.ShipmentDestinationFacilityId = e.ShipmentDestinationFacilityId; this.ShipmentOriginContactMechId = e.ShipmentOriginContactMechId; this.ShipmentOriginTelecomNumberId = e.ShipmentOriginTelecomNumberId; this.ShipmentDestinationContactMechId = e.ShipmentDestinationContactMechId; this.ShipmentDestinationTelecomNumberId = e.ShipmentDestinationTelecomNumberId; this.ShipmentPartyIdTo = e.ShipmentPartyIdTo; this.ShipmentPartyIdFrom = e.ShipmentPartyIdFrom; this.ShipmentAdditionalShippingCharge = e.ShipmentAdditionalShippingCharge; this.ShipmentAddtlShippingChargeDesc = e.ShipmentAddtlShippingChargeDesc; this.ShipmentCreatedBy = e.ShipmentCreatedBy; this.ShipmentCreatedAt = (e.ShipmentCreatedAt != null && e.ShipmentCreatedAt.HasValue) ? e.ShipmentCreatedAt.Value : default(DateTime); this.ShipmentUpdatedBy = e.ShipmentUpdatedBy; this.ShipmentUpdatedAt = (e.ShipmentUpdatedAt != null && e.ShipmentUpdatedAt.HasValue) ? e.ShipmentUpdatedAt.Value : default(DateTime); this.ShipmentActive = (e.ShipmentActive != null && e.ShipmentActive.HasValue) ? e.ShipmentActive.Value : default(bool); this.Deleted = false; this.CreatedBy = e.CreatedBy; this.CreatedAt = e.CreatedAt; }
public virtual ItemIssuanceMvoStateCreatedDto ToItemIssuanceMvoStateCreatedDto(IItemIssuanceMvoStateCreated e) { var dto = new ItemIssuanceMvoStateCreatedDto(); dto.ItemIssuanceMvoEventId = e.ItemIssuanceMvoEventId; dto.CreatedAt = e.CreatedAt; dto.CreatedBy = e.CreatedBy; dto.CommandId = e.CommandId; dto.OrderId = e.OrderId; dto.OrderItemSeqId = e.OrderItemSeqId; dto.ShipGroupSeqId = e.ShipGroupSeqId; dto.ProductId = e.ProductId; dto.LocatorId = e.LocatorId; dto.AttributeSetInstanceId = e.AttributeSetInstanceId; dto.ShipmentItemSeqId = e.ShipmentItemSeqId; dto.FixedAssetId = e.FixedAssetId; dto.MaintHistSeqId = e.MaintHistSeqId; dto.IssuedDateTime = e.IssuedDateTime; dto.IssuedByUserLoginId = e.IssuedByUserLoginId; dto.Quantity = e.Quantity; dto.CancelQuantity = e.CancelQuantity; dto.Version = e.Version; dto.Active = e.Active; dto.ShipmentShipmentTypeId = e.ShipmentShipmentTypeId; dto.ShipmentStatusId = e.ShipmentStatusId; dto.ShipmentPrimaryOrderId = e.ShipmentPrimaryOrderId; dto.ShipmentPrimaryReturnId = e.ShipmentPrimaryReturnId; dto.ShipmentPrimaryShipGroupSeqId = e.ShipmentPrimaryShipGroupSeqId; dto.ShipmentPicklistBinId = e.ShipmentPicklistBinId; dto.ShipmentEstimatedReadyDate = e.ShipmentEstimatedReadyDate; dto.ShipmentEstimatedShipDate = e.ShipmentEstimatedShipDate; dto.ShipmentEstimatedShipWorkEffId = e.ShipmentEstimatedShipWorkEffId; dto.ShipmentEstimatedArrivalDate = e.ShipmentEstimatedArrivalDate; dto.ShipmentEstimatedArrivalWorkEffId = e.ShipmentEstimatedArrivalWorkEffId; dto.ShipmentLatestCancelDate = e.ShipmentLatestCancelDate; dto.ShipmentEstimatedShipCost = e.ShipmentEstimatedShipCost; dto.ShipmentCurrencyUomId = e.ShipmentCurrencyUomId; dto.ShipmentHandlingInstructions = e.ShipmentHandlingInstructions; dto.ShipmentOriginFacilityId = e.ShipmentOriginFacilityId; dto.ShipmentDestinationFacilityId = e.ShipmentDestinationFacilityId; dto.ShipmentOriginContactMechId = e.ShipmentOriginContactMechId; dto.ShipmentOriginTelecomNumberId = e.ShipmentOriginTelecomNumberId; dto.ShipmentDestinationContactMechId = e.ShipmentDestinationContactMechId; dto.ShipmentDestinationTelecomNumberId = e.ShipmentDestinationTelecomNumberId; dto.ShipmentPartyIdTo = e.ShipmentPartyIdTo; dto.ShipmentPartyIdFrom = e.ShipmentPartyIdFrom; dto.ShipmentAdditionalShippingCharge = e.ShipmentAdditionalShippingCharge; dto.ShipmentAddtlShippingChargeDesc = e.ShipmentAddtlShippingChargeDesc; dto.ShipmentCreatedBy = e.ShipmentCreatedBy; dto.ShipmentCreatedAt = e.ShipmentCreatedAt; dto.ShipmentUpdatedBy = e.ShipmentUpdatedBy; dto.ShipmentUpdatedAt = e.ShipmentUpdatedAt; dto.ShipmentActive = e.ShipmentActive; return(dto); }
public virtual void Create(ICreateItemIssuanceMvo c) { IItemIssuanceMvoStateCreated e = Map(c); Apply(e); }
void IItemIssuanceMvoState.When(IItemIssuanceMvoStateCreated e) { throw new NotSupportedException(); }