Beispiel #1
0
        }// END ThrowOnInconsistentCommands /////////////////////

        protected void ThrowOnInconsistentCommands(IOrderShipGroupCommand command, IOrderItemShipGroupAssociationCommand innerCommand)
        {
            var properties      = command as ICreateOrMergePatchOrRemoveOrderShipGroup;
            var innerProperties = innerCommand as ICreateOrMergePatchOrRemoveOrderItemShipGroupAssociation;

            if (properties == null || innerProperties == null)
            {
                return;
            }
            if (innerProperties.OrderId == default(string))
            {
                innerProperties.OrderId = properties.OrderId;
            }
            else
            {
                var outerOrderIdName  = "OrderId";
                var outerOrderIdValue = properties.OrderId;
                var innerOrderIdName  = "OrderId";
                var innerOrderIdValue = innerProperties.OrderId;
                ThrowOnInconsistentIds(innerProperties, innerOrderIdName, innerOrderIdValue, outerOrderIdName, outerOrderIdValue);
            }

            if (innerProperties.OrderShipGroupShipGroupSeqId == default(string))
            {
                innerProperties.OrderShipGroupShipGroupSeqId = properties.ShipGroupSeqId;
            }
            else
            {
                var outerShipGroupSeqIdName  = "ShipGroupSeqId";
                var outerShipGroupSeqIdValue = properties.ShipGroupSeqId;
                var innerOrderShipGroupShipGroupSeqIdName  = "OrderShipGroupShipGroupSeqId";
                var innerOrderShipGroupShipGroupSeqIdValue = innerProperties.OrderShipGroupShipGroupSeqId;
                ThrowOnInconsistentIds(innerProperties, innerOrderShipGroupShipGroupSeqIdName, innerOrderShipGroupShipGroupSeqIdValue, outerShipGroupSeqIdName, outerShipGroupSeqIdValue);
            }
        }// END ThrowOnInconsistentCommands /////////////////////
Beispiel #2
0
        }// END Map(IRemove... ////////////////////////////

        protected virtual IOrderItemShipGroupAssociationEvent Map(IOrderItemShipGroupAssociationCommand c, IOrderShipGroupCommand outerCommand, long version, IOrderShipGroupState outerState)
        {
            var create = (c.CommandType == CommandType.Create) ? (c as ICreateOrderItemShipGroupAssociation) : null;

            if (create != null)
            {
                return(MapCreate(create, outerCommand, version, outerState));
            }

            var merge = (c.CommandType == CommandType.MergePatch || c.CommandType == null) ? (c as IMergePatchOrderItemShipGroupAssociation) : null;

            if (merge != null)
            {
                return(MapMergePatch(merge, outerCommand, version, outerState));
            }

            var remove = (c.CommandType == CommandType.Remove) ? (c as IRemoveOrderItemShipGroupAssociation) : null;

            if (remove != null)
            {
                return(MapRemove(remove, outerCommand, version));
            }
            throw new NotSupportedException();
        }
Beispiel #3
0
 public void Remove(IOrderItemShipGroupAssociationCommand c)
 {
     _innerCommands.Remove(c);
 }
Beispiel #4
0
 public void Add(IOrderItemShipGroupAssociationCommand c)
 {
     _innerCommands.Add(c);
 }
 void IOrderItemShipGroupAssociationCommands.Remove(IOrderItemShipGroupAssociationCommand c)
 {
     _innerCommands.Remove((CreateOrMergePatchOrRemoveOrderItemShipGroupAssociationDto)c);
 }