Пример #1
0
        private MonitorEndPoint GetMonitorEndPoint(Endpoint endPoint)
        {
            MonitorEndPoint monitEndPoint = new MonitorEndPoint();

            //Fill MonitorEndPoint values
            monitEndPoint.ID       = endPoint.ID;
            monitEndPoint.GUID     = endPoint.GUID;
            monitEndPoint.Title    = endPoint.Title;
            monitEndPoint.KeyPass  = endPoint.KeyPass;
            monitEndPoint.PinCode  = endPoint.PinCode;
            monitEndPoint.cssColor = endPoint.CssColor;

            monitEndPoint.TypeID      = endPoint.TypeID;
            monitEndPoint.TypeTitle   = endPoint.EndPointType.Title;
            monitEndPoint.Measurement = endPoint.EndPointType.measurement;

            monitEndPoint.endPointIOs = db.EndPointIOs.Where(e => e.EndPointID == endPoint.ID).OrderByDescending(e => e.TimeStamp).Take(4).ToList();


            monitEndPoint.LastIOValue     = monitEndPoint.endPointIOs[0].Valu;
            monitEndPoint.LastIOTimeStamp = monitEndPoint.endPointIOs[0].TimeStamp;


            return(monitEndPoint);
        }
Пример #2
0
        private MonitorEndPoint GetMonitorEndPoint(Endpoint endPoint)
        {
            MonitorEndPoint monitEndPoint = new MonitorEndPoint();
            //Fill MonitorEndPoint values
            monitEndPoint.ID = endPoint.ID;
            monitEndPoint.GUID = endPoint.GUID;
            monitEndPoint.Title = endPoint.Title;
            monitEndPoint.KeyPass = endPoint.KeyPass;
            monitEndPoint.PinCode = endPoint.PinCode;
            monitEndPoint.cssColor = endPoint.CssColor;

            monitEndPoint.TypeID = endPoint.TypeID;
            monitEndPoint.TypeTitle = endPoint.EndPointType.Title;
            monitEndPoint.Measurement = endPoint.EndPointType.measurement;

            monitEndPoint.endPointIOs = db.EndPointIOs.Where(e => e.EndPointID == endPoint.ID).OrderByDescending(e => e.TimeStamp).Take(4).ToList();


            monitEndPoint.LastIOValue = monitEndPoint.endPointIOs[0].Valu;
            monitEndPoint.LastIOTimeStamp = monitEndPoint.endPointIOs[0].TimeStamp;


            return monitEndPoint;
        }