Exemple #1
0
 void irSeialPort_DataReceived(object sender, string e)
 {
     try
     {
         _qrInfo = OnlyQr.ReadData(e, MyMatch.Key);
         if (_qrInfo != null)
         {
             if (!_qrInfo.Value.IdNo.IsNullOrEmpty())
             {
                 BarIdNo = _qrInfo.Value.IdNo;
             }
             //黑名单检查
             if (IsCheckBlack && FaceFun.IsInBlack(BarIdNo))
             {
                 LeftImg.Visibility = Visibility.Visible;
             }
             //校验身份证是否为空
             if (IsCheckIdNo && BarIdNo.IsNullOrEmpty())
             {
                 ShowEventMsg("请录入身份证号码.", MsgType.TipErr); return;
             }
             //白名单校验
             var white = CheckWhite(_qrInfo.Value.IdNo);
             //入场校验
             var session = CheckSession(_qrInfo.Value.TicketNo, false);
             if (white && session)
             {
                 if (MyCapture != null)
                 {
                     //取得人脸识别特征码
                     "拍照获取Photo.".ToSaveLog("");
                     using (var myMap = MyCapture.QueryFrame())
                     {
                         if (myMap != null)
                         {
                             PhotoOk = FaceFun.BitmapToByte(myMap.Bitmap);
                         }
                         else
                         {
                             "未取得摄像头Mat数据".ToSaveLog("OnlyQrView.BarCode_OnKeyUp:");
                         }
                     }
                 }
                 InSession();
             }
         }
         else
         {
             ShowEventMsg("检票失败,解码未通过.", MsgType.FaceErr);
         }
     }
     catch (Exception ex)
     {
         ex.ToSaveLog("BarCode_OnKeyUp:");
     }
 }
Exemple #2
0
        void irSeialPort_DataReceived(object sender, string e)
        {
            try
            {
                _qrInfo = OnlyQr.ReadData(e, MyMatch.Key);
                if (_qrInfo != null)
                {
                    //白名单校验
                    var white = CheckWhite(_qrInfo.Value.IdNo);
                    //入场校验
                    var session = CheckSession(_qrInfo.Value.TicketNo, false);
                    if (white && session)
                    {
                        Dispatcher.Invoke(() =>
                        {
                            MyArea.Text = string.Format("区域:{0}{1}排{2}座", _qrInfo.Value.Area, _qrInfo.Value.Row, _qrInfo.Value.Seat);
                            MyNum.Text  = "票号:" + _qrInfo.Value.TicketNo;
                            MyType.Text = "类型:散票";
                            MyTime.Text = "时间:" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
                        });

                        //取得人脸识别特征码
                        Mat myMap = MyCapture.QueryFrame();
                        if (myMap != null)
                        {
                            PhotoOk = FaceFun.BitmapToByte(myMap.Bitmap);
                        }
                        else
                        {
                            "未取得摄像头Mat数据".ToSaveLog("OnlyQrView.BarCode_OnKeyUp:");
                        }
                    }
                }
                else
                {
                    ShowEventMsg("检票失败,解码未通过.", MsgType.FaceErr);
                }
            }
            catch (Exception ex)
            {
                ex.ToSaveLog("BarCode_OnKeyUp:");
            }
        }