示例#1
0
        static void testRemoveAlarmRecord()
        {
            AlarmRecord alarmRecordDal = new SensorHub.BLL.AlarmRecord();
            List <SensorHub.Model.AlarmRecordInfo> list = new List <SensorHub.Model.AlarmRecordInfo>();

            SensorHub.Model.AlarmRecordInfo record0 = new SensorHub.Model.AlarmRecordInfo();
            record0.DEVICE_CODE      = "112015090042";
            record0.MESSAGE          = "测试报警01";
            record0.ACTIVE           = true;
            record0.DEVICE_ID        = Int32.Parse("113");
            record0.DEVICE_TYPE_NAME = "液位监测仪";
            record0.ITEMNAME         = "液位";
            record0.ITEMVALUE        = "99";
            record0.MESSAGE_STATUS   = 0;
            record0.RECORDCODE       = "";
            record0.RECORDDATE       = System.DateTime.Now;


            SensorHub.Model.AlarmRecordInfo record1 = new SensorHub.Model.AlarmRecordInfo();
            record1.DEVICE_CODE      = "112015090042";
            record1.MESSAGE          = "测试报警01";
            record1.ACTIVE           = true;
            record1.DEVICE_ID        = Int32.Parse("113");
            record1.DEVICE_TYPE_NAME = "液位监测仪";
            record1.ITEMNAME         = "液位";
            record1.ITEMVALUE        = "99";
            record1.MESSAGE_STATUS   = 0;
            record1.RECORDCODE       = "";
            record1.RECORDDATE       = System.DateTime.Now;

            list.Add(record0);
            list.Add(record1);

            alarmRecordDal.insert(list);
        }
示例#2
0
        static void testWSAlarm()
        {
            List <SensorHub.Model.AlarmRecordInfo> alarms = new List <SensorHub.Model.AlarmRecordInfo>();

            //TODO LIST:根据李雨龙需求,修改可能发生的4个报警记录合并为一条报警记录
            // 一氧化碳、硫化氢、氧气、甲烷

            SensorHub.Model.AlarmRecordInfo alarm = new SensorHub.Model.AlarmRecordInfo();
            alarm.RECORDCODE       = "WS_ALARM_H2S_" + DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss_fff");
            alarm.MESSAGE          = "有害气体超标";
            alarm.ITEMNAME         = "FIREGAS";
            alarm.DEVICE_ID        = (int)362;
            alarm.DEVICE_CODE      = "ws2000-201501006";
            alarm.MESSAGE_STATUS   = 0;
            alarm.ACTIVE           = true;
            alarm.DEVICE_TYPE_NAME = "有害气体监测仪";
            string result = "";

            result          = "1,2,3,4";
            alarm.ITEMVALUE = result;
            alarms.Add(alarm);
            new SensorHub.BLL.AlarmRecord().insert(alarms);
        }