Esempio n. 1
0
        }// END ThrowOnInconsistentCommands /////////////////////

        protected virtual IPhysicalInventoryLineEvent Map(IPhysicalInventoryLineCommand c, IPhysicalInventoryCommand outerCommand, long version, IPhysicalInventoryState outerState)
        {
            var create = (c.CommandType == CommandType.Create) ? (c as ICreatePhysicalInventoryLine) : null;

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

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

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

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

            if (remove != null)
            {
                return(MapRemove(remove, outerCommand, version));
            }
            throw new NotSupportedException();
        }
 void IPhysicalInventoryLineCommands.Remove(IPhysicalInventoryLineCommand c)
 {
     _innerCommands.Remove((CreateOrMergePatchOrRemovePhysicalInventoryLineDto)c);
 }
Esempio n. 3
0
 public void Remove(IPhysicalInventoryLineCommand c)
 {
     _innerCommands.Remove(c);
 }
Esempio n. 4
0
 public void Add(IPhysicalInventoryLineCommand c)
 {
     _innerCommands.Add(c);
 }
Esempio n. 5
0
        protected void ThrowOnInconsistentCommands(IPhysicalInventoryCommand command, IPhysicalInventoryLineCommand innerCommand)
        {
            var properties      = command as ICreateOrMergePatchOrDeletePhysicalInventory;
            var innerProperties = innerCommand as ICreateOrMergePatchOrRemovePhysicalInventoryLine;

            if (properties == null || innerProperties == null)
            {
                return;
            }
            if (innerProperties.PhysicalInventoryDocumentNumber == default(string))
            {
                innerProperties.PhysicalInventoryDocumentNumber = properties.DocumentNumber;
            }
            else
            {
                var outerDocumentNumberName  = "DocumentNumber";
                var outerDocumentNumberValue = properties.DocumentNumber;
                var innerPhysicalInventoryDocumentNumberName  = "PhysicalInventoryDocumentNumber";
                var innerPhysicalInventoryDocumentNumberValue = innerProperties.PhysicalInventoryDocumentNumber;
                ThrowOnInconsistentIds(innerProperties, innerPhysicalInventoryDocumentNumberName, innerPhysicalInventoryDocumentNumberValue, outerDocumentNumberName, outerDocumentNumberValue);
            }
        }// END ThrowOnInconsistentCommands /////////////////////