| | |
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | //关闭所有界面
|
| | | UserCenterLogic.CloseAllOpenForm();
|
| | | UserCenterLogic.CloseAllOpenForm(null, false);
|
| | | //切换到主页
|
| | | UserView.UserPage.Instance.ReFreshControl();
|
| | | });
|
| | |
| | | {
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | //绑定还没有成功的网关
|
| | | var result2 = HdlGatewayLogic.Current.ResetComandToBindBackupGateway();
|
| | | if (result2 == false)
|
| | | {
|
| | | //临时这么写,新云端就会写到R文件了
|
| | | this.ShowMassage(ShowMsgType.Tip, "绑定网关失败,请重新上传");
|
| | | return;
|
| | | }
|
| | | //创建一个备份名字
|
| | | string backupClassId = HdlBackupLogic.Current.CreatNewBackupNameToDB(backName);
|
| | | if (backupClassId == null)
|
| | |
| | | {
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | int result = HdlAutoBackupLogic.DoUpLoadAutoBackupData();
|
| | | //绑定还没有成功的网关
|
| | | var result2 = HdlGatewayLogic.Current.ResetComandToBindBackupGateway();
|
| | | if (result2 == false)
|
| | | {
|
| | | //临时这么写,新云端就会写到R文件了
|
| | | this.ShowMassage(ShowMsgType.Tip, "绑定网关失败,请重新上传");
|
| | | return;
|
| | | }
|
| | | int result = HdlAutoBackupLogic.DoUpLoadAutoBackupDataByHand();
|
| | | if (result == -1)
|
| | | {
|
| | | //文件上传失败
|
| | |
| | | #endregion
|
| | |
|
| | | #region ■ 一般方法___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 把本地所有文件移动到自动备份文件夹
|
| | | /// </summary>
|
| | | private void CopyLocationAllFileToAutoBackDirectory()
|
| | | {
|
| | | List<string> listAllFile = Shared.Common.Global.FileListByHomeId();
|
| | |
|
| | | string strroot = Common.Config.Instance.FullPath;
|
| | | string autoPath = System.IO.Path.Combine(strroot, DirNameResourse.LocalMemoryDirectory, DirNameResourse.AutoBackupDirectory);
|
| | | foreach (string file in listAllFile)
|
| | | {
|
| | | //判断是否是应该上传的文件
|
| | | if (HdlBackupLogic.Current.IsNotUpLoadFile(file) == true)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | string sourseName = System.IO.Path.Combine(strroot, file);
|
| | | string newName = System.IO.Path.Combine(autoPath, file);
|
| | | System.IO.File.Copy(sourseName, newName, true);
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 检测备考名称
|