private void ChooseMode(object sender, RoutedEventArgs e) { var btn = sender as Button; if (btn != null) { MyGrid.Children.ClearAll(); TipGrid.Visibility = Visibility.Visible; Mode = IrAdvanced.StringToInt(btn.Tag.ToString(), 1); switch (Mode) { case 1: //身份证人脸识别验证 _faceModel = new FaceIdView(); break; case 2: //身份证人脸识别+年卡验证 _faceModel = new FaceIcView(); break; case 3: //身份证人脸识别+散票验证 _faceModel = new FaceQrView(); break; case 4: //年卡验证,匹配年卡合法且摄像头拍照取证 _faceModel = new OnlyIcView(); break; case 5: //散票验证,匹配散票合法且摄像头拍照取证 _faceModel = new OnlyQrView(); break; case 6: //年卡白名单验证,匹配数据库中照片与前台摄像头照片是否一致 _faceModel = new FaceWhiteIc(); break; case 7: //二维码散票与年卡兼容模式 _faceModel = new OnlyQrOrIc(); break; case 8: //散票白名单验证,匹配数据库中照片与前台摄像头照片是否一致 _faceModel = new FaceWhiteQr(); break; } TxtBox.Text = "测试硬件连接状态.......\n"; if (_faceModel != null) { _faceModel.HardConn += (hardsender, harde) => Dispatcher.Invoke(() => { TxtBox.Text += harde; }); _faceModel.HardCompleted += delegate { Dispatcher.Invoke(() => { IsInit = !TxtBox.Text.Contains("失败"); }); }; _faceModel.TestHard(); } } }
public static int TestMatch() { return(IrAdvanced.StringToInt(MysqlHelper.ExecuteScalar("SELECT count(*) FROM sessions").ToString(), 0)); }