private void AddCalls(string DeviceId, IEnumerable <XElement> events) { if (events.Count() == 0) { return; } using (var db = new ICMDBContext()) { foreach (var e in events) { eventcallout call = new eventcallout { from = DeviceId, to = e.Attribute("to").Value, type = 2, time = DateTime.Parse(e.Attribute("time").Value), action = e.Attribute("action").Value }; try { db.Eventcallouts.Add(call); db.SaveChangesAsync(); } catch (Exception) { } } } }
private bool FilterByDstAddress(object obj) { eventcallout callOutEvent = obj as eventcallout; if (callOutEvent != null && (callOutEvent.to.StartsWith(this.DstAddressFilterValue))) { return(true); } return(false); }
private bool FilterByEndDate(object obj) { eventcallout @event = obj as eventcallout; if (@event != null && (@event.time.Date <= EndDateFilterValue.Value.Date)) { return(true); } return(false); }