コード例 #1
0
        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) { }
                }
            }
        }
コード例 #2
0
 public void ShowEditCommonEventDialog(eventcommon eventToBeEdit)
 {
     if (eventToBeEdit == null)
     {
         return;
     }
 }
コード例 #3
0
        private bool FilterByAddress(object obj)
        {
            eventcommon commonEvent = obj as eventcommon;

            if (commonEvent != null && commonEvent.srcaddr.StartsWith(AddressFilterValue))
            {
                return(true);
            }
            return(false);
        }
コード例 #4
0
        private bool FilterByProcessState(object obj)
        {
            eventcommon commonEvent = obj as eventcommon;

            if (commonEvent != null && (commonEvent.handlestatus == ProcessStateFilterValue))
            {
                return(true);
            }
            return(false);
        }
コード例 #5
0
        private bool FilterByEndDate(object obj)
        {
            eventcommon commonEvent = obj as eventcommon;

            if (commonEvent != null && (commonEvent.time.Date <= EndDateFilterValue.Value.Date))
            {
                return(true);
            }
            return(false);
        }