示例#1
0
        public InfoBox LastHourConnectionsStatistics()
        {
            InfoBox result = new InfoBox();

            result.ID    = "InfoBox_LastHourConnections";
            result.Color = InfoBoxColor.success;
            result.Title = "Last Hour Connections";

            List <InfoBoxEntry> entries = new List <InfoBoxEntry>();
            List <Rpt_LastHoursConnections_Result> cons = db.Rpt_LastHoursConnections().ToList();

            InfoBoxEntry entry1 = new InfoBoxEntry();

            entry1.InfoBoxEntryType = InfoBoxEntryType.Text;
            entry1.Title            = "EndPoint IOs";
            entry1.Value            = cons[0].EndPointConnections.ToString();
            entries.Add(entry1);

            InfoBoxEntry entry2 = new InfoBoxEntry();

            entry2.InfoBoxEntryType = InfoBoxEntryType.Text;
            entry2.Title            = "Devices IOs";
            entry2.Value            = cons[0].DeviceConnections.ToString();
            entries.Add(entry2);

            InfoBoxEntry entry3 = new InfoBoxEntry();

            entry3.InfoBoxEntryType = InfoBoxEntryType.Text;
            entry3.Title            = "API Utilisation";
            entry3.Value            = cons[0].APIConnections.ToString();
            entries.Add(entry3);

            result.Entries = entries;
            return(result);
        }