From 9a4b76398009cf76c508d61f7e48fb6f5cb7ac2d Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期二, 21 七月 2020 09:46:53 +0800
Subject: [PATCH] 请合并最新多功能面板代码

---
 ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs |   50 +++++++++++---------------------------------------
 1 files changed, 11 insertions(+), 39 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
index 09a400e..948b78c 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
@@ -24,14 +24,6 @@
         /// </summary>
         private VerticalFrameControl listBackContr = null;
         /// <summary>
-        /// 妤煎眰椤哄簭
-        /// </summary>
-        private List<string> listFloorSort = new List<string>();
-        /// <summary>
-        /// 鎴块棿椤哄簭
-        /// </summary>
-        private List<string> listRoomSort = new List<string>();
-        /// <summary>
         /// 褰撳墠APP鐨勪綇瀹呮ā寮� 0:杩樻病鏈夎缃湁妯″紡 1:妤煎眰妯″紡 2:娌℃湁妤煎眰妯″紡
         /// </summary>
         private int AppResidenceMode = 0;
@@ -282,23 +274,17 @@
         {
             //鑾峰彇妤煎眰
             var dicFloor = HdlRoomLogic.Current.GetFloorSortList();
-            this.listFloorSort.Clear();
-            foreach (string keys in dicFloor.Keys)
-            {
-                listFloorSort.Add(keys);
-            }
-
-            if (Common.Config.Instance.Home.FloorDics.Count == 0)
+            if (dicFloor.Count == 0)
             {
                 return;
             }
             HdlThreadLogic.Current.RunMainInThread(() =>
             {
-                int count = listFloorSort.Count - 1;
-                for (int i = 0; i < listFloorSort.Count; i++)
+                int count = dicFloor.Count;
+                foreach (var keys in dicFloor.Keys)
                 {
-                    string keys = listFloorSort[i];
-                    this.AddFloorRow(keys, dicFloor[keys], i != count);
+                    count--;
+                    this.AddFloorRow(keys, dicFloor[keys], count != 0);
                 }
                 //璋冩暣鎺т欢楂樺害
                 this.AdjustContrlTableHeight();
@@ -366,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;
                             }
@@ -392,9 +378,6 @@
                             HdlRoomLogic.Current.RemoveRoom(roomId);
                         }
                         Common.Config.Instance.Home.Save();
-                        //淇濆瓨椤哄簭
-                        listFloorSort.Remove(keys);
-                        HdlRoomLogic.Current.SaveFloorSort(listFloorSort);
 
                         if (Common.Config.Instance.Home.FloorDics.Count == 0)
                         {
@@ -423,7 +406,7 @@
                             this.AdjustContrlTableHeight();
                         }
                         //鍒犻櫎妤煎眰鐨勮瘽,涓婚〉闇�瑕侀噸鏂板埛鏂�
-                        UserView.UserPage.Instance.RefreshForm = true;
+                        UserView.UserPage.Instance.RefreshAllForm = true;
                     });
                 };
             }
@@ -481,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();
                     }
@@ -495,7 +477,7 @@
                         this.InitFrameTableByMode();
                     }
                     //鍒涘缓鎴栬�呬慨鏀规ゼ灞傜殑璇�,涓婚〉闇�瑕侀噸鏂板埛鏂�
-                    UserView.UserPage.Instance.RefreshForm = true;
+                    UserView.UserPage.Instance.RefreshAllForm = true;
                 }
             });
         }
@@ -540,12 +522,6 @@
         {
             //鑾峰彇妤煎眰鐨勬埧闂�
             var listRoom = HdlRoomLogic.Current.GetFloorSortRoom(string.Empty);
-            this.listRoomSort.Clear();
-            for (int i = 0; i < listRoom.Count; i++)
-            {
-                this.listRoomSort.Add(listRoom[i].Id);
-            }
-
             for (int i = 0; i < listRoom.Count; i++)
             {
                 //娣诲姞鎴块棿琛�
@@ -593,7 +569,6 @@
                 //濡傛灉鏄垎浜殑鎴块棿锛屼笉鑳界紪杈戝拰淇敼
                 return;
             }
-
             //缂栬緫
             var btnEditor = frameRow.AddEditorControl();
             btnEditor.ButtonClickEvent += (sender, e) =>
@@ -614,9 +589,6 @@
                 this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uDeleteRoomMsg), () =>
                 {
                     HdlRoomLogic.Current.RemoveRoom(room.Id);
-                    //淇濆瓨椤哄簭
-                    this.listRoomSort.Remove(room.Id);
-                    HdlRoomLogic.Current.SaveRoomSort(string.Empty, this.listRoomSort);
 
                     var listAllRoom = HdlRoomLogic.Current.GetAllListRooms();
                     if (listAllRoom.Count <= 1)
@@ -646,7 +618,7 @@
                         this.AdjustContrlTableHeight();
                     }
                     //鍒犻櫎鎴块棿鐨勮瘽,涓婚〉闇�瑕侀噸鏂板埛鏂�
-                    UserView.UserPage.Instance.RefreshForm = true;
+                    UserView.UserPage.Instance.RefreshAllForm = true;
                 });
             };
         }

--
Gitblit v1.8.0