/// <summary> /// /// </summary> public void SetICCardCommPort(ref bool status) { try { if (this._isReSetCommPort) { SendUIMsg(UIMsg.Display, "正在设置IC卡设备的串口号,请稍后......"); InterfaceClass.HN.PublicFunctions.ICCard icCard = new InterfaceClass.HN.PublicFunctions.ICCard(baseInterfaceHN); int port = int.Parse(Alif.DBUtility.PubConstant.GetKeyValue("CommPort")); icCard.SetICCommPort(port); SendUIMsg("设置IC卡设备的串口号成功......"); SendUIMsg(UIMsg.Close); status = true; } } catch (Exception ex) { status = false; SendUIMsg(UIMsg.Close); SendUIMsg(UIMsg.MsgError, ex.Message); } }
/// <summary> /// /// </summary> private void ReadICCard() { try { SendUIMsg(UIMsg.Display, "正在获取IC卡设备信息(请插入IC卡),请稍后......"); InterfaceClass.HN.PublicFunctions.Card card = new InterfaceClass.HN.PublicFunctions.Card(); InterfaceClass.HN.PublicFunctions.ICCard icCard = new InterfaceClass.HN.PublicFunctions.ICCard(baseInterfaceHN); card = icCard.ReadICCard(); SaveICCardInfo(card); Parameter parameter = new Parameter(ReadCardUIMsg.setICCaradInfo, card); SendUIMsg(ReadCardUIMsg.setICCaradInfo, parameter); SendUIMsg(UIMsg.Close); this._CardNumbers = card.CardNo; SendUIMsg(ReadCardUIMsg.closeReadCard); } catch (Exception ex) { SendUIMsg(UIMsg.Close); SendUIMsg(UIMsg.MsgError, ex.Message); } }