private void reader_PaymentOk(object sender, ZSTReaderEventArgs e) { ZSTHandlerInfo zst = _HandlerInfoes.SingleOrDefault(item => item.ReaderIP == e.ReaderIP); if (zst != null && zst.ProcessingEvent != null) { if (zst.ProcessingEvent.CardPaymentInfo != null) { zst.ProcessingEvent.CardPaymentInfo.Paid = zst.ProcessingEvent.CardPaymentInfo.Accounts; zst.ProcessingEvent.CardPaymentInfo.Discount = zst.ProcessingEvent.CardPaymentInfo.Accounts - zst.ProcessingEvent.CardPaymentInfo.Paid; zst.ProcessingEvent.CardPaymentInfo.PaymentMode = PaymentMode.ZhongShanTong; zst.ProcessingEvent.CardPaymentInfo.OperatorID = OperatorInfo.CurrentOperator.OperatorName; zst.ProcessingEvent.CardPaymentInfo.StationID = WorkStationInfo.CurrentStation.StationName; zst.ProcessingEvent.CardPaymentInfo.IsCenterCharge = false; CommandResult ret = (new CardBll(AppSettings.CurrentSetting.ParkConnect)).PayParkFee(zst.ProcessingEvent.CardPaymentInfo); } IParkingAdapter pad = ParkingAdapterManager.Instance[zst.ProcessingEvent.ParkID]; if (pad != null) { EventValidNotify n = new EventValidNotify(zst.ProcessingEvent.EntranceID, OperatorInfo.CurrentOperator, WorkStationInfo.CurrentStation.StationName, 0); pad.EventValid(n); } zst.ClearCardInfo(); //清空读卡器内的卡片信息 } }
private void btnCardOk_Click(object sender, EventArgs e) { if (ProcessingEvent != null) { if (ProcessingEvent.PrepayCardExitNeedPay) { //是储值卡出口事件时,需要保存扣费记录 //因为只有在线模式的储值卡确认事件才需要扣费,所以只需要在在线模式储值卡扣费处理就可以了 CommandResult result = SaveCardPayment(ProcessingEvent.CardPaymentInfo, PaymentMode.Prepay); if (result.Result != ResultCode.Successful) { MessageBox.Show(result.Message); return; } } EventValidNotify n = new EventValidNotify(ProcessingEvent.EntranceID, OperatorInfo.CurrentOperator, WorkStationInfo.CurrentStation.StationName, this.txtChargedMoney.DecimalValue); if (ParkingAdapterManager.Instance[ProcessingEvent.ParkID] != null && ParkingAdapterManager.Instance[ProcessingEvent.ParkID].EventValid(n)) { if (this.CardEventProcessed != null) { this.CardEventProcessed(this, new CardEventProcessedArgs(ProcessingEvent, 0)); } this.ucVideoes.Clear(); this.Hide(); } } }
public override bool EventValid(EventValidNotify notify) { EntranceBase entrance = GetEntrance(notify.EntranceID); if (entrance != null && entrance.ProcessingEvent != null) { entrance.Operator = notify.Operator.OperatorName; entrance.Station = notify.Station; if (entrance.ProcessingEvent.IsExitEvent && entrance.ProcessingCard.CardType.IsPrepayCard) //出口事件 { entrance.ProcessingEvent.Balance = entrance.ProcessingEvent.Balance >= notify.Paid ? entrance.ProcessingEvent.Balance - notify.Paid : entrance.ProcessingEvent.Balance; entrance.ProcessingCard.Balance = entrance.ProcessingEvent.Balance; } entrance.CardValid(); if (!entrance.EntranceInfo.CardValidNeedResponse) //设置成事件有效指令不需要硬件返回 { PermitCard(entrance, notify.Operator.OperatorName, notify.Station); //离线模式产生此事件 //if (AppSettings.CurrentSetting.ParkWorkMode == 0 && entrance.ProcessingCard != null) if (WorkMode == ParkWorkMode.OffLine && entrance.ProcessingCard != null) { SaveCard(entrance.ProcessingCard, ActionType.Upate); } } } return(true); }
private void btnCardOk_Click(object sender, EventArgs e) { if (_processingEvent != null) { if (_processingEvent.CardType.IsPrepayCard && txtPaid.DecimalValue <= _processingEvent.Balance) //储值卡且实收小于或等于余额,则只是扣除余额 { if (CheckWriteCard()) { CommandResult result = SaveCardPayment(_processingEvent.CardPaymentInfo, PaymentMode.Prepay); if (result.Result != ResultCode.Successful) { MessageBox.Show(result.Message); return; } } else { return; } } else if (_processingEvent.IsExitEvent && UserSetting.Current.OneKeyOpenDoor) //如果启用一键开闸,则按卡片有效按钮时先要保存卡片费用明细 { if (!btnCashHandle()) { return; } } if (!_processingEvent.ChargeAsTempCard) { //写卡模式并且不是按在线模式处理时需要写入卡片已出场 if (AppSettings.CurrentSetting.EnableWriteCard && _cardInfo != null && !_processingEvent.OnlineHandleWhenOfflineMode) { _cardInfo.IsInPark = false;//标记已出场 CardOperationManager.Instance.WriteCardLoop(_cardInfo); } } EventValidNotify n = new EventValidNotify(_processingEvent.EntranceID, OperatorInfo.CurrentOperator, WorkStationInfo.CurrentStation.StationName, this.txtPaid.DecimalValue); if (ParkingAdapterManager.Instance[_processingEvent.ParkID] != null) { ParkingAdapterManager.Instance[_processingEvent.ParkID].EventValid(n); } if (_cardInfo != null) { CardInfo cardclone = _cardInfo.Clone(); ClearCardEvent(); _cardInfo = cardclone; } else { ClearCardEvent(); } } }
private void btnCardOk_Click(object sender, EventArgs e) { if (ProcessingEvent != null) { EventValidNotify n = new EventValidNotify(ProcessingEvent.EntranceID, OperatorInfo.CurrentOperator, WorkStationInfo.CurrentStation.StationName, this.txtChargedMoney.DecimalValue); if (ParkingAdapterManager.Instance[ProcessingEvent.ParkID] != null && ParkingAdapterManager.Instance[ProcessingEvent.ParkID].EventValid(n)) { if (this.CardEventProcessed != null) { this.CardEventProcessed(this, new CardEventProcessedArgs(ProcessingEvent, 0)); } this.ucVideoes.Clear(); this.Hide(); } } }
public override bool EventValid(EventValidNotify notify) { EntranceBase entrance = GetEntrance(notify.EntranceID); if (entrance != null && entrance.ProcessingEvent != null) { entrance.Operator = notify.Operator.OperatorName; entrance.Station = notify.Station; if (entrance.ProcessingEvent.IsExitEvent && entrance.ProcessingCard.CardType.IsPrepayCard) //出口事件 { entrance.ProcessingEvent.Balance = entrance.ProcessingEvent.Balance >= notify.Paid ? entrance.ProcessingEvent.Balance - notify.Paid : entrance.ProcessingEvent.Balance; } entrance.CardValid(); } return(true); }
public bool EventValid(EventValidNotify notify) { try { if (_Channel != null) { return(_Channel.EventValid(notify)); } } catch (CommunicationException) { if (ParkAdapterConnectFail != null) { ParkAdapterConnectFail(this, EventArgs.Empty); } } catch (Exception ex) { Ralid.GeneralLibrary.ExceptionHandling.ExceptionPolicy.HandleException(ex); } return(false); }
private void btnCardOk_Click(object sender, EventArgs e) { if (_processingEvent != null) { if (_processingEvent.CardType.IsPrepayCard && txtPaid.DecimalValue <= _processingEvent.Balance) //储值卡且实收小于或等于余额,则只是扣除余额 { CommandResult result = SaveCardPayment(_processingEvent.CardPaymentInfo, PaymentMode.Prepay); if (result.Result != ResultCode.Successful) { MessageBox.Show(result.Message); return; } } else if (_processingEvent.IsExitEvent && UserSetting.Current.OneKeyOpenDoor) //如果启用一键开闸,则按卡片有效按钮时先要保存卡片费用明细 { if (!btnCashHandle()) { return; } } EventValidNotify n = new EventValidNotify(_processingEvent.EntranceID, OperatorInfo.CurrentOperator, WorkStationInfo.CurrentStation.StationName, this.txtPaid.DecimalValue); if (ParkingAdapterManager.Instance[_processingEvent.ParkID] != null) { ParkingAdapterManager.Instance[_processingEvent.ParkID].EventValid(n); } if (_cardInfo != null) { CardInfo cardclone = _cardInfo.Clone(); ClearCardEvent(); _cardInfo = cardclone; } else { ClearCardEvent(); } } }