}// END ThrowOnInconsistentCommands ///////////////////// protected virtual IMovementConfirmationLineEvent Map(IMovementConfirmationLineCommand c, IMovementConfirmationCommand outerCommand, long version, IMovementConfirmationState outerState) { var create = (c.CommandType == CommandType.Create) ? (c as ICreateMovementConfirmationLine) : null; if (create != null) { return(MapCreate(create, outerCommand, version, outerState)); } var merge = (c.CommandType == CommandType.MergePatch || c.CommandType == null) ? (c as IMergePatchMovementConfirmationLine) : null; if (merge != null) { return(MapMergePatch(merge, outerCommand, version, outerState)); } var remove = (c.CommandType == CommandType.Remove) ? (c as IRemoveMovementConfirmationLine) : null; if (remove != null) { return(MapRemove(remove, outerCommand, version)); } throw new NotSupportedException(); }
public void Remove(IMovementConfirmationLineCommand c) { _innerCommands.Remove(c); }
public void Add(IMovementConfirmationLineCommand c) { _innerCommands.Add(c); }
protected void ThrowOnInconsistentCommands(IMovementConfirmationCommand command, IMovementConfirmationLineCommand innerCommand) { var properties = command as ICreateOrMergePatchOrDeleteMovementConfirmation; var innerProperties = innerCommand as ICreateOrMergePatchOrRemoveMovementConfirmationLine; if (properties == null || innerProperties == null) { return; } if (innerProperties.MovementConfirmationDocumentNumber == default(string)) { innerProperties.MovementConfirmationDocumentNumber = properties.DocumentNumber; } else { var outerDocumentNumberName = "DocumentNumber"; var outerDocumentNumberValue = properties.DocumentNumber; var innerMovementConfirmationDocumentNumberName = "MovementConfirmationDocumentNumber"; var innerMovementConfirmationDocumentNumberValue = innerProperties.MovementConfirmationDocumentNumber; ThrowOnInconsistentIds(innerProperties, innerMovementConfirmationDocumentNumberName, innerMovementConfirmationDocumentNumberValue, outerDocumentNumberName, outerDocumentNumberValue); } }// END ThrowOnInconsistentCommands /////////////////////
void IMovementConfirmationLineCommands.Remove(IMovementConfirmationLineCommand c) { _innerCommands.Remove((CreateOrMergePatchOrRemoveMovementConfirmationLineDto)c); }