From 05ce435c3b58e53eeab04c672affdeeab75f3036 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期五, 15 十一月 2019 14:41:39 +0800
Subject: [PATCH] 2019.11.15-1

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAutoBackupLogic.cs |   75 +++++++++++++++++++++----------------
 1 files changed, 43 insertions(+), 32 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAutoBackupLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAutoBackupLogic.cs
index f8af95c..af1fb24 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAutoBackupLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAutoBackupLogic.cs
@@ -151,7 +151,7 @@
             }
 
             //鍒犻櫎鏂囦欢
-            string strroot = UserCenterResourse.LocalRootPath;
+            string strroot = Common.Config.Instance.FullPath;
             var backPath = System.IO.Path.Combine(strroot, DirNameResourse.LocalMemoryDirectory, DirNameResourse.AutoBackupdeleteDirectory);
             foreach (var file in listData)
             {
@@ -183,7 +183,7 @@
             }
 
             //鍒犻櫎鏂囦欢
-            string strroot = UserCenterResourse.LocalRootPath;
+            string strroot = Common.Config.Instance.FullPath;
             var backPath = System.IO.Path.Combine(strroot, DirNameResourse.LocalMemoryDirectory, DirNameResourse.AutoBackupDirectory);
             foreach (var file in listData)
             {
@@ -219,7 +219,7 @@
         /// <returns></returns>
         public static List<string> GetAutoBackupEditorFile()
         {
-            string strroot = UserCenterResourse.LocalRootPath;
+            string strroot = Common.Config.Instance.FullPath;
             var path = System.IO.Path.Combine(strroot, DirNameResourse.LocalMemoryDirectory, DirNameResourse.AutoBackupDirectory);
 
             return GetFileFromDirectory(path);
@@ -231,7 +231,7 @@
         /// <returns></returns>
         public static List<string> GetAutoBackupDeleteFile()
         {
-            string strroot = UserCenterResourse.LocalRootPath;
+            string strroot = Common.Config.Instance.FullPath;
             var path = System.IO.Path.Combine(strroot, DirNameResourse.LocalMemoryDirectory, DirNameResourse.AutoBackupdeleteDirectory);
 
             return GetFileFromDirectory(path);
@@ -270,7 +270,11 @@
         public static void AddOrEditorFile(string fileName)
         {
             //鏍圭洰褰�
-            string strroot = UserCenterResourse.LocalRootPath;
+            string strroot = Common.Config.Instance.FullPath;
+            if (strroot == string.Empty)
+            {
+                return;
+            }
             //鑷姩澶囦唤鐩綍
             string strBackPath = System.IO.Path.Combine(strroot, DirNameResourse.LocalMemoryDirectory, DirNameResourse.AutoBackupDirectory);
 
@@ -303,7 +307,11 @@
         public static void DeleteFile(string fileName)
         {
             //鏍圭洰褰�
-            string strroot = UserCenterResourse.LocalRootPath;
+            string strroot = Common.Config.Instance.FullPath;
+            if (strroot == string.Empty)
+            {
+                return;
+            }
             //鑷姩鍒犻櫎澶囦唤鐩綍
             string strBackPath = System.IO.Path.Combine(strroot, DirNameResourse.LocalMemoryDirectory, DirNameResourse.AutoBackupdeleteDirectory);
 
@@ -329,19 +337,19 @@
             //濡傛灉鏈湴宸茬粡鎷ユ湁浜嗚繖涓枃浠讹紝鍒欒鏄庝笉鏄柊鎵嬫満锛屼笉鍐嶈嚜鍔ㄨ繕鍘�
             if (System.IO.File.Exists(checkFile) == true)
             {
-                //鍚屾鏈嶅姟鍣ㄧ殑鍙栨秷浜嗙殑鍒嗕韩鍐呭
-                await HdlShardLogic.Current.SynchronizeDeleteSharedContent();
+                //鍚屾鏈嶅姟鍣ㄧ殑鍒嗕韩鍐呭
+                await HdlShardLogic.Current.SynchronizeDbSharedContent();
                 return 0;
             }
-            //鍒涘缓涓�涓┖鏂囦欢
-            var file = System.IO.File.Create(checkFile);
-            file.Close();
 
             //鏆傛椂涓嶆敮鎸佹垚鍛�
             if (UserCenterResourse.UserInfo.AuthorityNo == 3)
             {
                 //鍚屾鏈嶅姟鍣ㄧ殑鍒嗕韩鍐呭
                 await HdlShardLogic.Current.SynchronizeDbSharedContent();
+                //鍒涘缓涓�涓┖鏂囦欢(鏍囪瘑宸茬粡瀹屾垚鍚屾)
+                var file = System.IO.File.Create(checkFile);
+                file.Close();
                 return 1;
             }
 
@@ -349,14 +357,15 @@
             var data = await HdlBackupLogic.Current.GetBackupListNameFromDB(1);
             if (data == null)
             {
-                //寮傚父,鍒犻櫎妫�娴嬫枃浠�
-                System.IO.File.Delete(checkFile);
                 return -1;
             }
             if (data.Count == 0)
             {
                 //鍚屾鏈嶅姟鍣ㄧ殑鍒嗕韩鍐呭
                 await HdlShardLogic.Current.SynchronizeDbSharedContent();
+                //鍒涘缓涓�涓┖鏂囦欢(鏍囪瘑宸茬粡瀹屾垚鍚屾)
+                var file = System.IO.File.Create(checkFile);
+                file.Close();
                 return 1;
             }
             //鑷姩澶囦唤鍙湁涓�涓�
@@ -380,8 +389,10 @@
             //娌℃湁閿欒鐨勮瘽锛屽垯绉诲姩鍒板綋鍓嶄綇瀹呮枃浠跺す涓嬮潰
             Global.MoveDirectoryFileToHomeDirectory(tempDir, true);
 
-            //鍚屾鏈嶅姟鍣ㄧ殑鍙栨秷浜嗙殑鍒嗕韩鍐呭
-            await HdlShardLogic.Current.SynchronizeDeleteSharedContent();
+            //鍒涘缓涓�涓┖鏂囦欢(鏍囪瘑宸茬粡瀹屾垚鍚屾)
+            var file2 = System.IO.File.Create(checkFile);
+            file2.Close();
+
             return 1;
         }
 
@@ -469,7 +480,7 @@
                 //鏆備笉鏀寔鎴愬憳
                 return;
             }
-            string strroot = UserCenterResourse.LocalRootPath;
+            string strroot = Common.Config.Instance.FullPath;
             var path = System.IO.Path.Combine(strroot, DirNameResourse.LocalMemoryDirectory, DirNameResourse.AutoBackupDirectory);
 
             List<string> listFile1 = GetFileFromDirectory(path);
@@ -489,11 +500,11 @@
             string fullName = UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.AutoBackupNotPromptedFile);
             if (System.IO.File.Exists(fullName) == false)
             {
-                Application.RunOnMainThread(() =>
-                {
-                    var form = new HdlBackup.HdlAutoBackupSettionForm();
-                    form.AddForm();
-                });
+                //Application.RunOnMainThread(() =>
+                //{
+                //    var form = new HdlBackup.HdlAutoBackupSettionForm();
+                //    form.AddForm();
+                //});
                 return;
             }
             BackupNotPrompted info = null;
@@ -506,12 +517,12 @@
             }
             if (info.Day == 0)
             {
-                Application.RunOnMainThread(() =>
-                {
-                    var form = new HdlBackup.HdlAutoBackupSettionForm();
-                    form.AddForm();
-                });
-                return;
+                //Application.RunOnMainThread(() =>
+                //{
+                //    var form = new HdlBackup.HdlAutoBackupSettionForm();
+                //    form.AddForm();
+                //});
+                //return;
             }
 
             DateTime oldTime = Convert.ToDateTime(info.OldDay);
@@ -519,11 +530,11 @@
             //鏃堕棿宸茬粡瓒呰繃
             if (intDay > info.Day)
             {
-                Application.RunOnMainThread(() =>
-                {
-                    var form = new HdlBackup.HdlAutoBackupSettionForm();
-                    form.AddForm();
-                });
+                //Application.RunOnMainThread(() =>
+                //{
+                //    var form = new HdlBackup.HdlAutoBackupSettionForm();
+                //    form.AddForm();
+                //});
             }
         }
 

--
Gitblit v1.8.0