Example #1
0
 //强制删除卡片
 private bool DeletingCardAtAll(CardInfo info)
 {
     try
     {
         CommandResult ret = bll.DeleteCardAtAll(info);
         if (ret.Result == ResultCode.Successful)
         {
             if (DataBaseConnectionsManager.Current.StandbyConnected)
             {
                 CardBll standbybll = new CardBll(AppSettings.CurrentSetting.CurrentStandbyConnect);
                 standbybll.DeleteCardAtAll(info);
             }
             //foreach (ParkingAdapter pad in ParkingAdapterManager.Instance.ParkAdapters)
             //{
             //    pad.DeleteCard(info);
             //}
             return(true);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     return(false);
 }
Example #2
0
 public void HandleCardEvent(CardEventReport report)
 {
     GlobalSettings.Current.Get <Dictionary <int, CardEventReport> >()[report.EntranceID] = report; //
     if (report.EventStatus != CardEventStatus.Valid)
     {
         return;
     }
     if (report.CardType != null && (report.CardType.Name == YiTingShanFuSetting.CardType || report.CardType.Name == YCT.YCTSetting.CardTyte || report.CardType.Name == ETC.ETCSetting.CardTyte)) //
     {
         if (report.IsExitEvent)                                                                                                                                                                  //出场后,将开放卡片从系统中删除
         {
             CardBll  bll  = new CardBll(AppSettings.CurrentSetting.MasterParkConnect);
             CardInfo card = bll.GetCardByID(report.CardID).QueryObject;
             if (card != null && (card.ParkingStatus & ParkingStatus.Out) == ParkingStatus.Out) //只有在卡片已经出场的情况下才删除它
             {
                 bll.DeleteCardAtAll(card);
             }
         }
     }
 }