Exemple #1
0
        /// <summary>
        /// 初始化设备信息
        /// </summary>
        public void InitDevInfo(bool isUpgradeFireDev = true)
        {
            Log.Info(LogTags.DbInit, "导入设备信息");
            string filePath = GetBasicDevBackupDir() + "DevInfoBackup.xml";
            bool   value    = DevInfoHelper.ImportDevInfoFromFile(filePath, _bll);

            Log.Info(LogTags.DbInit, string.Format("导入设备信息结果:{0}", value));

            Log.Info(LogTags.DbInit, "导入门禁信息");
            string doorAccessFilePath = GetBasicDevBackupDir() + "DoorAccessBackup.xml";
            bool   valueSub           = DevInfoHelper.ImportDoorAccessInfoFromFile(doorAccessFilePath, _bll);

            Log.Info(LogTags.DbInit, string.Format("导入门禁信息结果:{0}", valueSub));

            Log.Info(LogTags.DbInit, "导入摄像头信息");
            string cameraFilePath = GetBasicDevBackupDir() + "CameraInfoBackup.xml";
            bool   valueCamera    = DevInfoHelper.ImportCameraInfoFromFile(cameraFilePath, _bll);

            Log.Info(LogTags.DbInit, string.Format("导入摄像头信息结果:{0}", valueCamera));

            if (isUpgradeFireDev)
            {
                Log.Info(LogTags.DbInit, "导入消防信息");
                string FireFightDevfilePath = GetBasicDevBackupDir() + "FireFightInfoBackup.xml";
                bool   valueFireFightDev    = DevInfoHelper.ImportFireFightDevInfoFromFile(FireFightDevfilePath, _bll);
                Log.Info(LogTags.DbInit, string.Format("导入设备信息结果:{0}", valueFireFightDev));
            }
        }
        private void InitCameraInfo()
        {
            Log.Info("导入摄像头信息");
            string basePath = AppDomain.CurrentDomain.BaseDirectory;
            string filePath = basePath + "Data\\设备信息\\CameraInfoBackup.xml";
            bool   value    = DevInfoHelper.ImportCameraInfoFromFile(filePath, _bll);

            Log.Info(string.Format("导入摄像头信息结果:{0}", value));
        }