Пример #1
0
        private bool GetCoinValidatorInventory()
        {
            bool result = false;

            try
            {
                List <Nbt.Services.Scf.CashIn.DeviceInfo> list = StationSettings.GetDeviceInventoryList();

                if (list != null)
                {
                    foreach (Nbt.Services.Scf.CashIn.DeviceInfo di in list)
                    {
                        if (di.device_type == Nbt.Services.Scf.CashIn.DeviceType.COIN_ACCEPTOR)
                        {
                            CoinValidatorProducer    = di.device_producer;
                            CoinValidatorModel       = di.device_model;
                            CoinValidatorSN          = di.device_serial_number;
                            CoinValidatorFW          = di.device_firmware_version;
                            IsCoinValidatorConnected = true;

                            return(true);
                        }
                    }
                }
                coin_di.Clone(CoinValidator.GetInventoryData());

                if (coin_di != null)
                {
                    IsCoinValidatorConnected = coin_di.IsInitialized;
                    CoinValidatorProducer    = coin_di.ManufacturerID;
                    CoinValidatorModel       = coin_di.ProductCode;
                    CoinValidatorSN          = coin_di.SerialNumber;
                    CoinValidatorFW          = coin_di.SW_Version;
                    if (IsCoinValidatorConnected)
                    {
                        result = true;
                    }
                }
                else
                {
                    IsCoinValidatorConnected = false;
                }
            }
            catch
            {
            }

            return(result);
        }
Пример #2
0
        private bool GetCashValidatorInventory()
        {
            bool result = false;

            // after over devices will be added, refactoring is needed!!!

            try
            {
                List <Nbt.Services.Scf.CashIn.DeviceInfo> list = StationSettings.GetDeviceInventoryList();

                if (list != null)
                {
                    foreach (Nbt.Services.Scf.CashIn.DeviceInfo di in list)
                    {
                        if (di.device_type == Nbt.Services.Scf.CashIn.DeviceType.BILL_VALIDATOR)
                        {
                            BillValidatorProducer    = di.device_producer;
                            BillValidatorModel       = di.device_model;
                            BillValidatorSN          = di.device_serial_number;
                            BillValidatorFW          = di.device_firmware_version;
                            IsCashValidatorConnected = DeviceStatus.STATUS_OK;

                            return(true);
                        }
                    }
                }

                cash_di.Clone(CashValidator.GetInventoryData());
                if (!CashValidator.IsDataSetValid())
                {
                    IsCashValidatorConnected = DeviceStatus.STATUS_UNKNOWN;
                }

                if (cash_di != null)
                {
                    BillValidatorProducer = cash_di.ManufacturerID;
                    BillValidatorModel    = cash_di.ProductCode;
                    BillValidatorSN       = cash_di.SerialNumber;
                    BillValidatorFW       = cash_di.SW_Version;
                    if (CashValidator.IsDataSetValid())
                    {
                        if (cash_di.IsInitialized && cash_di.BillOperationMode != 3)
                        {
                            IsCashValidatorConnected = DeviceStatus.STATUS_OK;
                            result = true;
                        }
                        else
                        {
                            IsCashValidatorConnected = DeviceStatus.STATUS_NOK;
                        }
                    }
                }
                else if (CashValidator.IsDataSetValid())
                {
                    IsCashValidatorConnected = DeviceStatus.STATUS_NOK;
                }
            }
            catch
            {
            }

            return(result);
        }
        private bool GetCashValidatorInventory()
        {
            bool result = false;
            bool coin_acceptor_detected  = false;
            bool bill_validator_detected = false;


            try
            {
                List <Nbt.Services.Scf.CashIn.DeviceInfo> list = StationSettings.GetDeviceInventoryList();

                if (list != null)
                {
                    foreach (Nbt.Services.Scf.CashIn.DeviceInfo di in list)
                    {
                        if (di.device_type == Nbt.Services.Scf.CashIn.DeviceType.BILL_VALIDATOR)
                        {
                            BillValidatorProducer = di.device_producer;
                            BillValidatorModel    = di.device_model;
                            BillValidatorSN       = di.device_serial_number;
                            BillValidatorFW       = di.device_firmware_version;

                            if (StationSettings.IsCashDatasetValid())
                            {
                                IsCashValidatorConnected = DeviceStatus.STATUS_OK;
                            }
                            else
                            {
                                IsCashValidatorConnected = DeviceStatus.STATUS_UNKNOWN;
                            }

                            bill_validator_detected = true;
                        }
                        else if (di.device_type == Nbt.Services.Scf.CashIn.DeviceType.COIN_ACCEPTOR)
                        {
                            CoinValidatorProducer    = di.device_producer;
                            CoinValidatorModel       = di.device_model;
                            CoinValidatorSN          = di.device_serial_number;
                            CoinValidatorFW          = di.device_firmware_version;
                            IsCoinValidatorConnected = true;

                            coin_acceptor_detected = true;
                        }
                    }
                }
            }
            catch
            {
            }
            if (!bill_validator_detected)
            {
                BillValidatorProducer    = String.Empty;
                BillValidatorModel       = String.Empty;
                BillValidatorSN          = String.Empty;
                BillValidatorFW          = String.Empty;
                IsCashValidatorConnected = DeviceStatus.STATUS_NOK;
            }
            if (!coin_acceptor_detected)
            {
                CoinValidatorProducer    = String.Empty;
                CoinValidatorModel       = String.Empty;
                CoinValidatorSN          = String.Empty;
                CoinValidatorFW          = String.Empty;
                IsCoinValidatorConnected = false;
            }

            return(result);
        }