Ejemplo n.º 1
0
        /// <summary>
        /// Event which is raised whenever a connected storage system requests
        /// permission for pack input. The specified request object is used to get further details about
        /// the requested pack input and to allow or deny the pack input.
        /// </summary>
        /// <param name="sender">Object instance which raised the event.</param>
        /// <param name="request">Object which contains the details about the requested pack input.</param>
        static void StorageSystem_PackInputRequested(IStorageSystem sender, IInputRequest request)
        {
            // for now just accept every input request
            foreach (var pack in request.Packs)
            {
                Console.WriteLine("Pack '{0}' requested input via request '{1}' from source '{2}'.", pack.ScanCode, request.Id, request.Source);

                var articleCode = pack.ScanCode;
                if (articleCode.Length < 8)
                {
                    articleCode = articleCode.PadLeft(8, '0');
                }


                // set dummy article information
                pack.SetArticleInformation(articleCode,
                                           string.Format("My Article {0}", articleCode),
                                           "Dosage Form",
                                           "Packaging Unit",
                                           0,
                                           string.Format("Virtual-{0}", articleCode),
                                           string.Format("My Article {0}", articleCode));

                /*/pack.SetVirtualArticleInformation("Virtual_" + pack.ScanCode,
                 *          string.Format("My VirtualArticle {0}", pack.ScanCode),
                 *          "Dosage Form",
                 *          "Packaging Unit");*/


                // allow pack input
                pack.SetHandling(InputHandling.Allowed);
            }

            request.Finish();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Event which is raised whenever a connected storage system requests
        /// permission for pack input. The specified request object is used to get further details about
        /// the requested pack input and to allow or deny the pack input.
        /// </summary>
        /// <param name="sender">Object instance which raised the event.</param>
        /// <param name="request">Object which contains the details about the requested pack input.</param>
        static void StorageSystem_PackInputRequested(IStorageSystem sender, IInputRequest request)
        {
            // for now just accept every input request
            foreach (var pack in request.Packs)
            {
                Console.WriteLine("Pack '{0}' requested input via request '{1}' from source '{2}'.", pack.ScanCode, request.Id, request.Source);

                // set dummy article information
                pack.SetArticleInformation(pack.ScanCode,
                                           string.Format("My Article {0}", pack.ScanCode),
                                           "Dosage Form",
                                           "Packaging Unit");

                pack.SetVirtualArticleInformation("Virtual_" + pack.ScanCode,
                                                  string.Format("My VirtualArticle {0}", pack.ScanCode),
                                                  "Dosage Form",
                                                  "Packaging Unit");

                pack.AddOtherRobotArticleInformation("Bis" + pack.ScanCode,
                                                     string.Format("My other Article {0}", pack.ScanCode),
                                                     "Dosage Form",
                                                     "Packaging Unit");

                pack.AddOtherRobotArticleInformation("Bis2" + pack.ScanCode,
                                                     string.Format("My other second Article {0}", pack.ScanCode),
                                                     "Dosage Form",
                                                     "Packaging Unit");


                // allow pack input
                pack.SetHandling(InputHandling.Allowed);
            }

            request.Finish();
        }
        private void CreateRequest()
        {
            IInputRequest inputRequest = Factory.CreateInputRequest();

            if (_inputMessage.Length == 4)
            {
                inputRequest.Currency = _inputMessage[2];
                inputRequest.Date     = _inputMessage[3];

                Request = inputRequest;
            }
            else
            {
                inputRequest.Currency = _inputMessage[2];
                inputRequest.Date     = _inputMessage[3];
                inputRequest.Country  = _inputMessage[4];

                Request = inputRequest;
            }
        }