From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 17 十二月 2020 09:07:13 +0800
Subject: [PATCH] 新云端Ver1.3

---
 ZigbeeApp/Shared/Phone/UserCenter/Residence/FloorListRoomForm.cs |   55 +++++++++++++++++++++++++++----------------------------
 1 files changed, 27 insertions(+), 28 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/FloorListRoomForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/FloorListRoomForm.cs
index 9cb5ad7..6e5f319 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/FloorListRoomForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/FloorListRoomForm.cs
@@ -19,10 +19,6 @@
         /// 妤煎眰鐨勪富閿�
         /// </summary>
         private string floorKeys = string.Empty;
-        /// <summary>
-        /// 鎴块棿椤哄簭
-        /// </summary>
-        private List<string> listRoomSort = new List<string>();
 
         #endregion
 
@@ -39,17 +35,21 @@
             base.SetTitleText(Common.Config.Instance.Home.FloorDics[i_floor]);
 
             //涓讳汉鎴栬�呯鐞嗗憳鎵嶄細鍑虹幇杩欎釜鑿滃崟
-            if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
+            if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 1 || HdlUserCenterResourse.ResidenceOption.AuthorityNo == 2)
             {
-                var btnIcon = new MostRightIconControl(69, 69);
-                btnIcon.UnSelectedImagePath = "Item/Add.png";
-                topFrameLayout.AddChidren(btnIcon);
-                btnIcon.InitControl();
-                btnIcon.ButtonClickEvent += ((sender, e) =>
+                //鏌ョ湅妯℃澘鏃�,涓嶅厑璁哥紪杈�
+                if (Common.Config.Instance.Home.IsShowTemplate == false)
                 {
-                    var form = new AddNewRoomForm();
-                    form.AddForm(i_floor);
-                });
+                    var btnIcon = new MostRightIconControl(69, 69);
+                    btnIcon.UnSelectedImagePath = "Item/Add.png";
+                    topFrameLayout.AddChidren(btnIcon);
+                    btnIcon.InitControl();
+                    btnIcon.ButtonClickEvent += ((sender, e) =>
+                    {
+                        var form = new AddNewRoomForm();
+                        form.AddForm(i_floor);
+                    });
+                }
             }
 
             //鍒濆鍖栦腑閮ㄤ俊鎭�
@@ -80,12 +80,7 @@
         private void InitRoomListRow()
         {
             //鑾峰彇妤煎眰鐨勬埧闂�
-            var listRoom = Common.Room.CurrentRoom.GetFloorSortRoom(this.floorKeys);
-            this.listRoomSort.Clear();
-            for (int i = 0; i < listRoom.Count; i++)
-            {
-                this.listRoomSort.Add(listRoom[i].Id);
-            }
+            var listRoom = HdlRoomLogic.Current.GetFloorSortRoom(this.floorKeys);
 
             this.listView.RemoveAll();
             listView.Height = bodyFrameLayout.Height + Application.GetRealHeight(6);
@@ -144,6 +139,12 @@
                 var form = new EditorRoomInforForm();
                 form.AddForm(room);
             };
+            //鏌ョ湅妯℃澘鏃�,涓嶅厑璁哥紪杈�
+            if (Common.Config.Instance.Home.IsShowTemplate == true)
+            {
+                btnEditor.Text = Language.StringByID(R.MyInternationalizationString.uSearch1);
+                return;
+            }
 
             //鍒犻櫎
             var btnDelete = frameRow.AddDeleteControl();
@@ -152,18 +153,16 @@
                 //纭鍒犻櫎鎴块棿?
                 this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uDeleteRoomMsg), () =>
                 {
-                    if (Common.Room.CurrentRoom.Id == room.Id)
-                    {
-                        //濡傛灉鍒犻櫎鐨勬槸褰撳墠鎴块棿鐨勮瘽
-                        Common.Room.CurrentRoom = Common.Room.Lists[0];
-                    }
-                    Common.Room.CurrentRoom.Remove(room.FileName);
+                    HdlRoomLogic.Current.RemoveRoom(room.Id);
                     //璋冩暣楂樺害
                     frameRow.RemoveFromParent();
                     listView.AdjustRealHeight(Application.GetRealHeight(23));
-                    //淇濆瓨椤哄簭
-                    this.listRoomSort.Remove(room.Id);
-                    Common.Room.CurrentRoom.SaveRoomSort(floorKeys, this.listRoomSort);
+
+                    if (room.ListDevice.Count > 0)
+                    {
+                        //涓婁紶绌洪棿鍖哄煙淇℃伅
+                        HdlRoomLogic.Current.SetRoomInfoToGateway();
+                    }
                 });
             };
         }

--
Gitblit v1.8.0