Beispiel #1
0
        /// <summary>
        /// 进行天线扣款操作
        /// </summary>
        /// <param name="money"></param>
        /// <returns></returns>
        public int DoRSUPay(int money)
        {
            ETCResponse r = RSUOpen();

            if (r != null && r.ErrorCode == 0)
            {
                r = OBUSearch();
            }
            if (r != null && r.ErrorCode == 0)
            {
                r = GetOBUInfo(r as OBUSearchResponse);
            }
            if (r != null && r.ErrorCode == 0)
            {
                ETCPaymentRecord record = null;
                r = RSUWriteCard(r as GetOBUInfoResponse, money, out record);
                if (record != null)
                {
                    r = ListUpLoad(record);
                }
            }
            if (r != null)
            {
                return(r.ErrorCode);
            }
            return(-1);
        }
Beispiel #2
0
        /// <summary>
        /// 进行读卡扣款操作
        /// </summary>
        /// <param name="money"></param>
        /// <returns></returns>
        public int DoReaderPay(int money)
        {
            ETCResponse r = CardReaderOpen();

            if (r != null && r.ErrorCode == 0)
            {
                r = CardSearch();
            }
            if (r != null && r.ErrorCode == 0)
            {
                r = GetCardInfoFromReader(r as CardSearchResponse);
            }
            if (r != null && r.ErrorCode == 0)
            {
                ETCPaymentRecord record = null;
                r = CardReaderWriteCard(r as GetCardInfoResponse, money, out record);
                if (record != null)
                {
                    r = ListUpLoad(record);
                }
            }
            return(r.ErrorCode);
        }