Exemplo n.º 1
0
        } // DispenseOut()

        /// <summary>
        /// Dispense into this container.
        /// </summary>
        /// <param name="DispenseType"></param>
        /// <param name="QuantityToAdd">Positive quantity to add</param>
        /// <param name="UnitId"></param>
        /// <param name="RequestItemId"></param>
        /// <param name="SourceContainer"></param>
        public void DispenseIn(CswEnumNbtContainerDispenseType DispenseType, double QuantityToAdd, CswPrimaryKey UnitId,
                               CswPrimaryKey RequestItemId = null, CswNbtObjClassContainer SourceContainer = null, bool RecordTransaction = true)
        {
            double RealQuantityToAdd = _getDispenseAmountInProperUnits(QuantityToAdd, UnitId, _Container.Quantity.UnitId);
            double CurrentQuantity   = 0;

            if (CswTools.IsDouble(_Container.Quantity.Quantity))
            {
                CurrentQuantity = _Container.Quantity.Quantity;
            }
            _Container.Quantity.Quantity = CurrentQuantity + RealQuantityToAdd;
            if (RecordTransaction)
            {
                _ContainerDispenseTransactionBuilder.create(DispenseType, RealQuantityToAdd, _Container.Quantity.UnitId, RequestItemId, SourceContainer, _Container, IsImport: _IsImport);
            }
            CswEnumNbtContainerLocationTypeOptions ContainerLocationType =
                SourceContainer == null ? CswEnumNbtContainerLocationTypeOptions.Receipt
                                        : CswEnumNbtContainerLocationTypeOptions.Dispense;

            _Container.CreateContainerLocationNode(ContainerLocationType);
        } // DispenseIn()
Exemplo n.º 2
0
        private void _createNotScannedContainerLocation(ContainerData.ReconciliationActions Action, CswEnumNbtContainerLocationTypeOptions Type)
        {
            CswNbtMetaDataObjectClass ContLocOc = _CswNbtResources.MetaData.getObjectClass(CswEnumNbtObjectClass.ContainerLocationClass);
            CswNbtMetaDataNodeType    ContLocNt = ContLocOc.FirstNodeType;

            if (null != ContLocNt)
            {
                _CswNbtResources.Nodes.makeNodeFromNodeTypeId(ContLocNt.NodeTypeId, delegate(CswNbtNode NewNode)
                {
                    CswNbtObjClassContainerLocation ContLocNode = NewNode;
                    ContLocNode.Container.RelatedNodeId         = CswConvert.ToPrimaryKey(Action.ContainerId);
                    ContLocNode.Location.SelectedNodeId         = CswConvert.ToPrimaryKey(Action.LocationId);
                    ContLocNode.Type.Value            = Type.ToString();
                    ContLocNode.Status.Value          = CswEnumNbtContainerLocationStatusOptions.NotScanned.ToString();
                    ContLocNode.ActionApplied.Checked = CswEnumTristate.False;
                    if (Type == CswEnumNbtContainerLocationTypeOptions.Missing)
                    {
                        ContLocNode.Action.Value = CswEnumNbtContainerLocationActionOptions.MarkMissing.ToString();
                    }
                    else if (Type == CswEnumNbtContainerLocationTypeOptions.Ignore)
                    {
                        ContLocNode.Action.Value = CswEnumNbtContainerLocationActionOptions.Ignore.ToString();
                    }
                    ContLocNode.ActionByUser.RelatedNodeId = _CswNbtResources.CurrentNbtUser.UserId;
                    ContLocNode.ScanDate.DateTimeValue     = DateTime.Now;
                    ContLocNode.User.RelatedNodeId         = _CswNbtResources.CurrentNbtUser.UserId;
                });
            }
        }