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);
        }
示例#2
0
 public static CreateItemIssuanceMvo ToCreateItemIssuanceMvo(this ItemIssuanceMvoState state)
 {
     return(state.ToCreateItemIssuanceMvo <CreateItemIssuanceMvo>());
 }
示例#3
0
 public static MergePatchItemIssuanceMvo ToMergePatchItemIssuanceMvo(this ItemIssuanceMvoState state)
 {
     return(state.ToMergePatchItemIssuanceMvo <MergePatchItemIssuanceMvo>());
 }
示例#4
0
 public static DeleteItemIssuanceMvo ToDeleteItemIssuanceMvo(this ItemIssuanceMvoState state)
 {
     return(state.ToDeleteItemIssuanceMvo <DeleteItemIssuanceMvo>());
 }
示例#5
0
 public static IItemIssuanceMvoCommand ToCreateOrMergePatchItemIssuanceMvo(this ItemIssuanceMvoState state)
 {
     return(state.ToCreateOrMergePatchItemIssuanceMvo <CreateItemIssuanceMvo, MergePatchItemIssuanceMvo>());
 }
示例#6
0
        public virtual IItemIssuanceMvoState ToItemIssuanceMvoState()
        {
            var state = new ItemIssuanceMvoState(true);

            state.ShipmentItemIssuanceId = this.ShipmentItemIssuanceId;
            state.OrderId                = this.OrderId;
            state.OrderItemSeqId         = this.OrderItemSeqId;
            state.ShipGroupSeqId         = this.ShipGroupSeqId;
            state.ProductId              = this.ProductId;
            state.LocatorId              = this.LocatorId;
            state.AttributeSetInstanceId = this.AttributeSetInstanceId;
            state.ShipmentItemSeqId      = this.ShipmentItemSeqId;
            state.FixedAssetId           = this.FixedAssetId;
            state.MaintHistSeqId         = this.MaintHistSeqId;
            state.IssuedDateTime         = this.IssuedDateTime;
            state.IssuedByUserLoginId    = this.IssuedByUserLoginId;
            state.Quantity               = this.Quantity;
            state.CancelQuantity         = this.CancelQuantity;
            if (this.Version != null && this.Version.HasValue)
            {
                state.Version = this.Version.Value;
            }
            if (this.Active != null && this.Active.HasValue)
            {
                state.Active = this.Active.Value;
            }
            state.ShipmentShipmentTypeId             = this.ShipmentShipmentTypeId;
            state.ShipmentStatusId                   = this.ShipmentStatusId;
            state.ShipmentPrimaryOrderId             = this.ShipmentPrimaryOrderId;
            state.ShipmentPrimaryReturnId            = this.ShipmentPrimaryReturnId;
            state.ShipmentPrimaryShipGroupSeqId      = this.ShipmentPrimaryShipGroupSeqId;
            state.ShipmentPicklistBinId              = this.ShipmentPicklistBinId;
            state.ShipmentEstimatedReadyDate         = this.ShipmentEstimatedReadyDate;
            state.ShipmentEstimatedShipDate          = this.ShipmentEstimatedShipDate;
            state.ShipmentEstimatedShipWorkEffId     = this.ShipmentEstimatedShipWorkEffId;
            state.ShipmentEstimatedArrivalDate       = this.ShipmentEstimatedArrivalDate;
            state.ShipmentEstimatedArrivalWorkEffId  = this.ShipmentEstimatedArrivalWorkEffId;
            state.ShipmentLatestCancelDate           = this.ShipmentLatestCancelDate;
            state.ShipmentEstimatedShipCost          = this.ShipmentEstimatedShipCost;
            state.ShipmentCurrencyUomId              = this.ShipmentCurrencyUomId;
            state.ShipmentHandlingInstructions       = this.ShipmentHandlingInstructions;
            state.ShipmentOriginFacilityId           = this.ShipmentOriginFacilityId;
            state.ShipmentDestinationFacilityId      = this.ShipmentDestinationFacilityId;
            state.ShipmentOriginContactMechId        = this.ShipmentOriginContactMechId;
            state.ShipmentOriginTelecomNumberId      = this.ShipmentOriginTelecomNumberId;
            state.ShipmentDestinationContactMechId   = this.ShipmentDestinationContactMechId;
            state.ShipmentDestinationTelecomNumberId = this.ShipmentDestinationTelecomNumberId;
            state.ShipmentPartyIdTo                  = this.ShipmentPartyIdTo;
            state.ShipmentPartyIdFrom                = this.ShipmentPartyIdFrom;
            state.ShipmentAdditionalShippingCharge   = this.ShipmentAdditionalShippingCharge;
            state.ShipmentAddtlShippingChargeDesc    = this.ShipmentAddtlShippingChargeDesc;
            state.ShipmentCreatedBy                  = this.ShipmentCreatedBy;
            if (this.ShipmentCreatedAt != null && this.ShipmentCreatedAt.HasValue)
            {
                state.ShipmentCreatedAt = this.ShipmentCreatedAt.Value;
            }
            state.ShipmentUpdatedBy = this.ShipmentUpdatedBy;
            if (this.ShipmentUpdatedAt != null && this.ShipmentUpdatedAt.HasValue)
            {
                state.ShipmentUpdatedAt = this.ShipmentUpdatedAt.Value;
            }
            if (this.ShipmentActive != null && this.ShipmentActive.HasValue)
            {
                state.ShipmentActive = this.ShipmentActive.Value;
            }
            if (this.ShipmentVersion != null && this.ShipmentVersion.HasValue)
            {
                state.ShipmentVersion = this.ShipmentVersion.Value;
            }
            state.CreatedBy = this.CreatedBy;
            if (this.CreatedAt != null && this.CreatedAt.HasValue)
            {
                state.CreatedAt = this.CreatedAt.Value;
            }
            state.UpdatedBy = this.UpdatedBy;
            if (this.UpdatedAt != null && this.UpdatedAt.HasValue)
            {
                state.UpdatedAt = this.UpdatedAt.Value;
            }

            return(state);
        }