private CardPaymentInfo GetPaymentInfo(CardInfo card, OpenCardEventArgs e, DateTime dt) { CardPaymentInfo ret = null; IParkingAdapter pad = null; EntranceInfo entrance = e.Entrance; if (entrance != null) { pad = ParkingAdapterManager.Instance[entrance.RootParkID]; } else //中央收费,默认使用卡片的入场停车场来扣费 { entrance = ParkBuffer.Current.GetEntrance(card.LastEntrance); if (entrance != null) { pad = ParkingAdapterManager.Instance[entrance.RootParkID]; } else { if (ParkingAdapterManager.Instance != null && ParkingAdapterManager.Instance.ParkAdapters != null) { pad = ParkingAdapterManager.Instance.ParkAdapters[0]; } } } if (pad != null) { ret = pad.CreateCardPaymentRecord(card, card.CarType, dt); } return(ret); }
//public byte GetServerWorkMode() //{ // try // { // if (_Channel != null) // { // return _Channel.GetServerWorkMode(); // } // } // catch (CommunicationException) // { // if (ParkAdapterConnectFail != null) // { // ParkAdapterConnectFail(this, EventArgs.Empty); // } // } // catch (Exception ex) // { // Ralid.GeneralLibrary.ExceptionHandling.ExceptionPolicy.HandleException(ex); // } // return 0xFF; //} //public CardPaymentInfo CreateCardPaymentRecord(CardInfo card, byte carType) //{ // try // { // if (_Channel != null) // { // return _Channel.CreateCardPaymentRecord(card, carType); // } // } // catch (CommunicationException) // { // if (ParkAdapterConnectFail != null) // { // ParkAdapterConnectFail(this, EventArgs.Empty); // } // } // catch (Exception ex) // { // Ralid.GeneralLibrary.ExceptionHandling.ExceptionPolicy.HandleException(ex); // } // return null; //} public CardPaymentInfo CreateCardPaymentRecord(CardInfo card, byte carType, System.DateTime datetime) { try { if (_Channel != null) { return(_Channel.CreateCardPaymentRecord(card, carType, datetime)); } } catch (CommunicationException) { if (ParkAdapterConnectFail != null) { ParkAdapterConnectFail(this, EventArgs.Empty); } } catch (Exception ex) { Ralid.GeneralLibrary.ExceptionHandling.ExceptionPolicy.HandleException(ex); } return(null); }