Exemple #1
0
        public void UnHandleAlarm()
        {//未处理的报警将其强制曝出
            string         EXEPath   = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
            string         dbPath    = EXEPath + "Demo.db3";
            string         sql       = "select * from AlarmLog where HandleTime is null";
            string         stID      = "";
            string         stAlarmID = "";
            SQLiteDBHelper db        = new SQLiteDBHelper(dbPath);

            using (SQLiteDataReader reader = db.ExecuteReader(sql, null))
            {
                while (reader.Read())
                {
                    stID      = reader["id"].ToString();
                    stAlarmID = reader["AlarmID"].ToString();
                    AlarmDetailForm dlg = new AlarmDetailForm(stID, 1)
                    {
                        StartPosition = FormStartPosition.CenterParent
                    };
                    dlg.ShowDialog();

                    dlg.Dispose();
                }
            }
        }
Exemple #2
0
        static void ReportAlarmInfoThread(object obj)
        {
            Hashtable data = obj as Hashtable;

            if (data.Contains("TYPE") && data.Contains("AlarmID"))
            {
                string Status   = (string)data["TYPE"];
                int    nAlarmID = (int)data["AlarmID"];

                AlarmInfo AlaInfo = new AlarmInfo(nAlarmID);

                AlaInfo.ServerWarningID = PostSever.PostWarningData(nAlarmID);

                string stDBid = DatabaseHandle.RecordAlarmToDB(AlaInfo);

                if (!string.IsNullOrEmpty(stDBid))
                {
                    AlarmDetailForm dlg = new AlarmDetailForm(stDBid, 1)
                    {
                        StartPosition = FormStartPosition.CenterParent
                    };
                    dlg.ShowDialog();

                    dlg.Dispose();
                }
            }
        }
Exemple #3
0
        private void AlarmlistView_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            string stID = AlarmlistView.SelectedItems[0].Text;

            if (!string.IsNullOrEmpty(stID))
            {
                AlarmDetailForm dlg = new AlarmDetailForm(stID, 2)
                {
                    StartPosition = FormStartPosition.CenterParent
                };
                dlg.ShowDialog();

                dlg.Dispose();
            }
        }