/// <summary> /// 读卡按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnRead_Click(object sender, EventArgs e) { if (!connDev) { api.ConnectUsbDev(); } Thread th = new Thread(new ThreadStart(api.GetCardNoAndID)); th.Start(); }
public FormExchange(DataRow _row, CardApi _api) { InitializeComponent(); api = _api; row = _row; api.OnConnOK += lib_OnConnOK; api.OnDisConn += lib_OnDisConn; api.OnSendMessage += lib_OnSendMessage; api.OnReadCard += lib_OnReadCardNo; if (!FormMain.connDev) { api.ConnectUsbDev(); } Thread th = new Thread(new ThreadStart(ReadCard)); th.Start(); }
/// <summary> /// 编辑(包括绑定与解绑) /// </summary> /// <param name="_row"></param> public FormMerchant(DataRow _row, CardApi _api, FormMain _formMain) { InitializeComponent(); formMain = _formMain; api = _api; api.OnConnOK += lib_OnConnOK; api.OnDisConn += lib_OnDisConn; api.OnSendMessage += lib_OnSendMessage; api.OnReadCard += lib_OnReadCardNo; row = _row; merchantID = _row["id"].ToString(); label1.Visible = false; btnRead.Enabled = true; btnUnBinding.Enabled = true; btnBinding.Enabled = false; op = Operation.编辑; if (!FormMain.connDev) { api.ConnectUsbDev(); } }