public void Save(HotListsDataEvent hotlist, StringHandler msgCallback) { this.msgCallback = msgCallback; try { this.Save(hotlist); } finally { this.msgCallback = null; } }
protected override void OnInitialized() { long[] ids = this.SelectIDs(); if (ids != null) { foreach (long id in ids) { HotListsDataEvent ev = (HotListsDataEvent)this.SelectByID(id); //PIPS.Logger.WriteLine(false, "HotListsDataTable.Init({0}, {1})", ev.Name, ev.Alarm); this.hotlists[ev.ID] = new PIPS.PAGIS.Db.HotLists.HotList(this.DataFile.DataRepository.DataDirectory + "\\" + ev.ID.ToString()); } } this.hotlists[(long)0] = new PIPS.PAGIS.Db.HotLists.HotList(this.DataFile.DataRepository.DataDirectory + "\\0"); base.OnInitialized(); }
private long CreateManualReports() { HotListsDataEvent manualReports = this.CreateHotListsDataEvent(); manualReports.DisplayColor = Color.Blue; manualReports.Alarm = "MED"; manualReports.Name = "Manual Reports"; manualReports.Priority = 500; manualReports.IsActive = true; manualReports.IsCovert = false; manualReports.SourceFile = string.Empty; manualReports.Timestamp = DateTime.Now; manualReports.IsWhitelist = false; manualReports.Alerting = true; this.Save(manualReports); return(manualReports.ID); }
private HitsDataEvent CopyWhitelistToHit(long hotlist_id, ReadsDataEvent read) { HitsDataEvent hit = (this.DataFile.DataRepository as SystemRepository).Events.Reads.Hits.CreateHitsDataEvent(); HotListsDataEvent hl = this.SelectByID(hotlist_id) as HotListsDataEvent; hit.Alarm = hl.Alarm; hit.DisplayColor = hl.DisplayColor; hit.Field1 = string.Empty; hit.Field2 = string.Empty; hit.Field3 = string.Empty; hit.Field4 = string.Empty; hit.Field5 = string.Empty; hit.HotList = hl.Name; hit.Information = string.Empty; hit.IsCovert = hl.IsCovert; hit.PNCID = string.Empty; hit.Priority = hl.Priority; hit.VRM = read.VRM; hit.Alerting = hl.Alerting; return(hit); }
private HitsDataEvent CopyHotlistToHit(long hotlist_id, HotListDataEvent hotlist) { HitsDataEvent hit = (this.DataFile.DataRepository as SystemRepository).Events.Reads.Hits.CreateHitsDataEvent(); HotListsDataEvent hl = this.SelectByID(hotlist_id) as HotListsDataEvent; hit.Alarm = hl.Alarm; hit.DisplayColor = hl.DisplayColor; hit.Field1 = hotlist.Field1; hit.Field2 = hotlist.Field2; hit.Field3 = hotlist.Field3; hit.Field4 = hotlist.Field4; hit.Field5 = hotlist.Field5; hit.HotList = hl.Name; hit.Information = hotlist.Information; hit.IsCovert = hl.IsCovert; hit.PNCID = hotlist.PNCID; hit.Priority = hl.Priority; hit.VRM = hotlist.VRM; hit.Alerting = hl.Alerting; return(hit); }
public List <string> ProcessRead(string read) { List <string> result_text = new List <string>(); DateTime start = DateTime.Now; ArrayList results = new ArrayList(); long[] ids = this.SelectIDsWhere("active = 'True' and whitelist = 'False'", "priority", true); #if DEBUG ids = new long[] { 7 }; #endif if (ids != null) { string vrm = this.FuzzyFilter.Filter(read); for (int i = 0; i < ids.Length; i++) { try { results.Add(this.GetHotlist(ids[i]).BeginFindVrm(vrm)); } catch (Exception ex) { //PIPS.Logger.Exception(ex); results.Add(null); } } for (int i = 0; i < ids.Length; i++) { try { if (results[i] != null) { IAsyncResult result = results[i] as IAsyncResult; DataEventCollection vrms = this.GetHotlist(ids[i]).EndFindVrm(result); foreach (PIPS.PAGIS.Db.HotLists.HotListDataEvent hotlist in vrms) { HotListsDataEvent hl = this.SelectByID(ids[i]) as HotListsDataEvent; result_text.Add( ids[i].ToString() + "|" + //HL id hl.Alarm + "|" + hl.DisplayColor + "|" + hotlist.Field1 + "|" + hotlist.Field2 + "|" + hotlist.Field3 + "|" + hotlist.Field4 + "|" + hotlist.Field5 + "|" + hl.Name + "|" + hotlist.Information + "|" + hl.IsCovert + "|" + hotlist.PNCID + "|" + hl.Priority + "|" + hotlist.VRM + "|" + hl.Alerting); } } } catch (Exception ex) { //PIPS.Logger.Exception(ex); } } } //PIPS.Logger.WriteLine("HotListsDataTable.ProcessRead({0})", (DateTime.Now - start).TotalMilliseconds); return(result_text); }