| | |
| | | this.ShowProgressBar();
|
| | |
|
| | | //获取app的自动备份
|
| | | var autoData = HdlBackupLogic.Current.GetBackupListNameFromDB(1);
|
| | | var autoData = HdlBackupLogic.Current.GetBackupListNameFromDB(BackUpMode.A自动备份);
|
| | | if (autoData == null)
|
| | | {
|
| | | //关闭进度条
|
| | |
| | | return;
|
| | | }
|
| | | //从云端获取数据
|
| | | var pageData = HdlBackupLogic.Current.GetBackupListNameFromDB();
|
| | | var pageData = HdlBackupLogic.Current.GetBackupListNameFromDB(BackUpMode.A手动备份);
|
| | | if (pageData == null)
|
| | | {
|
| | | //关闭进度条
|
| | |
| | | var listSort = new List<string>();
|
| | | for (int i = 0; i < pageData.Count; i++)
|
| | | {
|
| | | listSort.Add(pageData[i].CreatedOnUtc);
|
| | | dic[pageData[i].CreatedOnUtc] = pageData[i];
|
| | | listSort.Add(pageData[i].ModifyTime);
|
| | | dic[pageData[i].ModifyTime] = pageData[i];
|
| | | }
|
| | | listSort.Sort();
|
| | |
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | txtText.Text = fileInfo.BackupName;
|
| | | txtText.Text = fileInfo.FolderName;
|
| | | }
|
| | | //时间
|
| | | var btnTime = rowLayout.frameTable.AddBottomView("", 600);
|
| | | if (fileInfo.CreatedOnUtc.Length >= 19)
|
| | | if (fileInfo.ModifyTime.Length >= 13)
|
| | | {
|
| | | btnTime.Text = UserCenterLogic.ConvertUtcTimeToLocalTime(fileInfo.CreatedOnUtc).ToString("yyyy.MM.dd HH:mm:ss");
|
| | | btnTime.Text = HdlCommonLogic.Current.ConvertUtcTimeToLocalTime2(fileInfo.ModifyTime).ToString("yyyy.MM.dd HH:mm:ss");
|
| | | }
|
| | | if (addLine == true)
|
| | | {
|
| | |
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | //关闭所有界面
|
| | | UserCenterLogic.CloseAllOpenForm(null, false);
|
| | | HdlFormLogic.Current.CloseAllOpenForm(null, false);
|
| | | //切换到主页
|
| | | UserView.UserPage.Instance.ReFreshControl();
|
| | | });
|
| | |
| | | var result2 = HdlGatewayLogic.Current.ResetComandToBindBackupGateway();
|
| | | if (result2 == false)
|
| | | {
|
| | | //临时这么写,新云端就会写到R文件了
|
| | | this.ShowMassage(ShowMsgType.Tip, "绑定网关失败,请重新上传");
|
| | | //绑定网关失败,请重新上传
|
| | | this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.uBindGatewayFailPleaseUploadAgain));
|
| | | return;
|
| | | }
|
| | | //创建一个备份名字
|
| | | string backupClassId = HdlBackupLogic.Current.CreatNewBackupNameToDB(backName);
|
| | | string backupClassId = HdlBackupLogic.Current.CreatNewBackupNameToDB(backName, BackUpMode.A手动备份);
|
| | | if (backupClassId == null)
|
| | | {
|
| | | //创建备份名字失败
|
| | |
| | | var result2 = HdlGatewayLogic.Current.ResetComandToBindBackupGateway();
|
| | | if (result2 == false)
|
| | | {
|
| | | //临时这么写,新云端就会写到R文件了
|
| | | this.ShowMassage(ShowMsgType.Tip, "绑定网关失败,请重新上传");
|
| | | //绑定网关失败,请重新上传
|
| | | this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.uBindGatewayFailPleaseUploadAgain));
|
| | | return;
|
| | | }
|
| | | int result = HdlAutoBackupLogic.DoUpLoadAutoBackupDataByHand();
|
| | | int result = HdlBackupLogic.Current.DoUpLoadAutoBackupDataByHand();
|
| | | if (result == -1)
|
| | | {
|
| | | //文件上传失败
|
| | |
| | | //开启进度条
|
| | | this.ShowProgressBar();
|
| | |
|
| | | var Pra = new EditorBackUpNamePra();
|
| | | Pra.BackupClassId = BackupClassId;
|
| | | Pra.BackupName = backName;
|
| | | //获取控制主人账号的Token
|
| | | Pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
|
| | |
|
| | | bool result = UserCenterLogic.GetResultStatuByRequestHttps("App/UpdateHomeAppGatewayName", true, Pra);
|
| | | if (result == false)
|
| | | {
|
| | | //编辑备份名称失败
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uEditorBackupNameFail);
|
| | | this.ShowMassage(ShowMsgType.Error, msg);
|
| | | //关闭
|
| | | bool result = HdlBackupLogic.Current.EditorBackupName(BackupClassId, backName);
|
| | | this.CloseProgressBar();
|
| | | return;
|
| | | }
|
| | |
|
| | | if (result == true)
|
| | | {
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | //从云端获取数据
|
| | | this.SetBackupInfoToForm();
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | dialogForm.SetTitleText(Language.StringByID(R.MyInternationalizationString.uEditorBackup));
|
| | | //请输入备份名称
|
| | | dialogForm.SetTipText(Language.StringByID(R.MyInternationalizationString.uPleaseInpuBackupName));
|
| | | dialogForm.Text = fileInfo.BackupName;
|
| | | dialogForm.Text = fileInfo.FolderName;
|
| | |
|
| | | //按下确认按钮
|
| | | dialogForm.ComfirmClickEvent += ((textValue) =>
|
| | |
| | | dialogForm.CloseDialog();
|
| | |
|
| | | //名字一样时,不处理
|
| | | if (textValue != fileInfo.BackupName)
|
| | | if (textValue != fileInfo.FolderName)
|
| | | {
|
| | | //编辑备份名称
|
| | | this.EditorBackInfo(fileInfo.Id, textValue);
|