Ejemplo n.º 1
0
        } // getPercentDone()

        /// <summary>
        /// Run the next iteration of this batch operation
        /// </summary>
        public void runBatchOp(CswNbtObjClassBatchOp BatchNode)
        {
            try
            {
                if (BatchNode.OpNameValue == CswEnumNbtBatchOpName.Receiving)
                {
                    _CswNbtSdTabsAndProps = new CswNbtSdTabsAndProps(_CswNbtResources);

                    BatchNode.start();

                    ReceivingBatchData BatchData = new ReceivingBatchData(BatchNode.BatchData.Text);

                    CswNbtActReceiving        ActReceiving      = new CswNbtActReceiving(_CswNbtResources);
                    CswNbtReceivingDefinition UpdatedReceiptDef = ActReceiving.receiveContainers(BatchData.ReceiptDef, ref _NodesProcessed, _MaxNodeProcessed);

                    ReceivingBatchData UpdatedBatchData = new ReceivingBatchData(UpdatedReceiptDef);
                    BatchNode.BatchData.Text = UpdatedBatchData.ToString();

                    if (0 == BatchData.CountNumberContainersToCreate() || 0 == _NodesProcessed)
                    {
                        BatchNode.finish();
                    }

                    _NodesProcessed = 0; //reset this for Unit Test purposes

                    BatchNode.PercentDone.Value = getPercentDone(BatchNode);
                    BatchNode.BatchData.Text    = BatchData.ToString();
                    BatchNode.postChanges(false);
                }
            }
            catch (Exception ex)
            {
                BatchNode.error(ex);
            }
        } // runBatchOp()
Ejemplo n.º 2
0
        /// <summary>
        /// Create a new batch operation to handle creation of Containers from the receiving wizard
        /// </summary>
        public CswNbtObjClassBatchOp makeBatchOp(CswNbtReceivingDefinition ReceiptDefinition)
        {
            CswNbtObjClassBatchOp BatchNode = null;
            ReceivingBatchData    BatchData = new ReceivingBatchData(ReceiptDefinition);

            BatchNode = CswNbtBatchManager.makeNew(_CswNbtResources, _BatchOpName, BatchData.ToString());
            return(BatchNode);
        } // makeBatchOp()