示例#1
0
        /// <summary>
        /// 市民卡检票
        /// </summary>
        /// <param name="no"></param>
        /// <returns></returns>
        private void VerifyTicketByCardNo(string cardNo)
        {
            var vTicket = new VerifyTicket()
            {
                gateId        = Config.GateName,
                citizenCard   = cardNo,
                isfingerprint = "1"
            };

            var apiResult = VerifyTicketHelper.VerifyTicket(vTicket, Config.WebUrl);

            if (apiResult == null)
            {
                MessageBox.Show("没有获取到服务端的返回数据", "网络异常");
                return;
            }

            if (apiResult.flag)
            {
                var person = VerifyTicketHelper.GetCitizenCardPerson(cardNo, Config.WebUrl);
                ShowCardInfo(cardNo
                             , apiResult.oData
                             , person == null ? new CitizenCardPerson() : person.oData);
            }
            else
            {
                if (string.IsNullOrEmpty(apiResult.msg))
                {
                    apiResult.msg = "检票失败";
                }

                ShowCardMessage(apiResult.msg);
            }
        }
示例#2
0
        /// <summary>
        /// 检票
        /// </summary>
        /// <param name="no"></param>
        /// <returns></returns>
        private TicketInfo VerifyTicketByTicketNo(string no, out bool isVerifyTicketSuccess)
        {
            isVerifyTicketSuccess = false;
            if (string.IsNullOrEmpty(no))
            {
                MessageBox.Show("没有读取到票号信息", "扫码异常");
                return(null);
            }

            var vTicket = new VerifyTicket()
            {
                gateId   = Config.GateName,
                ticketNo = no
            };

            var apiResult = VerifyTicketHelper.VerifyTicket(vTicket, Config.WebUrl);

            if (apiResult == null)
            {
                MessageBox.Show("没有获取到服务端的返回数据", "网络异常");
                return(null);
            }

            isVerifyTicketSuccess = apiResult.flag;
            return(GetTicketInfo(apiResult));
        }