private void OnBiometricReader_StatusUpdate(string message)
        {
            ExtendedLogOnInfo extendedLogOnInfo = new ExtendedLogOnInfo()
            {
                LogOnType = ExtendedLogOnType.Biometric,
                Message   = message
            };

            FireDataReceived(extendedLogOnInfo);
        }
        private void OnMSR_DataReceived(ICardInfo cardInfo)
        {
            ExtendedLogOnInfo extendedLogOnInfo = new ExtendedLogOnInfo()
            {
                LogOnType        = ExtendedLogOnType.MagneticStripeReader,
                LogOnKey         = cardInfo.CardNumber,
                Message          = ApplicationLocalizer.Language.Translate(99409), // Card swipe accepted.
                PasswordRequired = Functions.StaffCardLogOnRequiresPassword
            };

            FireDataReceived(extendedLogOnInfo);
        }
        private void OnBiometricReader_DataReceived(string key, byte[] template)
        {
            ExtendedLogOnInfo extendedLogOnInfo = new ExtendedLogOnInfo()
            {
                LogOnType        = ExtendedLogOnType.Biometric,
                LogOnKey         = key,
                Message          = ApplicationLocalizer.Language.Translate(99413), // Biometric data accepted.
                ExtraData        = template,
                PasswordRequired = false
            };

            FireDataReceived(extendedLogOnInfo);
        }
Example #4
0
        private void numUserId_CardSwept(ICardInfo cardInfo)
        {
            if (Functions.StaffCardLogOn)
            {
                IExtendedLogOnInfo extendedLogOnInfo = new ExtendedLogOnInfo()
                {
                    LogOnKey         = cardInfo.CardNumber,
                    LogOnType        = ExtendedLogOnType.MagneticStripeReader,
                    PasswordRequired = Functions.StaffCardLogOnRequiresPassword
                };

                ProcessExtendedLogOnKey(extendedLogOnInfo);
            }
        }
        private void OnBarcode_DataReceived(IScanInfo scanInfo)
        {
            ExtendedLogOnInfo extendedLogOnInfo = new ExtendedLogOnInfo()
            {
                LogOnType        = ExtendedLogOnType.Barcode,
                LogOnKey         = scanInfo.ScanData,
                Message          = ApplicationLocalizer.Language.Translate(99408), // Bar code accepted.
                PasswordRequired = Functions.StaffBarcodeLogOnRequiresPassword
            };

            FireDataReceived(extendedLogOnInfo);

            // Barcode scanner is auto-disabled, we need to enable again after event.
            barcodeReader.ReEnableForScan();
        }
Example #6
0
        private void OnNumPadEnterButtonPressed()
        {
            if (string.IsNullOrEmpty(this.operatorId))
            {
                //
                // Read operator ID
                //
                if (string.IsNullOrEmpty(this.numUserId.EnteredValue))
                {
                    // Invalid credentials
                    using (frmMessage dialog = new frmMessage(1323, MessageBoxButtons.OK, MessageBoxIcon.Information))
                    {
                        POSFormsManager.ShowPOSForm(dialog);
                    }
                }
                else
                {
                    bool usePassword = true;

                    if (Functions.StaffBarcodeLogOn)
                    {
                        IExtendedLogOnInfo extendedLogOnInfo = new ExtendedLogOnInfo()
                        {
                            LogOnKey         = this.numUserId.EnteredValue,
                            LogOnType        = ExtendedLogOnType.Barcode,
                            PasswordRequired = Functions.StaffBarcodeLogOnRequiresPassword
                        };

                        // First see if this is a extended logon key
                        this.operatorId = PosApplication.Instance.Services.Peripherals.LogOnDevice.Identify(extendedLogOnInfo);

                        // If not found, then give a try to legacy barcode mask approch.
                        if (string.IsNullOrWhiteSpace(operatorId))
                        {
                            IBarcodeInfo barcodeInfo = PosApplication.Instance.Services.Barcode.ProcessBarcode(BarcodeEntryType.ManuallyEntered, this.numUserId.EnteredValue);

                            if (barcodeInfo.InternalType == BarcodeInternalType.Employee)
                            {
                                this.operatorId = barcodeInfo.EmployeeId;
                            }
                        }

                        if (!string.IsNullOrWhiteSpace(operatorId))
                        {
                            usePassword = extendedLogOnInfo.PasswordRequired;
                        }
                    }

                    if (string.IsNullOrWhiteSpace(operatorId))
                    {
                        this.operatorId = this.numUserId.EnteredValue;    //Standard employee id
                    }

                    if (usePassword)
                    {
                        PromptForPassword();
                    }
                    else
                    {
                        ValidateCredentials(ApplicationSettings.Terminal.StoreId, this.operatorId, null);
                    }
                }
            }
            else
            {
                //
                // Read password
                //
                using (SecureString ss = new SecureString())
                {
                    foreach (char c in this.numUserId.EnteredValue)
                    {
                        ss.AppendChar(c);
                    }

                    ss.MakeReadOnly();

                    ValidateCredentials(ApplicationSettings.Terminal.StoreId, this.operatorId, LogonData.ComputePasswordHash(this.operatorId, ss, ApplicationSettings.Terminal.StaffPasswordHashName));
                }
            }
        }