From fa7d172c21d4a78925ae39b3cbfe7b100c3dead9 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 23 十二月 2020 09:35:28 +0800
Subject: [PATCH] Merge branch 'CJL' into NewFilePath

---
 HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs                                            |   69 ++++++++---
 HDL_ON/UI/UI2/1-HomePage/HomePage.cs                                               |    3 
 HDL_ON/DAL/Server/NewApiRes.cs                                                     |    9 
 HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPage.cs            |  126 +++++++++++++++++----
 HDL_ON/Common/HDLCommon.cs                                                         |   11 +
 HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFunctionPermissionPage.cs    |   40 +++++-
 HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFunctionPermissionPageBLL.cs |   35 +++--
 HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPageBLL.cs         |   35 +++--
 HDL_ON/DAL/Mqtt/MqttClient.cs                                                      |    7 +
 9 files changed, 242 insertions(+), 93 deletions(-)

diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs
index 78e05e0..31e2c5f 100644
--- a/HDL_ON/Common/HDLCommon.cs
+++ b/HDL_ON/Common/HDLCommon.cs
@@ -258,11 +258,11 @@
                 {
                     Shared.Application.RunOnMainThread(() =>
                     {
-                        //璐﹀彿鍦ㄥ埆澶勭櫥闄嗭紝琚涪涓嬬嚎 璺宠浆鍒扮櫥褰曢〉闈�
-                        new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.LoggedOnOtherDevices), Language.StringByID(StringId.Close)).Show();
+                        ////璐﹀彿鍦ㄥ埆澶勭櫥闄嗭紝琚涪涓嬬嚎 璺宠浆鍒扮櫥褰曢〉闈�
+                        //new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.LoggedOnOtherDevices), Language.StringByID(StringId.Close)).Show();
                         //閫�鍑虹櫥褰曟搷浣�
                         CheckLogout();
-                     
+
                     });
                     return;
                 }
@@ -290,6 +290,8 @@
         }
 
         /// <summary>
+        /// 璐﹀彿鍦ㄥ埆澶勭櫥闄嗭紝琚涪涓嬬嚎 璺宠浆鍒扮櫥褰曢〉闈�
+        /// 瑕佸湪涓荤嚎绋嬭皟鐢�
         /// 閫�鍑虹櫥褰曟搷浣�
         /// </summary>
         public void CheckLogout()
@@ -297,6 +299,9 @@
             //鏈櫥褰曚笉鐢ㄥ鐞�
             if (!UserInfo.Current.IsLogin) return;
 
+            //璐﹀彿鍦ㄥ埆澶勭櫥闄嗭紝琚涪涓嬬嚎 璺宠浆鍒扮櫥褰曢〉闈�
+            new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.LoggedOnOtherDevices), Language.StringByID(StringId.Close)).Show();
+
 #if DEBUG
             return;
 #endif
diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs
index 9246240..1ecf619 100644
--- a/HDL_ON/DAL/Mqtt/MqttClient.cs
+++ b/HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -557,7 +557,12 @@
 
             DisConnectRemoteMqttClient("鎸や笅绾�");
 
-            HDLCommon.Current.CheckLogout();
+            Application.RunOnMainThread(() =>
+            {
+                //寮圭獥鎻愮ず琚尋涓嬬嚎
+                HDLCommon.Current.CheckLogout();
+            });
+           
 
             //UserInfo.Current.LastTime = DateTime.MinValue;
             //UserInfo.Current.SaveUserInfo();
diff --git a/HDL_ON/DAL/Server/NewApiRes.cs b/HDL_ON/DAL/Server/NewApiRes.cs
index 6792f46..c522247 100644
--- a/HDL_ON/DAL/Server/NewApiRes.cs
+++ b/HDL_ON/DAL/Server/NewApiRes.cs
@@ -1360,10 +1360,11 @@
         /// 瀛愯处鍙稩D
         /// </summary>
         public string childAccountId;
-        /// <summary>
-        /// 鍒嗕韩绫诲瀷 1.ROOM  2.DEVICE 3.SCENE
-        /// </summary>
-        public string shareType = "DEVICE";
+        ///// <summary>
+        ///// 鍒嗕韩绫诲瀷 1.ROOM  2.DEVICE 3.SCENE
+        ///// 涓嶄紶榛樿鏌ュ叏閮�
+        ///// </summary>
+        //public string shareType = "DEVICE";
     }
 
     #endregion
diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
index 90f1887..6279a6f 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -130,7 +130,8 @@
                 };
                 topView.AddChidren(btnLinkStateTip);
                 //鏇存柊閾炬帴鐘舵�乮con棰滆壊
-                LoadEvent_CheckLinkStatus();
+                CheckLinkStatus();//2020-12-22
+                //LoadEvent_CheckLinkStatus();
 
                 btnResidenceName = new Button()
                 {
diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
index 02efd04..daf89de 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -21,32 +21,63 @@
                 bodyView.btnPm25Values.Text = MainPage.cityInfo.pm25 == null ? "--" : MainPage.cityInfo.pm25;
             }
         }
+
+        /// <summary>
+        /// 鏇存柊杩炴帴鐘舵�佸浘鏍�
+        /// </summary>
+        void CheckLinkStatus()
+        {
+            if (Control.Ins.GatewayOnline)
+            {
+                if (Control.Ins.IsRemote)
+                {
+                    bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.MainColor;
+                }
+                else
+                {
+                    bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.LinkTipRemote;
+                }
+            }
+            else
+            {
+                bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.LinkTipFail;
+            }
+        }
+
         /// <summary>
         /// 纭杩炴帴鐘舵��
         /// </summary>
         public static void LoadEvent_CheckLinkStatus()
         {
-            if (bodyView != null)
+            Application.RunOnMainThread(() =>
             {
-                Application.RunOnMainThread(() =>
+                if (bodyView != null)
                 {
-                    if (Control.Ins.GatewayOnline)
-                    {
-                        if (Control.Ins.IsRemote)
-                        {
-                            bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.MainColor;
-                        }
-                        else
-                        {
-                            bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.LinkTipRemote;
-                        }
-                    }
-                    else
-                    {
-                        bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.LinkTipFail;
-                    }
-                });
-            }
+                    bodyView.CheckLinkStatus();
+                }
+            });
+
+            //if (bodyView != null)
+            //{
+            //    Application.RunOnMainThread(() =>
+            //    {
+            //        if (Control.Ins.GatewayOnline)
+            //        {
+            //            if (Control.Ins.IsRemote)
+            //            {
+            //                bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.MainColor;
+            //            }
+            //            else
+            //            {
+            //                bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.LinkTipRemote;
+            //            }
+            //        }
+            //        else
+            //        {
+            //            bodyView.btnLinkStateTip.BackgroundColor = CSS.CSS_Color.LinkTipFail;
+            //        }
+            //    });
+            //}
         }
 
         /// <summary>
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFunctionPermissionPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFunctionPermissionPage.cs
old mode 100755
new mode 100644
index b47c385..d4f4569
--- a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFunctionPermissionPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFunctionPermissionPage.cs
@@ -37,9 +37,10 @@
         /// </summary>
         string roomId;
         /// <summary>
-        /// 鎴块棿鎵�鏈夊姛鑳藉垪琛�
+        /// 鎴块棿鎵�鏈夊姛鑳藉拰鍦烘櫙鍒楄〃
         /// </summary>
-        List<Function> roomFunctionList = new List<Function>();
+        List<RoomData> roomFunctionOrSceneList = new List<RoomData>();
+     
 
         /// <summary>
         /// 鍒锋柊鍥炶皟Action
@@ -63,14 +64,14 @@
         /// 
         /// </summary>
         /// <param name="mInfo"></param>
-        /// <param name="roomFunctionList"></param>
+        /// <param name="roomFunctionOrSceneList">鎴块棿鎵�鏈夊姛鑳藉拰鍦烘櫙鍒楄〃</param>
         /// <param name="roomId"></param>
         /// <param name="refreshAction"></param>
-        public MemberFunctionPermissionPage(ResidenceMemberInfo mInfo, List<Function> roomFunctionList, List<ShareData> funs_RoomAll, string roomId, Action refreshAction)
+        public MemberFunctionPermissionPage(ResidenceMemberInfo mInfo, List<RoomData> roomFunctionOrSceneList, List<ShareData> funs_RoomAll, string roomId, Action refreshAction)
         {
             bodyView = this;
             this.memberInfo = mInfo;
-            this.roomFunctionList = roomFunctionList;
+            this.roomFunctionOrSceneList = roomFunctionOrSceneList;
             this.roomId = roomId;
             //this.curResidenceShareData = new List<ShareData>();
             this.curResidenceShareData = memberInfo.CurResidenceShareData;
@@ -160,7 +161,7 @@
         void LoadFunctionRow(List<ShareData> shareDatas)
         {
             contentView.RemoveAll();
-            foreach (var function in roomFunctionList)
+            foreach (var roomData in roomFunctionOrSceneList)
             {
                 var roomView = new FrameLayout()
                 {
@@ -177,7 +178,7 @@
                     TextSize = CSS_FontSize.SubheadingFontSize,
                     TextColor = CSS_Color.FirstLevelTitleColor,
                     TextAlignment = TextAlignment.CenterLeft,
-                    Text = function.name,
+                    Text = roomData.name,
                 };
                 roomView.AddChidren(btnRoomText);
 
@@ -193,7 +194,7 @@
                 };
                 roomView.AddChidren(btnChoose);
 
-                var shareData = shareDatas.Find((obj) => obj.shareTypeId == function.deviceId);
+                var shareData = shareDatas.Find((obj) => obj.shareTypeId == roomData.shareTypeId);
                 if (shareData != null)
                 {
                     btnChoose.IsSelected = true;
@@ -205,7 +206,7 @@
                     if (btnChooseAll.IsSelected)
                         btnChooseAll.IsSelected = false;
                 }
-                LoadMethod_SharedDataChange(btnChoose, btnRoomText, roomView, function);
+                LoadMethod_SharedDataChange(btnChoose, btnRoomText, roomView, roomData);
 
                 var btnLine = new Button()
                 {
@@ -217,7 +218,28 @@
                 };
                 contentView.AddChidren(btnLine);
             }
+
+          
         }
 
     }
+
+    /// <summary>
+    /// 鎴块棿鎵�鏈夊姛鑳藉拰鑰呭満鏅垪琛�
+    /// </summary>
+    public class RoomData
+    {
+        /// <summary>
+        /// 璁惧鍚嶅瓧鎴栬�呭満鏅悕瀛�
+        /// </summary>
+        public string shareTypeId;
+        /// <summary>
+        /// 璁惧鍚嶅瓧鎴栬�呭満鏅悕瀛�
+        /// </summary>
+        public string name;
+        /// <summary>
+        /// 鍒嗕韩绫诲瀷 1.ROOM  2.DEVICE 3.SCENE
+        /// </summary>
+        public string shareType = ShareType.DEVICE.ToString();
+    }
 }
\ No newline at end of file
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFunctionPermissionPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFunctionPermissionPageBLL.cs
old mode 100755
new mode 100644
index ee44a30..5dad07a
--- a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFunctionPermissionPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFunctionPermissionPageBLL.cs
@@ -67,11 +67,12 @@
                         act = new PublicAssmebly().TipLoadingMsgDialog(Language.StringByID(StringId.SavingPleaseWait));
                     });
 
-                    if (!string.IsNullOrEmpty(roomId))
-                    {
-                        //濡傛灉鎴块棿ID涓嶄负绌猴紝绠$悊鎴块棿
-                        ManageRoomSharing();
-                    }
+                    //2020-12-22 灞忚斀鎴块棿鍒嗕韩绠$悊
+                    //if (!string.IsNullOrEmpty(roomId))
+                    //{
+                    //    //濡傛灉鎴块棿ID涓嶄负绌猴紝绠$悊鎴块棿
+                    //    ManageRoomSharing();
+                    //}
                   
 
                     //2.鎵归噺鍒犻櫎鍒嗕韩
@@ -296,12 +297,12 @@
         /// <param name="btn2"></param>
         /// <param name="btn3"></param>
         /// <param name="function"></param>
-        void LoadMethod_SharedDataChange(Button btnChoose, Button btn2, FrameLayout btn3, Function function)
+        void LoadMethod_SharedDataChange(Button btnChoose, Button btn2, FrameLayout btn3, RoomData roomData)
         {
             EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
             {
                 btnChoose.IsSelected = !btnChoose.IsSelected;
-                var sd = curResidenceShareData.Find((obj) => obj.shareTypeId == function.deviceId);
+                var sd = curResidenceShareData.Find((obj) => obj.shareTypeId == roomData.shareTypeId);
                 if (btnChoose.IsSelected)
                 {
                     try
@@ -320,14 +321,14 @@
                         else
                         {
                             var newSd = new ShareData();
-                            newSd.shareTypeId = function.deviceId;
+                            newSd.shareTypeId = roomData.shareTypeId;
 
                             funs_RoomAll.Add(newSd);
                         }
                         btnChooseAll.IsSelected = true;
-                        foreach (var f in roomFunctionList)
+                        foreach (var f in roomFunctionOrSceneList)
                         {
-                            if (funs_RoomAll.Find((obj) => obj.shareTypeId == f.deviceId) == null)
+                            if (funs_RoomAll.Find((obj) => obj.shareTypeId == f.shareTypeId) == null)
                             {
                                 btnChooseAll.IsSelected = false;
                                 break;
@@ -341,7 +342,7 @@
                 }
                 else
                 {
-                    var onFuns = funs_RoomAll.Find((obj) => obj.shareTypeId == function.deviceId);
+                    var onFuns = funs_RoomAll.Find((obj) => obj.shareTypeId == roomData.shareTypeId);
                     if (funs_RoomAll.Contains(onFuns))
                     {
                         funs_RoomAll.Remove(onFuns);
@@ -374,18 +375,19 @@
                 funs_RoomAll = new List<ShareData>();
                 if (btnChooseAll.IsSelected)
                 {
-                    foreach (var f in roomFunctionList)
+                    foreach (var f in roomFunctionOrSceneList)
                     {
                         var ssdd = new ShareData();
-                        ssdd.shareTypeId = f.deviceId;
+                        ssdd.shareTypeId = f.shareTypeId;
+                        ssdd.shareType = f.shareType;
                         funs_RoomAll.Add(ssdd);
                     }
                 }
                 else
                 {
-                    foreach (var f in roomFunctionList)
+                    foreach (var f in roomFunctionOrSceneList)
                     {
-                        var sd = curResidenceShareData.Find((obj) => obj.shareTypeId == f.deviceId);
+                        var sd = curResidenceShareData.Find((obj) => obj.shareTypeId == f.shareTypeId);
                         if (sd != null)
                         {
                             funs_Del.Add(sd);
@@ -399,4 +401,7 @@
 
         }
     }
+
+
+   
 }
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPage.cs
old mode 100755
new mode 100644
index 2914390..10e0c20
--- a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPage.cs
@@ -146,21 +146,41 @@
                 }
             }
 
-            //绉婚櫎褰撳墠浣忓畢宸茬粡涓嶅瓨鍦ㄧ殑鍔熻兘
-            for (int i = 0; i < memberInfo.CurResidenceShareData.Count;)
+            //鎵�鏈夊満鏅�
+            List<Scene> allSceneList = FunctionList.List.scenes;
+            //鍏ㄥ眬鍦烘櫙鍦烘櫙
+            List<Scene> globalSceneList = new List<Scene>();
+            //鎵惧嚭鎵�鏈夌殑鍏ㄥ眬鍦烘櫙
+            foreach (var mScene in allSceneList)
             {
-                var sd = memberInfo.CurResidenceShareData[i];
-                if (allFunctionList.Find((obj) => obj.deviceId == sd.shareTypeId) == null)
+
+                //roomIds澶т簬0 浠h〃鍒嗛厤鍒版埧闂�
+                mScene.roomIds.Remove(null);
+                if (mScene.roomIds.Count > 0)
                 {
-                    //new DAL.Server.HttpServerRequest().DeleteShareData(sd);
-                    //寰呯‘璁ゆ槸鍚﹀悓姝ヤ簯绔垹闄ゅ垎浜�
-                    memberInfo.CurResidenceShareData.Remove(sd);
+                    //allocatedList.Add(function);
                 }
                 else
                 {
-                    i++;
+                    globalSceneList.Add(mScene);
                 }
             }
+
+            ////绉婚櫎褰撳墠浣忓畢宸茬粡涓嶅瓨鍦ㄧ殑鍔熻兘
+            //for (int i = 0; i < memberInfo.CurResidenceShareData.Count;)
+            //{
+            //    var sd = memberInfo.CurResidenceShareData[i];
+            //    if (allFunctionList.Find((obj) => obj.deviceId == sd.shareTypeId) == null)
+            //    {
+            //        //new DAL.Server.HttpServerRequest().DeleteShareData(sd);
+            //        //寰呯‘璁ゆ槸鍚﹀悓姝ヤ簯绔垹闄ゅ垎浜�
+            //        memberInfo.CurResidenceShareData.Remove(sd);
+            //    }
+            //    else
+            //    {
+            //        i++;
+            //    }
+            //}
 
             try
             {
@@ -170,7 +190,7 @@
                     AddRoomFunctionRowLayout(room);
                 }
                 //2020-12-16 鍔犺浇鏈垎閰嶅尯鍩熷姛鑳絉owLayout
-                AddNoAreaFunctionRowLayout(unallocatedList);
+                AddNoAreaFunctionRowLayout(unallocatedList, globalSceneList);
             }
             catch
             {
@@ -184,16 +204,17 @@
         /// <param name="mRoom"></param>
         void AddRoomFunctionRowLayout(Room mRoom)
         {
-            ShowBaseRoomFunOrNoAreaFunRowLayout(mRoom, null);
+            ShowBaseRoomFunOrNoAreaFunRowLayout(mRoom, null, null);
         }
 
         /// <summary>
-        /// 娣诲姞鏈垎閰嶅尯鍩熷姛鑳� 鐨勪釜鏁扮粺璁$姸鎬佺殑RowLayout
+        /// 
         /// </summary>
         /// <param name="unallocatedList">鏈垎閰嶇殑鎵�鏈夊姛鑳藉垪琛�</param>
-        void AddNoAreaFunctionRowLayout(List<Function> unallocatedList)
+        /// <param name="globalSceneList">鍏ㄥ尯鍩熺殑鍦烘櫙</param>
+        void AddNoAreaFunctionRowLayout(List<Function> unallocatedList, List<Scene> globalSceneList)
         {
-            ShowBaseRoomFunOrNoAreaFunRowLayout(null, unallocatedList);
+            ShowBaseRoomFunOrNoAreaFunRowLayout(null, unallocatedList, globalSceneList);
         }
 
         /// <summary>
@@ -202,14 +223,15 @@
         /// </summary>
         /// <param name="room">濡傛灉鎴块棿涓虹┖锛屼唬琛ㄧ鐞嗘棤鍒嗛厤鍖哄煙</param>
         /// <param name="unallocatedList">绠$悊鏃犲垎閰嶅尯鍩熸墠鏈夋晥</param>
-        void ShowBaseRoomFunOrNoAreaFunRowLayout(Room mRoom, List<Function> unallocatedList)
+        /// <param name="globalSceneList">鍏ㄥ眬鍦烘櫙</param>
+        void ShowBaseRoomFunOrNoAreaFunRowLayout(Room mRoom, List<Function> unallocatedList, List<Scene> globalSceneList)
         {
             /// 褰撳墠鎴块棿鎴栬�呮棤鍒嗛厤鍖哄煙鍒嗕韩鍒楄〃
             List<ShareData> funs_RoomAll = new List<ShareData>();
-            /// <summary>
-            /// 鎴块棿鎴栬�呮棤鍒嗛厤鍖哄煙鎵�鏈夊姛鑳藉垪琛�
-            /// </summary>
-            List<Function> roomFunctionList = new List<Function>();
+      
+            /// 鎴块棿鎵�鏈夊姛鑳藉拰鑰呭満鏅垪琛�
+            List<RoomData> roomFunctionOrSceneList = new List<RoomData>();
+
             /// 鎴块棿ID
             string roomId = "";
 
@@ -264,7 +286,36 @@
             {
                 //鏄剧ず鎴块棿鍚�
                 btnRoomName.Text = mRoom.roomName;
-                roomFunctionList = mRoom.GetRoomFunctions(false);
+                var mRoomFunctionList = mRoom.GetRoomFunctions(false);
+                var mRoomSceneList = mRoom.GetRoomScenes(false);
+                //閬嶅巻鎵�鏈夊姛鑳藉垪琛�
+                if (mRoomFunctionList != null)
+                {
+                    foreach (var fun in mRoomFunctionList)
+                    {
+                        roomFunctionOrSceneList.Add(new RoomData()
+                        {
+                            shareTypeId = fun.deviceId,
+                            shareType = ShareType.DEVICE.ToString(),
+                            name = fun.name,
+                        });
+                    }
+                }
+
+                //閬嶅巻鎵�鏈夊満鏅垪琛�
+                if (mRoomSceneList != null)
+                {
+                    foreach (var roomScene in mRoomSceneList)
+                    {
+                        roomFunctionOrSceneList.Add(new RoomData()
+                        {
+                            shareTypeId = roomScene.userSceneId,
+                            shareType = ShareType.SCENE.ToString(),
+                            name = roomScene.name,
+                        });
+                    }
+                }
+
                 roomId = mRoom.roomId;
                 //娣诲姞鍒嗗壊绾�
                 var lineView = new LineView(roomView.Height - Application.GetRealHeight(1));
@@ -274,8 +325,35 @@
             {
                 //鏄剧ず鏃犲尯鍩熷姛鑳�
                 btnRoomName.TextID = StringId.NoAreaFunction;
-                roomFunctionList = unallocatedList;
                 roomId = null;
+
+                //閬嶅巻鎵�鏈夊姛鑳藉垪琛�
+                if (unallocatedList != null)
+                {
+                    foreach (var fun in unallocatedList)
+                    {
+                        roomFunctionOrSceneList.Add(new RoomData()
+                        {
+                            shareTypeId = fun.deviceId,
+                            shareType = ShareType.DEVICE.ToString(),
+                            name = fun.name,
+                        });
+                    }
+                }
+
+                //閬嶅巻鎵�鏈夊満鏅垪琛�
+                if (globalSceneList != null)
+                {
+                    foreach (var roomScene in globalSceneList)
+                    {
+                        roomFunctionOrSceneList.Add(new RoomData()
+                        {
+                            shareTypeId = roomScene.userSceneId,
+                            shareType = ShareType.SCENE.ToString(),
+                            name = roomScene.name,
+                        });
+                    }
+                }
             }
 
             //鍒犻櫎鎸夐挳
@@ -290,7 +368,7 @@
             deleteBtn.MouseUpEventHandler = (sender, e) =>
             {
                 //涓�閿垹闄ゆ墍鏈夊垎浜�
-                DeleteRoomAllShare(funs_RoomAll, roomFunctionList, roomId, btnFunctionCount, roomView);
+                DeleteRoomAllShare(funs_RoomAll, roomFunctionOrSceneList, roomId, btnFunctionCount, roomView);
             };
 
             //璁$畻宸茬粡鍔犲叆鎴块棿鐨勮澶囨暟閲忕殑Action浜嬩欢
@@ -299,19 +377,19 @@
                 int addCount = 0;
                 foreach (var sd in memberInfo.CurResidenceShareData)
                 {
-                    if (roomFunctionList.Find((obj) => obj.deviceId == sd.shareTypeId) != null)
+                    if (roomFunctionOrSceneList.Find((obj) => obj.shareTypeId == sd.shareTypeId) != null)
                     {
                         addCount++;
                         funs_RoomAll.Add(sd);
                     }
                 }
-                btnFunctionCount.Text = addCount + "/" + roomFunctionList.Count.ToString();
+                btnFunctionCount.Text = addCount + "/" + roomFunctionOrSceneList.Count.ToString();
                 //Utlis.WriteLine("鍒锋柊鎴愬姛");
             };
             //鐐瑰嚮璋冩暣浜嬩欢
             EventHandler<MouseEventArgs> eHandler = (sender, e) =>
             {
-                var mmp = new MemberFunctionPermissionPage(memberInfo, roomFunctionList, funs_RoomAll, roomId, RefreshAction);
+                var mmp = new MemberFunctionPermissionPage(memberInfo, roomFunctionOrSceneList, funs_RoomAll, roomId, RefreshAction);
                 MainPage.BasePageView.AddChidren(mmp);
                 mmp.LoadPage(StringId.MemberPermissionManagement);
                 MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPageBLL.cs
old mode 100755
new mode 100644
index 5018a0f..a9e3cc6
--- a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPageBLL.cs
@@ -132,11 +132,11 @@
         /// 涓�閿垹闄ゅ綋鍓嶆埧闂存墍鏈夊垎浜�
         /// </summary>
         /// <param name="funs_Del">闇�瑕佷竴閿垹闄ょ殑鍒嗕韩鏁版嵁</param>
-        /// <param name="roomFunctionList">褰撳墠鎴块棿鎵�鏈夊姛鑳藉垪琛�</param>
+        /// <param name="roomFunctionOrSceneList">褰撳墠鎴块棿鎵�鏈夊姛鑳藉垪琛�</param>
         /// <param name="roomId">濡傛灉鎴块棿ID涓虹┖锛屽垯浠h〃绠$悊鏃犲垎閰嶅尯鍩熺殑鍔熻兘锛屼笉闇�瑕佸垹闄ゆ埧闂村垎浜�</param>
         /// <param name="btnFunctionCount">涓暟缁熻鏁伴噺</param>
         /// <param name="roomView">鑳屾櫙View</param>
-        void DeleteRoomAllShare(List<ShareData> funs_Del, List<Function> roomFunctionList, string roomId, Button btnFunctionCount, RowLayout roomView)
+        void DeleteRoomAllShare(List<ShareData> funs_Del, List<RoomData> roomFunctionOrSceneList, string roomId, Button btnFunctionCount, RowLayout roomView)
         {
             //闇�瑕佸垹闄ょ殑鍒嗕韩涓�0
             if (funs_Del == null || funs_Del.Count == 0)
@@ -156,20 +156,21 @@
                 try
                 {
                     bool result = false;
-                    //濡傛灉鎴块棿ID涓虹┖锛屽垯浠h〃绠$悊鏃犲垎閰嶅尯鍩熺殑鍔熻兘锛屼笉闇�瑕佸垹闄ゆ埧闂村垎浜�
-                    if (!string.IsNullOrEmpty(roomId))
-                    {
-                        //鍒犻櫎鎴块棿鍒嗕韩
-                        var success = DeleteShareRoom(roomId);
-                        if (success)
-                        {
-                            Utlis.WriteLine("鍒犻櫎鎴块棿鍒嗕韩鎴愬姛");
-                        }
-                        else
-                        {
-                            Utlis.WriteLine("鍒犻櫎鎴块棿鍒嗕韩澶辫触");
-                        }
-                    }
+                    //2020-12-22 灞忚斀鎴块棿鍒嗕韩绠$悊
+                    ////濡傛灉鎴块棿ID涓虹┖锛屽垯浠h〃绠$悊鏃犲垎閰嶅尯鍩熺殑鍔熻兘锛屼笉闇�瑕佸垹闄ゆ埧闂村垎浜�
+                    //if (!string.IsNullOrEmpty(roomId))
+                    //{
+                    //    //鍒犻櫎鎴块棿鍒嗕韩
+                    //    var success = DeleteShareRoom(roomId);
+                    //    if (success)
+                    //    {
+                    //        Utlis.WriteLine("鍒犻櫎鎴块棿鍒嗕韩鎴愬姛");
+                    //    }
+                    //    else
+                    //    {
+                    //        Utlis.WriteLine("鍒犻櫎鎴块棿鍒嗕韩澶辫触");
+                    //    }
+                    //}
 
                     //2.鎵归噺鍒犻櫎鍒嗕韩
                     var deleteShareObj = new DeleteShareObj()
@@ -209,7 +210,7 @@
                             //娓呯┖
                             funs_Del.Clear();
                             memberInfo.CurResidenceShareData = funs_final;
-                            btnFunctionCount.Text = 0 + "/" + roomFunctionList.Count.ToString();
+                            btnFunctionCount.Text = 0 + "/" + roomFunctionOrSceneList.Count.ToString();
                             //鍏抽棴鍙虫粦鑿滃崟
                             roomView.HideMenu();
                         });

--
Gitblit v1.8.0