예제 #1
0
        private bool _validateContainer(ref OperationData OpData)
        {
            bool ret = false;

            ICswNbtTree tree = _getTree(CswEnumNbtObjectClass.ContainerClass, OpData.Field1.Value, true);

            if (tree.getChildNodeCount() > 0)
            {
                tree.goToNthChild(0);
                foreach (CswNbtTreeNodeProp treeNodeProp in tree.getChildNodePropsOfNode())
                {
                    if (treeNodeProp.PropName.Equals(CswNbtObjClassContainer.PropertyName.Disposed))
                    {
                        bool disposed = CswConvert.ToBoolean(treeNodeProp.Field1);
                        if (disposed)
                        {
                            OpData.Field1.StatusMsg = "Cannot perform " + OpData.Mode + " operation on disposed Container " + OpData.Field1.Value;
                            OpData.Log.Add(DateTime.Now + " - ERROR: " + OpData.Field1.StatusMsg);
                        }
                        if (false == disposed)
                        {
                            OpData.Field1.NodeIdStr = tree.getNodeIdForCurrentPosition().ToString();
                            ret = true;
                        }
                    }
                    else if (treeNodeProp.PropName.Equals(CswNbtObjClassContainer.PropertyName.Quantity))
                    {
                        OpData.Field1.SecondValue = " (current quantity: " + treeNodeProp.Gestalt + ")";
                        OpData.ScanTextLabel      = "Enter a quantity (" + treeNodeProp.Field1 + ") :";
                    }
                }
            }
            else
            {
                OpData.Field1.StatusMsg       = "Could not find a Container with barcode " + OpData.Field1.Value;
                OpData.Field1.ServerValidated = false;
                OpData.Log.Add(DateTime.Now + " - ERROR: " + OpData.Field1.StatusMsg);
            }

            return(ret);
        }
예제 #2
0
        public override void CommitOperation(ref OperationData OpData)
        {
            CswNbtNode NodeToOpen = _CswNbtResources.Nodes[OpData.Field1.NodeId];

            if (_CswNbtResources.Permit.canNodeType(CswEnumNbtNodeTypePermission.Edit, NodeToOpen.getNodeType()))
            {
                ICswNbtKioskModeOpenable containerToOpen = (ICswNbtKioskModeOpenable)NodeToOpen.ObjClass;
                containerToOpen.OpenItem();
                NodeToOpen.postChanges(false);
                OpData.Log.Add(DateTime.Now + " - Opened container " + OpData.Field1.Value + " expiration date set to: " + containerToOpen.ExpirationDate.Gestalt);
                OpData.Field1.Value           = string.Empty;
                OpData.Field1.ServerValidated = false;
            }
            else
            {
                string statusMsg = "You do not have permission to open Container (" + OpData.Field1.Value + ")";
                OpData.Field1.StatusMsg       = statusMsg;
                OpData.Field1.ServerValidated = false;
                OpData.Log.Add(DateTime.Now + " - ERROR: " + statusMsg);
            }
        }
        private bool _validateContainer(ref OperationData OpData)
        {
            bool ret = false;

            ICswNbtTree tree = _getTree(CswEnumNbtObjectClass.ContainerClass, OpData.Field1.Value, false);

            if (tree.getChildNodeCount() > 0)
            {
                tree.goToNthChild(0);
                OpData.Field1.NodeIdStr = tree.getNodeIdForCurrentPosition().ToString();
                ret = true;
            }
            else
            {
                OpData.Field1.StatusMsg       = "Could not find a Container with barcode " + OpData.Field1.Value;
                OpData.Field1.ServerValidated = false;
                OpData.Log.Add(DateTime.Now + " - ERROR: " + OpData.Field1.StatusMsg);
            }

            return(ret);
        }
예제 #4
0
        private bool _validateLocation(ref OperationData OpData)
        {
            bool        ret  = false;
            ICswNbtTree tree = _getTree(CswEnumNbtObjectClass.LocationClass, OpData.Field1.Value, true);

            if (tree.getChildNodeCount() > 0)
            {
                tree.goToNthChild(0);
                CswNbtMetaDataObjectClassProp propLoc = _CswNbtResources.MetaData.getObjectClass(CswEnumNbtObjectClass.LocationClass).getObjectClassProp(CswNbtObjClassLocation.PropertyName.Location);
                CswNbtObjClassLocation        anode   = tree.getCurrentNode();
                string containingLocation             = string.IsNullOrEmpty(anode.Location.Gestalt) ? "" : anode.Location.Gestalt + " > ";
                OpData.Field1.SecondValue = "(" + containingLocation + tree.getNodeNameForCurrentPosition() + ")";
                OpData.Field1.NodeIdStr   = tree.getNodeIdForCurrentPosition().ToString();
                ret = true;
            }
            else
            {
                OpData.Field1.StatusMsg       = "Could not find a Location with barcode " + OpData.Field1.Value;
                OpData.Field1.ServerValidated = false;
                OpData.Log.Add(DateTime.Now + " - ERROR: " + OpData.Field1.StatusMsg);
            }
            return(ret);
        }
 public override void SetFields(ref OperationData OpData)
 {
     base.SetFields(ref OpData);
     OpData.Field1.Name = "User:"******"Item:";
 }
        private bool _validateItem(ref OperationData OpData)
        {
            bool ret = false;

            CswNbtSearch search = new CswNbtSearch(_CswNbtResources)
            {
                SearchTerm = OpData.Field2.Value,
                SearchType = CswEnumSqlLikeMode.Exact
            };
            ICswNbtTree tree = search.Results();

            int childCount = tree.getChildNodeCount();

            for (int i = 0; i < childCount; i++)
            {
                tree.goToNthChild(i);
                CswNbtNode                 node        = tree.getNodeForCurrentPosition();
                CswNbtMetaDataNodeType     nodeType    = node.getNodeType();
                CswNbtMetaDataNodeTypeProp barcodeProp = (CswNbtMetaDataNodeTypeProp)nodeType.getBarcodeProperty();

                if (null != barcodeProp)
                {
                    string barcodeValue = node.Properties[barcodeProp].AsBarcode.Barcode;
                    string ObjClass     = node.ObjClass.ObjectClass.ObjectClass;

                    if (string.Equals(barcodeValue, OpData.Field2.Value, StringComparison.CurrentCultureIgnoreCase))
                    {
                        if (ObjClass == CswEnumNbtObjectClass.EquipmentAssemblyClass)
                        {
                            OpData.Field2.FoundObjClass = CswEnumNbtObjectClass.EquipmentAssemblyClass;
                            OpData.Field2.NodeIdStr     = tree.getNodeIdForCurrentPosition().ToString();
                            ret = true;
                        }

                        if (ObjClass == CswEnumNbtObjectClass.EquipmentClass)
                        {
                            OpData.Field2.FoundObjClass = CswEnumNbtObjectClass.EquipmentClass;
                            OpData.Field2.NodeIdStr     = tree.getNodeIdForCurrentPosition().ToString();
                            ret = true;
                        }

                        if (ObjClass == CswEnumNbtObjectClass.ContainerClass)
                        {
                            OpData.Field2.FoundObjClass = CswEnumNbtObjectClass.ContainerClass;
                            OpData.Field2.NodeIdStr     = tree.getNodeIdForCurrentPosition().ToString();
                            ret = true;
                        }
                    }
                }
                tree.goToParentNode();
            }

            if (string.IsNullOrEmpty(OpData.Field2.FoundObjClass))
            {
                string StatusMsg = "";
                bool   first     = true;
                if (_CswNbtResources.Modules.IsModuleEnabled(CswEnumNbtModuleName.Containers))
                {
                    StatusMsg = CswEnumNbtObjectClass.ContainerClass.Replace("Class", "");
                    first     = false;
                }
                if (_CswNbtResources.Modules.IsModuleEnabled(CswEnumNbtModuleName.IMCS))
                {
                    if (first)
                    {
                        StatusMsg = CswEnumNbtObjectClass.EquipmentClass.Replace("Class", "");
                    }
                    else
                    {
                        StatusMsg += ", " + CswEnumNbtObjectClass.EquipmentClass.Replace("Class", "");
                    }
                    StatusMsg += " or " + CswEnumNbtObjectClass.EquipmentAssemblyClass.Replace("Class", "");
                }
                StatusMsg = "Could not find " + StatusMsg + " with barcode " + OpData.Field2.Value;

                OpData.Field2.StatusMsg       = StatusMsg;
                OpData.Field2.ServerValidated = false;
                OpData.Log.Add(DateTime.Now + " - ERROR: " + StatusMsg);
            }

            return(ret);
        }
예제 #7
0
 public virtual void ValidateFieldTwo(ref OperationData OpData)
 {
     OpData.Field2.ServerValidated = true;
     OpData.Field2.StatusMsg       = "";
     OpData.Field2.Active          = true;
 }
        private bool _validateStatus(ref OperationData OpData)
        {
            bool   ret    = false;
            string status = OpData.Field1.Value;

            Regex  alphNums       = new Regex("[^a-zA-Z0-9]");
            string strippedStatus = alphNums.Replace(status, "");

            Collection <CswNbtMetaDataNodeTypeProp> statusNTPs = new Collection <CswNbtMetaDataNodeTypeProp>();

            CswNbtMetaDataObjectClass     equipmentOC = _CswNbtResources.MetaData.getObjectClass(CswEnumNbtObjectClass.EquipmentClass);
            CswNbtMetaDataObjectClassProp statusOCP   = equipmentOC.getObjectClassProp(CswNbtObjClassEquipment.PropertyName.Status);

            foreach (CswNbtMetaDataNodeTypeProp statusNTP in statusOCP.getNodeTypeProps())
            {
                statusNTPs.Add(statusNTP);
            }

            CswNbtMetaDataObjectClass assemblyOC = _CswNbtResources.MetaData.getObjectClass(CswEnumNbtObjectClass.EquipmentAssemblyClass);

            statusOCP = assemblyOC.getObjectClassProp(CswNbtObjClassEquipmentAssembly.PropertyName.Status);
            foreach (CswNbtMetaDataNodeTypeProp statusNTP in statusOCP.getNodeTypeProps())
            {
                statusNTPs.Add(statusNTP);
            }

            foreach (CswNbtMetaDataNodeTypeProp statusNTP in statusNTPs)
            {
                CswCommaDelimitedString statusOptCDS = new CswCommaDelimitedString();
                statusOptCDS.FromString(statusNTP.DesignNode.getAttributeValueByColumn(CswEnumNbtPropertyAttributeColumn.Listoptions));

                foreach (string candidateStatus in statusOptCDS)
                {
                    if (false == ret)
                    {
                        if (string.Equals(candidateStatus, status, StringComparison.CurrentCultureIgnoreCase))
                        {
                            ret = true;
                            OpData.Field1.Value = candidateStatus;
                        }
                        else
                        {
                            string strippedCandidateStatus = alphNums.Replace(candidateStatus, "");
                            if (strippedStatus.Equals(strippedCandidateStatus, StringComparison.CurrentCultureIgnoreCase))
                            {
                                ret = true;
                                OpData.Field1.Value = candidateStatus;
                            }
                        }
                    }
                }
            }

            if (false == ret)
            {
                OpData.Field1.ServerValidated = false;
                OpData.Field1.StatusMsg       = status + " is not a valid option for a Status Mode scan.";
            }

            return(ret);
        }
예제 #9
0
 public override void SetFields(ref OperationData OpData)
 {
     base.SetFields(ref OpData);
     OpData.Field1.Name = "Container:";
     OpData.Field2.Name = "Quantity:";
 }
예제 #10
0
 public override void ValidateFieldTwo(ref OperationData OpData)
 {
     //Intentionally do nothing here - Open mode only has one field to work with
 }
예제 #11
0
 public override void SetFields(ref OperationData OpData)
 {
     base.SetFields(ref OpData);
     OpData.Field1.Name            = "Container:";
     OpData.Field2.ServerValidated = true;
 }