黄学彪
2020-09-18 c7df85937f73fb347ee0b19e9c052d2d00a6df6c
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs
@@ -147,12 +147,11 @@
                    return null;
                }
                //将输入写入本地的临时文件夹
                HdlFileLogic.Current.SaveTextToFile(System.IO.Path.Combine(newDir, fileName), System.Text.Encoding.UTF8.GetString(result));
                HdlFileLogic.Current.SaveByteToFile(System.IO.Path.Combine(newDir, fileName), result);
                //设置进度值
                ProgressFormBar.Current.SetValue(i + 1, listFileCount);
            }
            //关闭进度条
            ProgressFormBar.Current.Close();
            //允许按系统的返回键
            Shared.Common.CommonPage.BackKeyCanClick = true;
            UserCenterResourse.AccountOption.AppCanSignout = true;
@@ -242,6 +241,7 @@
            List<string> listAllFile = null;
            //文件夹的全路径
            string fullDir = string.Empty;
            string localTemplateName = string.Empty;
            if (upPath == string.Empty)
            {
                //将模板数据保存到到指定的文件夹中
@@ -249,7 +249,8 @@
                var templateFile = TemplateData.TemplateCommonLogic.Current.SaveTemplateDataToFile(templateName, "HomeTemplate");
                //将模板bin文件移动到备份文件夹中
                try { System.IO.File.Move(templateFile, System.IO.Path.Combine(Config.Instance.FullPath, templateName)); }
                localTemplateName = System.IO.Path.Combine(Config.Instance.FullPath, templateName);
                try { System.IO.File.Move(templateFile, localTemplateName); }
                catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex, "移动模板失败"); }
                //获取本地文件
@@ -289,7 +290,7 @@
            }
            //开启进度条
            int listFileCount = listAllFile.Count;
            int listFileCount = listPicFile.Count + listNormalFile.Count;
            if (showBar == true)
            {
                //开启进度条 正在上传备份文件
@@ -314,6 +315,11 @@
                    //允许按系统的返回键
                    Shared.Common.CommonPage.BackKeyCanClick = true;
                    UserCenterResourse.AccountOption.AppCanSignout = true;
                    if (localTemplateName != string.Empty)
                    {
                        //删除掉这个模板文件
                        HdlFileLogic.Current.DeleteFile(localTemplateName);
                    }
                    return false;
                }
                //整理数据
@@ -334,6 +340,11 @@
                    //允许按系统的返回键
                    Shared.Common.CommonPage.BackKeyCanClick = true;
                    UserCenterResourse.AccountOption.AppCanSignout = true;
                    if (localTemplateName != string.Empty)
                    {
                        //删除掉这个模板文件
                        HdlFileLogic.Current.DeleteFile(localTemplateName);
                    }
                    return false;
                }
                //设置进度值
@@ -351,6 +362,11 @@
                    //允许按系统的返回键
                    Shared.Common.CommonPage.BackKeyCanClick = true;
                    UserCenterResourse.AccountOption.AppCanSignout = true;
                    if (localTemplateName != string.Empty)
                    {
                        //删除掉这个模板文件
                        HdlFileLogic.Current.DeleteFile(localTemplateName);
                    }
                    return false;
                }
@@ -366,10 +382,21 @@
                    //允许按系统的返回键
                    Shared.Common.CommonPage.BackKeyCanClick = true;
                    UserCenterResourse.AccountOption.AppCanSignout = true;
                    if (localTemplateName != string.Empty)
                    {
                        //删除掉这个模板文件
                        HdlFileLogic.Current.DeleteFile(localTemplateName);
                    }
                    return false;
                }
                //设置进度值
                ProgressFormBar.Current.SetValue(i + 1 + listNormalFile.Count, listFileCount);
            }
            if (localTemplateName != string.Empty)
            {
                //删除掉这个模板文件
                HdlFileLogic.Current.DeleteFile(localTemplateName);
            }
            //进度条关闭
@@ -761,6 +788,18 @@
                //显示设备历史版本(Debug用)
                UserCenterResourse.HideOption.DeviceHistory = 1;
            }
            checkKeys = UserCenterLogic.EncryptPassword(UserCenterResourse.FileEncryptKey, DirNameResourse.StartDebugAppFile + UserCenterResourse.UserInfo.Account);
            if (listFile.Contains(checkKeys) == true)
            {
                //开启后台调试App功能(Debug用)
                UserCenterResourse.HideOption.StartDebugApp = 1;
            }
            checkKeys = UserCenterLogic.EncryptPassword(UserCenterResourse.FileEncryptKey, DirNameResourse.CheckDeviceTypeFile + UserCenterResourse.UserInfo.Account);
            if (listFile.Contains(checkKeys) == true)
            {
                //开启检测设备Type的(Debug用)
                UserCenterResourse.HideOption.CheckDeviceType = 1;
            }
            //恢复
            IMessageCommon.Current.IgnoreError = false;
@@ -789,8 +828,6 @@
                ProgressFormBar.Current.Close();
                return false;
            }
            //关闭进度条
            ProgressFormBar.Current.Close();
            //清空全部房间
            HdlRoomLogic.Current.DeleteAllRoom();
@@ -811,6 +848,9 @@
            //刷新本地缓存
            UserCenterLogic.RefreshAllMemory();
            //关闭进度条
            ProgressFormBar.Current.Close();
            return true;
        }