private void FrmCardOut_FormClosing(object sender, FormClosingEventArgs e) { CardReaderManager.GetInstance(UserSetting.Current.WegenType).PopCardReadRequest(CardReadHandler); if (_OutCardsWitPark.Keys.Count > 0) { MessageBox.Show(Resource1.FrmCardOut_UpdateVacant); this.Cursor = Cursors.WaitCursor; foreach (ParkInfo park in _OutCardsWitPark.Keys) { bool ret = false; IParkingAdapter pad = ParkingAdapterManager.Instance[park.ParkID]; if (pad != null) { ret = pad.ModifiedVacant(_OutCardsWitPark[park]); } //插入卡片直接出场报警记录,记录增加车位数 AlarmInfo alarm = new AlarmInfo(); alarm.AlarmDateTime = DateTime.Now; alarm.AlarmType = AlarmType.CardOutAnomaly; alarm.OperatorID = OperatorInfo.CurrentOperator.OperatorName; alarm.AlarmDescr = string.Format("[{0}] " + Resource1.FrmCardOut_OutCount + ":[{1}]," + Resource1.FrmCardOut_VacantCount + "[{2}]", park.ParkName, _OutCardsWitPark[park].ToString(), ret ? Resource1.Form_Success : Resource1.Form_Fail); new AlarmBll(AppSettings.CurrentSetting.ParkConnect).Insert(alarm); if (!ret) { this.Cursor = Cursors.Arrow; MessageBox.Show(string.Format("{0} ,{1}", alarm.AlarmDescr, Resource1.FrmCardOut_VacantManual)); this.Cursor = Cursors.WaitCursor; } } this.Cursor = Cursors.Arrow; } }
public bool ModifiedVacant(short vacant) { try { if (_Channel != null) { return(_Channel.ModifiedVacant(vacant)); } } catch (CommunicationException) { if (ParkAdapterConnectFail != null) { ParkAdapterConnectFail(this, EventArgs.Empty); } } catch (Exception ex) { Ralid.GeneralLibrary.ExceptionHandling.ExceptionPolicy.HandleException(ex); } return(false); }