Exemple #1
0
        //启动时,设备全部显示离线
        #region 2015-8-7 每次启动时,将登陆状态置为0
        void installDeviceState()
        {
            try
            {
                BaseModule.LoadBaseInfo();
                CardUserModule.LoadCardUsers();
                DistrictModule.UpdateLevelInfo();
                DistrictModule.UpdateDistrictInfo();

                //将在线状态置为0
                DeviceModule.SetOnline0();

                DeviceModule.LoadDevices();

                /*
                 * IList<Device> deviceList = DeviceModule.GetAllDevice();
                 *
                 * foreach (Device d in deviceList)
                 * {
                 *  if (d.Online == 1)
                 *  {
                 *      d.Online = 0;
                 *      DeviceModule.ModifyDevice(d);
                 *  }
                 * }
                 * */

                AlarmService.Init();
                int alarmCount = AlarmService.GetCount();
                //logHelper.Info("程序启动报警数量为:" + alarmCount);
                ShowLogData.add("程序启动报警数量为:" + alarmCount);
            }
            catch (Exception e)
            {
                if (showErrorLog)
                {
                    string error = string.Format("在将设备登陆状态置为0时,读取数据库时出错,错误信息{0}", e.Message);
                    logHelper.Error(error);
                }
            }
            finally
            {
            }
        }