Exemplo n.º 1
0
 /// <summary>
 /// 写IC卡信息
 /// </summary>
 /// <param name="strCardNo">卡号</param>
 /// <param name="strName">姓名</param>
 /// <param name="iMoney">卡余额,单位为角</param>
 /// <param name="iTimes">充值次数</param>
 /// <param name="CardVersion">IC卡格式</param>
 /// <returns></returns>
 public bool ER_WriteCardInfo(string strCardNo, string strName, int iMoney, int iChargeTimes, EnumCardFormat CardFormat)
 {
     StringBuilder sbCardNo = new StringBuilder(strCardNo);
     StringBuilder sbName = new StringBuilder(strName);
     bool res = WriteICCard(this._DevicePort, sbCardNo, sbName, iMoney, iChargeTimes, (int)CardFormat);
     return res;
 }
Exemplo n.º 2
0
 /// <summary>
 /// 读IC卡信息
 /// </summary>
 /// <param name="strCardNo">卡号</param>
 /// <param name="strName">姓名</param>
 /// <param name="iMoney">卡余额,单位为角</param>
 /// <param name="iTimes">充值次数</param>
 /// <param name="iVer">IC卡格式</param>
 /// <returns></returns>
 public bool ER_ReadCardInfo(ref string strCardNo, ref  string strName, ref int iMoney, ref int iChargeTimes, ref EnumCardFormat CardFormat)
 {
     StringBuilder sbCardNo = new StringBuilder();
     StringBuilder sbName = new StringBuilder();
     int iCardType = 0;
     bool res = ReadICCard(this._DevicePort, sbCardNo, sbName, ref iMoney, ref iChargeTimes, ref iCardType);
     strCardNo = sbCardNo.ToString();
     strName = sbName.ToString();
     CardFormat = GetCardVersion(iCardType);
     return res;
 }
Exemplo n.º 3
0
        /// <summary>
        /// 设置机台的管理卡卡号
        /// </summary>
        /// <param name="strManageCardNo"></param>
        /// <returns></returns>
        public bool ER_SetManageCardNo(string strManageCardNo, EnumCardFormat CardVersion)
        {
            if (string.IsNullOrEmpty(strManageCardNo))
            {
                return false;
            }

            if (CardVersion == EnumCardFormat.CARDVER_690CARD)
            {
                if (strManageCardNo.Length > 7)
                {
                    return false;
                }
                strManageCardNo = "EF".PadRight(9, '0') + strManageCardNo.PadLeft(7, '0');
            }

            StringBuilder sbCardNo = new StringBuilder(strManageCardNo);
            return SetManagerCard(this._DevicePort, sbCardNo);
        }
Exemplo n.º 4
0
 /// <summary>
 /// 读取机台的管理卡卡号
 /// </summary>
 /// <returns></returns>
 public string ER_GetManageCardNo(EnumCardFormat CardVersion)
 {
     StringBuilder sbCardNo = new StringBuilder();
     string strCardNo = string.Empty;
     bool res = ReadManagerCard(this._DevicePort, sbCardNo);
     if (res)
     {
         if (CardVersion == EnumCardFormat.CARDVER_690CARD)
         {
             string strCardNoFull = sbCardNo.ToString();
             strCardNo = strCardNoFull.Substring(strCardNoFull.Length - 7, 7);
         }
     }
     return strCardNo;
 }