/// <summary> /// 读卡成功操作 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void ObjCardReader_CardNoGeted(object sender, SeatManage.ISystemTerminal.IPOS.CardEventArgs e) { StopRead(); //操作 if (!string.IsNullOrEmpty(e.CardNo)) { SeatManage.SeatManageComm.WriteLog.Write(e.CardNo); Dispatcher.Invoke(new Action(() => { WPFMessage.MessageHelper.SendMessage(viewModel.ClientObject.MediaClient, SeatManage.EnumType.SendClentMessageType.OnLock); if (Height == 1000) { Top = 920; } //if (e.CardNo == "juneberryclose") //{ // WPFMessage.MessageHelper.SendMessage(viewModel.ClientObject.LauncherClient, SeatManage.EnumType.SendClentMessageType.Close); // this.Close(); //} viewModel.PosCardHandle(e.CardNo); WPFMessage.MessageHelper.SendMessage(viewModel.ClientObject.MediaClient, SeatManage.EnumType.SendClentMessageType.Normal); })); } StartRead(); }
private void ObjCardReader_CardNoGeted(object sender, SeatManage.ISystemTerminal.IPOS.CardEventArgs e) { StopRead(); if (!string.IsNullOrEmpty(e.CardNo)) { Dispatcher.Invoke(new Action(() => { viewModel.CardNo = e.CardNo; string AESCode = string.Format("schoolNo={0}&clientNo={1}&cardNo={2}", viewModel.ClientObject.ClientSetting.ClientNo.Substring(0, viewModel.ClientObject.ClientSetting.ClientNo.Length - 2), viewModel.ClientObject.ClientSetting.ClientNo, e.CardNo); Bitmap bitmap = QRCode.GetDimensionalCode(AESAlgorithm.AESEncrypt(AESCode, "SeatManage_WeiCharCode"), 6, 8); IntPtr hBitmap = bitmap.GetHbitmap(); BitmapSource bitmapImage = new BitmapImage(); try { bitmapImage = Imaging.CreateBitmapSourceFromHBitmap(hBitmap, IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); } finally { DeleteObject(hBitmap); } imgCode.Fill = new ImageBrush(bitmapImage); })); } else { SeatManage.SeatManageComm.WriteLog.Write("读卡出现错误:" + e.ErrorInfo); } //System.Threading.Thread.Sleep(2000); StartRead(); }
void POS_CardNoGeted(object sender, SeatManage.ISystemTerminal.IPOS.CardEventArgs e) { if (e.PosResult == true) { this.Invoke(new Action(() => { this.label1.Text = "学号:" + e.CardNo; })); } }
void ObjCardReader_CardNoGeted(object sender, SeatManage.ISystemTerminal.IPOS.CardEventArgs e) { StopRead(); if (!string.IsNullOrEmpty(e.CardNo)) { Dispatcher.Invoke(new Action(() => { GetLogs(e.CardNo); })); } StartRead(); }
/// <summary> /// 读卡成功操作 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void ObjCardReader_CardNoGeted(object sender, SeatManage.ISystemTerminal.IPOS.CardEventArgs e) { clientObject.ObjCardReader.Stop(); //操作 if (!string.IsNullOrEmpty(e.CardNo)) { this.Dispatcher.Invoke(new Action(() => { viewModel.PosCardHandle(e.CardNo); })); } clientObject.ObjCardReader.Start(); }
/// <summary> /// 读卡器读到卡 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void ObjCardReader_CardNoGeted(object sender, SeatManage.ISystemTerminal.IPOS.CardEventArgs e) { viewModel.Clientobject.ObjCardReader.Stop(); if (e.PosResult) { this.Dispatcher.Invoke(new Action(() => { viewModel.OperateResule = SeatManage.EnumType.HandleResult.Successed; viewModel.CardNo = e.CardNo; this.Close(); })); } else { SeatManage.SeatManageComm.WriteLog.Write("读卡出现错误:" + e.ErrorInfo); } System.Threading.Thread.Sleep(2000); viewModel.Clientobject.ObjCardReader.Start(); }
/// <summary> /// 读卡器读到卡 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void ObjCardReader_CardNoGeted(object sender, SeatManage.ISystemTerminal.IPOS.CardEventArgs e) { StopRead(); if (e.PosResult) { Dispatcher.Invoke(new Action(() => { ViewModel.OperateResule = HandleResult.Successed; ViewModel.CardNo = e.CardNo; WinClosing(); })); } else { SeatManage.SeatManageComm.WriteLog.Write("读卡出现错误:" + e.ErrorInfo); } System.Threading.Thread.Sleep(2000); StartRead(); }
/// <summary> /// 读卡成功操作 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void ObjCardReader_CardNoGeted(object sender, SeatManage.ISystemTerminal.IPOS.CardEventArgs e) { StopRead(); timeLoop.TimeTo -= new EventHandler(timeLoop_TimeTo); timeLoop.TimeStop(); IsWork = false; count = int.Parse(System.Configuration.ConfigurationManager.AppSettings["ReadCardCount"].ToString()); StopRead(); this.btnGetNo_Copy.Dispatcher.Invoke( new Action( delegate { btnGetNo_Copy.Content = "点击刷卡"; } ) ); //操作 if (!string.IsNullOrEmpty(e.CardNo)) { Dispatcher.Invoke(new Action(() => { WPFMessage.MessageHelper.SendMessage(viewModel.ClientObject.MediaClient, SeatManage.EnumType.SendClentMessageType.OnLock); if (Height == 1000) { Top = 920; } //if (e.CardNo == "juneberryclose") //{ // WPFMessage.MessageHelper.SendMessage(viewModel.ClientObject.LauncherClient, SeatManage.EnumType.SendClentMessageType.Close); // this.Close(); //} viewModel.PosCardHandle(e.CardNo); WPFMessage.MessageHelper.SendMessage(viewModel.ClientObject.MediaClient, SeatManage.EnumType.SendClentMessageType.Normal); })); } // StartRead(); }