public virtual void When(IOrderItemShipGroupAssociationStateCreated e)
        {
            ThrowOnWrongEvent(e);
            this.Quantity = e.Quantity;

            this.CancelQuantity = e.CancelQuantity;

            this.Active = (e.Active != null && e.Active.HasValue) ? e.Active.Value : default(bool);

            this.Deleted = false;

            this.CreatedBy = e.CreatedBy;
            this.CreatedAt = e.CreatedAt;
        }
示例#2
0
        protected virtual IOrderItemShipGroupAssociationStateCreated MapCreate(ICreateOrderItemShipGroupAssociation c, IOrderShipGroupCommand outerCommand, long version, IOrderShipGroupState outerState)
        {
            c.RequesterId = outerCommand.RequesterId;
            var stateEventId = new OrderItemShipGroupAssociationEventId(c.OrderId, c.OrderShipGroupShipGroupSeqId, c.OrderItemSeqId, version);
            IOrderItemShipGroupAssociationStateCreated e = NewOrderItemShipGroupAssociationStateCreated(stateEventId);
            var s = outerState.OrderItemShipGroupAssociations.Get(c.OrderItemSeqId, true);

            e.Quantity       = c.Quantity;
            e.CancelQuantity = c.CancelQuantity;
            e.Active         = c.Active;

            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();
            return(e);
        }// END Map(ICreate... ////////////////////////////
示例#3
0
        protected virtual IOrderShipGroupStateCreated MapCreate(ICreateOrderShipGroup c, IOrderCommand outerCommand, long version, IOrderState outerState)
        {
            c.RequesterId = outerCommand.RequesterId;
            var stateEventId = new OrderShipGroupEventId(c.OrderId, c.ShipGroupSeqId, version);
            IOrderShipGroupStateCreated e = NewOrderShipGroupStateCreated(stateEventId);
            var s = outerState.OrderShipGroups.Get(c.ShipGroupSeqId, true);

            e.ShipmentMethodTypeId  = c.ShipmentMethodTypeId;
            e.SupplierPartyId       = c.SupplierPartyId;
            e.VendorPartyId         = c.VendorPartyId;
            e.CarrierPartyId        = c.CarrierPartyId;
            e.CarrierRoleTypeId     = c.CarrierRoleTypeId;
            e.FacilityId            = c.FacilityId;
            e.DestinationFacilityId = c.DestinationFacilityId;
            e.ContactMechId         = c.ContactMechId;
            e.TelecomContactMechId  = c.TelecomContactMechId;
            e.TrackingNumber        = c.TrackingNumber;
            e.ContactPartyId        = c.ContactPartyId;
            e.VehiclePlateNumber    = c.VehiclePlateNumber;
            e.ShippingInstructions  = c.ShippingInstructions;
            e.MaySplit                    = c.MaySplit;
            e.GiftMessage                 = c.GiftMessage;
            e.IsGift                      = c.IsGift;
            e.ShipAfterDate               = c.ShipAfterDate;
            e.ShipByDate                  = c.ShipByDate;
            e.EstimatedShipDate           = c.EstimatedShipDate;
            e.EstimatedDeliveryDate       = c.EstimatedDeliveryDate;
            e.PickwaveId                  = c.PickwaveId;
            e.NumberOfPackages            = c.NumberOfPackages;
            e.NumberOfContainers          = c.NumberOfContainers;
            e.NumberOfPakagesPerContainer = c.NumberOfPakagesPerContainer;
            NewOrderShipGroupOrderShipGroupActionCommandAndExecute(c, s, e);
            e.Active = c.Active;

            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();

            foreach (ICreateOrderItemShipGroupAssociation innerCommand in c.OrderItemShipGroupAssociations)
            {
                ThrowOnInconsistentCommands(c, innerCommand);

                IOrderItemShipGroupAssociationStateCreated innerEvent = MapCreate(innerCommand, c, version, s);
                e.AddOrderItemShipGroupAssociationEvent(innerEvent);
            }

            return(e);
        }// END Map(ICreate... ////////////////////////////
示例#4
0
 public virtual void AddOrderItemShipGroupAssociationEvent(IOrderItemShipGroupAssociationStateCreated e)
 {
     ThrowOnInconsistentEventIds(e);
     this._orderItemShipGroupAssociationEvents[e.OrderItemShipGroupAssociationEventId] = e;
 }
示例#5
0
        public virtual OrderItemShipGroupAssociationStateCreatedDto ToOrderItemShipGroupAssociationStateCreatedDto(IOrderItemShipGroupAssociationStateCreated e)
        {
            var dto = new OrderItemShipGroupAssociationStateCreatedDto();

            dto.OrderItemShipGroupAssociationEventId = e.OrderItemShipGroupAssociationEventId;
            dto.CreatedAt      = e.CreatedAt;
            dto.CreatedBy      = e.CreatedBy;
            dto.Version        = e.Version;
            dto.CommandId      = e.CommandId;
            dto.Quantity       = e.Quantity;
            dto.CancelQuantity = e.CancelQuantity;
            dto.Active         = e.Active;
            return(dto);
        }
 void IOrderShipGroupStateCreated.AddOrderItemShipGroupAssociationEvent(IOrderItemShipGroupAssociationStateCreated e)
 {
     this._orderItemShipGroupAssociationEvents.AddOrderItemShipGroupAssociationEvent(e);
 }
 void IOrderItemShipGroupAssociationState.When(IOrderItemShipGroupAssociationStateCreated e)
 {
     throw new NotSupportedException();
 }