From a7ab4b610972e20753dfedb3e5d80e4d9f017d07 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期五, 14 八月 2020 10:39:08 +0800
Subject: [PATCH] 临时备份,测试1

---
 ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
index dee8d57..cfa71e7 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
@@ -352,11 +352,11 @@
                         Common.Config.Instance.Home.FloorDics.Remove(keys);
                         if (Common.Config.Instance.Home.CurrentFloorId == keys)
                         {
-                            //濡傛灉鍒犻櫎鐨勬槸褰撳墠妤煎眰鐨勮瘽
                             Common.Config.Instance.Home.CurrentFloorId = string.Empty;
-                            foreach (string floorId in Common.Config.Instance.Home.FloorDics.Keys)
+                            var dicFloor = HdlRoomLogic.Current.GetFloorSortList();
+                            foreach (var floorId in dicFloor.Keys)
                             {
-                                //鎶婄涓�涓ゼ灞侷D缁欏畠
+                                //鎶婄涓�涓ゼ灞傝祴鍊肩粰褰撳墠妤煎眰
                                 Common.Config.Instance.Home.CurrentFloorId = floorId;
                                 break;
                             }
@@ -406,7 +406,7 @@
                             this.AdjustContrlTableHeight();
                         }
                         //鍒犻櫎妤煎眰鐨勮瘽,涓婚〉闇�瑕侀噸鏂板埛鏂�
-                        UserView.UserPage.Instance.RefreshForm = true;
+                        UserView.UserPage.Instance.RefreshAllForm = true;
                     });
                 };
             }
@@ -464,7 +464,6 @@
                     Common.Config.Instance.Home.Save();
                     if (Common.Config.Instance.Home.CurrentFloorId == string.Empty)
                     {
-                        Common.Config.Instance.Home.CurrentFloorId = keys;
                         //鍒涘缓绗竴涓柊鐨勬ゼ灞傜殑璇�,闇�瑕佸幓鍒锋柊涓婚〉宸﹁竟鐨勬埧闂村垪琛�
                         HdlRoomLogic.Current.RefreshRoomListView();
                     }
@@ -478,7 +477,7 @@
                         this.InitFrameTableByMode();
                     }
                     //鍒涘缓鎴栬�呬慨鏀规ゼ灞傜殑璇�,涓婚〉闇�瑕侀噸鏂板埛鏂�
-                    UserView.UserPage.Instance.RefreshForm = true;
+                    UserView.UserPage.Instance.RefreshAllForm = true;
                 }
             });
         }
@@ -619,7 +618,7 @@
                         this.AdjustContrlTableHeight();
                     }
                     //鍒犻櫎鎴块棿鐨勮瘽,涓婚〉闇�瑕侀噸鏂板埛鏂�
-                    UserView.UserPage.Instance.RefreshForm = true;
+                    UserView.UserPage.Instance.RefreshAllForm = true;
                 });
             };
         }
@@ -694,16 +693,22 @@
             var myHouse = HdlResidenceLogic.Current.GetHouseByFilePath(Common.Config.Instance.HomeFilePathList[index]);
             //鍒囨崲浣忓畢
             Common.Config.Instance.HomeId = myHouse.Id;
+            Common.Config.Instance.Home = HdlResidenceLogic.Current.GetHouseByHouseId(myHouse.Id);
             Common.Global.CreateHomeDirectory(myHouse.Id);
             Common.Config.Instance.Save();
 
             //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
-            UserCenterLogic.InitUserCenterMenmoryAndThread(false);
+            bool result2 = UserCenterLogic.InitUserCenterMenmoryAndThread(false);
+            if (result2 == false)
+            {
+                //寮�鍚簡璋冭瘯鍔熻兘
+                return;
+            }
 
             //鍒犻櫎浣忓畢
             HdlResidenceLogic.Current.DeleteHouseMemmory(deleteId);
 
-            Application.RunOnMainThread(() =>
+            HdlThreadLogic.Current.RunMain(() =>
             {
                 //鍏抽棴鐣岄潰
                 this.CloseForm();

--
Gitblit v1.8.0