void card_mgr_OnAlarmEvent(CardReader.ICardReader reader, AlarmData alarmdata) { try{ Console.WriteLine("DispatchAlarm!"); DispatchAlarmEvent(alarmdata); } catch(Exception ex){ Console.WriteLine(ex.Message + "," + ex.StackTrace); } //throw new NotImplementedException(); }
public void DispatchAlarmEvent(AlarmData alarmdata) { try { foreach (RegisterInfo info in dictClientCallBacks.Values.ToArray()) { if (info.IsRegistAlarm) { Console.WriteLine("Call back!"); info.CallBack.SecureAlarm(alarmdata); } } } catch (Exception ex) { Console.WriteLine(ex.Message + "," + ex.StackTrace); ;} }
void CheckCardNotReturnTask() { SecureDBEntities1 db = new SecureDBEntities1(); int cnt= (from n in db.tblMagneticCard where n.ReturnDate == null && n.CardEndDate < DateTime.Now select n).Count(); if (cnt > 0) { AlarmData adata = new AlarmData() { AlarmType = AlarmType.CARD, TimeStamp = DateTime.Now, Description = "卡片未歸還警報", ColorString = "Orange", IsForkCCTVEvent=false, PlaneID=-1 } ; DispatchAlarmEvent(adata); } }