Exemplo n.º 1
0
        public AlarmDataSet.alarm_logDataTable GetLog(int minutes)
        {
            var alarm_log = new AlarmDataSet.alarm_logDataTable();

            DateTime t   = DateTime.Now.AddMinutes(-minutes);
            var      sql = "select * from alarm_log where datetime >= "
                           + m_server.PortableDateString(t, TimeSeriesDatabase.dateTimeFormat);

            m_server.FillTable(alarm_log, sql);

            return(alarm_log);
        }
Exemplo n.º 2
0
        /// <summary>
        /// determines if there is any asterisk activity
        /// within in a specified number of minutes.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="minutes"></param>
        /// <returns></returns>
        public bool CurrentActivity(int id, int minutes)
        { // look in alarm_log table and check for recent activity
            var alarm_log = new AlarmDataSet.alarm_logDataTable();

            DateTime t   = DateTime.Now.AddMinutes(-minutes);
            var      sql = "select * from alarm_log where datetime >= "
                           + m_server.PortableDateString(t, TimeSeriesDatabase.dateTimeFormat)
                           + " and alarm_phone_queue_id = " + id;

            m_server.FillTable(alarm_log, sql);

            return(alarm_log.Rows.Count > 0);
        }