Пример #1
0
 private void dispatcherTimerIdReader_Tick(object sender, EventArgs e)
 {
     dispatcherTimerIdReader.Stop();
     if (StationRepository.IsIdCardEnabled)
     {
         if (!IsIdReaderInventoryChecked)
         {
             IdReaderInventory          = CardReader.ReadReaderID();
             IsIdReaderInventoryChecked = true;
             CardReader.RequestReadSN();
         }
         else
         {
             IsIdReaderInventoryChecked = false;
             GetIdReaderInventory();
             CardReader.RequestReadID();
         }
         dispatcherTimerIdReader.Start();
     }
     else
     {
         IsIdReaderConnected = DeviceStatus.STATUS_UNKNOWN;
         IdReaderProducer    = "ID Card Reader is disabled!";
     }
 }
        private void dispatcherTimerIdReader_Tick(object sender, EventArgs e)
        {
            bool result = false;

            dispatcherTimerIdReader.Stop();
            string id = CardReader.ReadReaderID();

            if (id != null)
            {
                if (id.Length > 1)
                {
                    result = true;
                }
            }
            if (result)
            {
                IsIdReaderFound = DeviceStatus.STATUS_OK;
                IdReaderStatus  = String.Format(
                    "{0}\r\n {1}",
                    TranslationProvider.Translate(MultistringTags.TERMINAL_VERIFICATION_ID_CARD_READER),
                    TranslationProvider.Translate(MultistringTags.TERMINAL_VERIFICATION_STATUS_OK)
                    );
                //"ID Card Reader\r\n Status: OK");
            }
            else
            {
                IsIdReaderFound = DeviceStatus.STATUS_NOK;
                IdReaderStatus  = String.Format(
                    "{0}\r\n {1}",
                    TranslationProvider.Translate(MultistringTags.TERMINAL_VERIFICATION_ID_CARD_READER),
                    TranslationProvider.Translate(MultistringTags.TERMINAL_VERIFICATION_STATUS_NOT_FOUND)
                    );
                //IdReaderStatus = "ID Card Reader\r\n Status: Not Found!";
            }
        }
        private void dispatcherTimerIdReader_Tick(object sender, EventArgs e)
        {
            bool result = false;

            dispatcherTimerIdReader.Stop();
            string id = CardReader.ReadReaderID();

            if (id != null)
            {
                if (id.Length > 1)
                {
                    result = true;
                }
            }
            if (result)
            {
                IsIdReaderFound = DeviceStatus.STATUS_OK;
                IdReaderStatus  = "ID Card Reader\r\n Status: OK";
            }
            else
            {
                IsIdReaderFound = DeviceStatus.STATUS_NOK;
                IdReaderStatus  = "ID Card Reader\r\n Status: Not Found!";
            }
        }