| | |
| | | /// </summary>
|
| | | /// <param name="realGateway">真实物理网关对象</param>
|
| | | /// <param name="backupId">备份主键</param>
|
| | | public bool RecoverGateway(ZbGateway realGateway, string backupId)
|
| | | /// <param name="isAutoBack">0:获取网关手动备份文件列表 1:获取网关自动备份文件列表</param>
|
| | | public bool RecoverGateway(ZbGateway realGateway, string backupId, int isAutoBack)
|
| | | {
|
| | | //展开进度条
|
| | | ProgressFormBar.Current.Start();
|
| | | //从云端获取备份文件列表
|
| | | var result = this.GetGatewayFileList(realGateway, backupId);
|
| | | var result = this.GetGatewayFileList(realGateway, backupId, isAutoBack);
|
| | | if (result == false)
|
| | | {
|
| | | //关闭进度条
|
| | |
| | | }
|
| | |
|
| | | //从云端下载备份文件
|
| | | result = this.DownloadGatewayFile(realGateway, backupId);
|
| | | result = this.DownloadGatewayFile(realGateway, backupId, isAutoBack);
|
| | | if (result == false)
|
| | | {
|
| | | //关闭进度条
|
| | |
| | | /// <param name="realGateway"></param>
|
| | | /// <param name="backupClassId"></param>
|
| | | /// <returns></returns>
|
| | | private bool GetGatewayFileList(ZbGateway realGateway, string backupClassId)
|
| | | private bool GetGatewayFileList(ZbGateway realGateway, string backupClassId, int isAutoBack)
|
| | | {
|
| | | //正在获取备份文件列表
|
| | | ProgressFormBar.Current.SetMsg(Language.StringByID(R.MyInternationalizationString.uBackupFileListGetting));
|
| | |
| | | var jObject = new Newtonsoft.Json.Linq.JObject { { "Cluster_ID", 0 }, { "Command", 6202 } };
|
| | | var data = new Newtonsoft.Json.Linq.JObject {
|
| | | { "url", fullUrl }, { "RequestVersion", Common.CommonPage.RequestVersion },
|
| | | { "LoginAccessToken", UserCenterLogic.GetConnectMainToken() }, { "IsGatewayAutoBackup", 0 },
|
| | | { "LoginAccessToken", UserCenterLogic.GetConnectMainToken() }, { "IsGatewayAutoBackup", isAutoBack },
|
| | | { "BackupClassId", backupClassId },{ "GatewayUniqueId",HdlGatewayLogic.Current.GetGatewayId(realGateway)},
|
| | | { "IsOtherAccountCtrl",connectMode == HttpConnectMode.Admin?1:0}
|
| | | };
|
| | |
| | | /// <param name="realGateway"></param>
|
| | | /// <param name="backupClassId"></param>
|
| | | /// <returns></returns>
|
| | | private bool DownloadGatewayFile(ZbGateway realGateway, string backupClassId)
|
| | | private bool DownloadGatewayFile(ZbGateway realGateway, string backupClassId, int isAutoBack)
|
| | | {
|
| | | //正在下载备份文件
|
| | | ProgressFormBar.Current.SetMsg(Language.StringByID(R.MyInternationalizationString.uBackupFileDownloading));
|
| | |
| | | var jObject = new Newtonsoft.Json.Linq.JObject { { "Cluster_ID", 0 }, { "Command", 6203 } };
|
| | | var data = new Newtonsoft.Json.Linq.JObject {
|
| | | { "url", fullUrl }, { "RequestVersion", Common.CommonPage.RequestVersion },
|
| | | { "LoginAccessToken", UserCenterLogic.GetConnectMainToken() }, { "IsGatewayAutoBackup", 0 },
|
| | | { "LoginAccessToken", UserCenterLogic.GetConnectMainToken() }, { "IsGatewayAutoBackup", isAutoBack },
|
| | | { "BackupClassId", backupClassId },{ "GatewayUniqueId",HdlGatewayLogic.Current.GetGatewayId(realGateway)},
|
| | | { "IsOtherAccountCtrl",connectMode == HttpConnectMode.Admin?1:0}
|
| | | };
|