/// <summary> /// 退款 /// </summary> private void Refund(CardInfo cardinfo) { bool offlineHandleCard = AppSettings.CurrentSetting.EnableWriteCard && cardinfo != null && !cardinfo.OnlineHandleWhenOfflineMode; APMRefundRecord record = CreateAPMRefundRecord(cardinfo); CardBll _CardBll = new CardBll(AppSettings.CurrentSetting.ParkConnect); bool success = _CardBll.APMCardRefund(cardinfo, record).Result == ResultCode.Successful; if (offlineHandleCard && success) { success = CardOperationManager.Instance.WriteCardLoop(cardinfo) == CardOperationResultCode.Success; if (!success) { //写入失败时,将数据库的卡片退款信息还原 _CardBll.UpdateCardPaymentInfo(_OriginalCard); APMRefundRecordBll recordBll = new APMRefundRecordBll(AppSettings.CurrentSetting.ParkConnect); recordBll.Delete(record); } } if (success) { MessageBox.Show(Resource1.FrmAPMRefund_Success); ClearInput(); } else { MessageBox.Show(Resource1.FrmAPMRefund_Fail); } }