Пример #1
0
 //连接读卡器回调
 private void ConnectReaderResult(bool isSuccess)
 {
     if (!isSuccess)
     {
         this.IsOpenMember = this.IsActiveCard = false;
         IdCardReaderManage.OffCardReader(ReadCardResult, ConnectReaderResult, AuthenticateCardResult);
         MessageBox.Show("请检查读卡器是否连接");
     }
 }
Пример #2
0
        //读卡结果
        private void ReadCardResult(StructCard readCard, bool isSuccess)
        {
            if (readCard != null && isSuccess)
            {
                //激活
                RefreshUIHandle active = new RefreshUIHandle(delegate
                {
                    this.IsActiveCard   = false;
                    UserActiveView view = new UserActiveView(readCard);
                    ToolsManage.ShowForm(view, false);
                });
                //开通会员
                RefreshUIHandle open = new RefreshUIHandle(delegate
                {
                    this.IsOpenMember   = false;
                    OpenMemberView view = new OpenMemberView(readCard);
                    MainViewManage.ShowView(view);
                });

                IdCardReaderManage.RemoveEvent(ReadCardResult, ConnectReaderResult, AuthenticateCardResult);
                if (this.InvokeRequired)
                {
                    if (this.IsOpenMember)
                    {
                        this.Invoke(open);
                    }
                    else if (this.IsActiveCard)
                    {
                        this.Invoke(active);
                    }
                }
                else
                {
                    if (this.IsOpenMember)
                    {
                        open();
                    }
                    else if (this.IsActiveCard)
                    {
                        active();
                    }
                }
            }
            else
            {
                this.IsOpenMember = this.IsActiveCard = false;
                IdCardReaderManage.OffCardReader(ReadCardResult, ConnectReaderResult, AuthenticateCardResult);
                MessageBox.Show("读取身份证信息失败");
            }
        }
Пример #3
0
 protected override void RootUserControlView_Disposed(object sender, EventArgs e)
 {
     IdCardReaderManage.OffCardReader(ReadCardResult, null, null);
     base.RootUserControlView_Disposed(sender, e);
 }