Exemplo n.º 1
0
        public List<ItemFulfillmentLine> createNewItemFulfillmentLines(ItemFulfillmentItemList oldItemList)
        {
            List<ItemFulfillmentLine> newItemList = new List<ItemFulfillmentLine>();
            bool flag = false;
            foreach (var line in oldItemList.item)
            {
                ItemFulfillmentLine newLine = new ItemFulfillmentLine(line.item.name, line.quantity, flag);
                newItemList.Add(newLine);
            }

            return newItemList;
        }
Exemplo n.º 2
0
        public ItemFulfillmentItemList addToExistingItemList(ItemFulfillmentItemList oldList, ItemFulfillmentLine fulfillmentLine)
        {
            int oldCount = oldList.item.Length;
            int newCount = oldCount + 1;
            ItemFulfillmentItemList newFulfillmentList = new ItemFulfillmentItemList();
            ItemFulfillmentItem[] newItem = new ItemFulfillmentItem[1];
            ItemFulfillmentItem[] newList = new ItemFulfillmentItem[newCount];
            oldList.item.CopyTo(newList, 0);

            newItem[0] = new ItemFulfillmentItem();
            RecordRef item = new RecordRef();
            item.type = RecordType.inventoryItem;
            item.typeSpecified = true;
            item.name = fulfillmentLine.item.ItemName;
            item.internalId = fulfillmentLine.item.itemRecord.internalId;
            newItem[0].item = item;

            newItem[0].quantity = fulfillmentLine.QuantityRequested;
            newItem[0].quantitySpecified = true;

            newItem.CopyTo(newList, oldCount);
            newFulfillmentList.item = newList;

            return newFulfillmentList;
        }