From 6d73bf6e816570291865674bef8bce8972e4de3f Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期三, 01 十二月 2021 16:32:57 +0800
Subject: [PATCH] 2021-12-01-01

---
 HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs
index d497c19..1e56bf0 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs
@@ -1,4 +1,5 @@
 锘縰sing System;
+using System.Collections.Generic;
 using Shared;
 
 namespace HDL_ON.UI
@@ -21,7 +22,7 @@
         /// </summary>
         void LoadMethod_AllElection()
         {
-            btnChooseAll.MouseUpEventHandler += (sender, e) =>
+            btnAllRoomText.MouseUpEventHandler += (sender, e) =>
             {
                 btnChooseAll.IsSelected = !btnChooseAll.IsSelected;
 
@@ -47,19 +48,19 @@
                     }
                 }
                 function.roomIds.Clear();
-                foreach (var room in Entity.SpatialInfo.CurrentSpatial.RoomList)
+                if (btnChooseAll.IsSelected)
                 {
-                    if (btnChooseAll.IsSelected)
+                    foreach (var room in Entity.SpatialInfo.CurrentSpatial.RoomList)
                     {
-                        function.roomIds.Add(room.roomId);
+                        if (btnChooseAll.IsSelected)
+                        {
+                            function.roomIds.Add(room.roomId);
+                        }
                     }
-                    else
-                    {
-                        function.roomIds.Remove(room.roomId);
-                    }
-                    function.SaveFunctionData(true);
                 }
-                Entity.SpatialInfo.CurrentSpatial.InitRoomFunction();
+
+                function.UpdataRoomIds();
+                Entity.SpatialInfo.CurrentSpatial.InitRoomListFunctions();
             };
         }
 
@@ -71,14 +72,14 @@
             if (isAdd)
             {
                 function.roomIds.Add(room.roomId);
-                room.AddRoomFunction(function);
+                //room.AddRoomFunction(function);
             }
             else
             {
                 function.roomIds.Remove(room.roomId);
-                room.RemoveRoomFunction(function);
+                //room.RemoveRoomFunction(function);
             }
-            function.SaveFunctionData(true);
+            function.UpdataRoomIds();
             if (function.roomIds.Count == Entity.SpatialInfo.CurrentSpatial.RoomList.Count)
             {
                 btnChooseAll.IsSelected = true;

--
Gitblit v1.8.0