private void AddRepairs(string DeviceId, IEnumerable <XElement> events) { if (events.Count() == 0) { return; } using (var db = new ICMDBContext()) { foreach (var e in events) { eventcommon repair = new eventcommon { action = e.Attribute("action").Value, srcaddr = DeviceId, time = DateTime.Parse(e.Attribute("time").Value), content = e.Attribute("text").Value, type = int.Parse(e.Attribute("type").Value) }; try { db.Eventcommons.Add(repair); db.SaveChangesAsync(); } catch (Exception) { } } } }
public void ShowEditCommonEventDialog(eventcommon eventToBeEdit) { if (eventToBeEdit == null) { return; } }
private bool FilterByAddress(object obj) { eventcommon commonEvent = obj as eventcommon; if (commonEvent != null && commonEvent.srcaddr.StartsWith(AddressFilterValue)) { return(true); } return(false); }
private bool FilterByProcessState(object obj) { eventcommon commonEvent = obj as eventcommon; if (commonEvent != null && (commonEvent.handlestatus == ProcessStateFilterValue)) { return(true); } return(false); }
private bool FilterByEndDate(object obj) { eventcommon commonEvent = obj as eventcommon; if (commonEvent != null && (commonEvent.time.Date <= EndDateFilterValue.Value.Date)) { return(true); } return(false); }