public NewItemPage(CZKEMClass client) { InitializeComponent(); axCZKEM1 = client; BindingContext = this; MobileBarcodeScanningOptions options = new MobileBarcodeScanningOptions(); options.UseFrontCameraIfAvailable = true; var scan = new ZXingScannerPage(options); Navigation.PushAsync(scan); scan.OnScanResult += (result) => { QrCode = result.Text; if (ValidateQrCode()) { axCZKEM1.ACUnlock(1, 5); } }; }
private void Api_OnHIDNum(int CardNumber) { Thread thread = new Thread(() => { try { string strCardNo = CardNumber.ToString(); if (CardNumber < 0) { string str = CardNumber.ToString("x8").PadLeft(8); strCardNo = long.Parse(str, System.Globalization.NumberStyles.HexNumber).ToString(); } if (strCardNo.Length < 3) { return; } short errorFlag = new MenJinService().GetOpenResult(strCardNo, Machine.IP); if (errorFlag == 1) { api.PlayVoiceByIndex(10); } else if (errorFlag == 2) { api.PlayVoiceByIndex(10); api.ACUnlock(Machine.MachineNumber, 200); } } catch (Exception ex) { Logger.Writer.Write(ex); } }); thread.IsBackground = true; thread.Start(); }