/// <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)); } }
/// <summary> /// 初始化设备信息 /// </summary> private void InitDevInfo() { Log.Info("导入设备信息"); string basePath = AppDomain.CurrentDomain.BaseDirectory; string filePath = basePath + "Data\\设备信息\\DevInfoBackup.xml"; bool value = DevInfoHelper.ImportDevInfoFromFile(filePath, _bll); Log.Info(string.Format("导入设备信息结果:{0}", value)); Log.Info("导入门禁信息"); string doorAccessFilePath = basePath + "Data\\设备信息\\DoorAccessBackup.xml"; bool valueSub = DevInfoHelper.ImportDoorAccessInfoFromFile(doorAccessFilePath, _bll); Log.Info(string.Format("导入门禁信息结果:{0}", valueSub)); }