From 09dfbfd9b77ec887c17b10f15799a1d3f56e4e17 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 15 十二月 2020 12:04:42 +0800
Subject: [PATCH] 2020-12-15-1

---
 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPageBLL.cs |   42 ++++++++++++++++++++++++++++++------------
 1 files changed, 30 insertions(+), 12 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPageBLL.cs
index 6675717..bec504f 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPageBLL.cs
@@ -53,24 +53,24 @@
         {
             functionRow.MouseUpEventHandler = (sender, e) => {
                 btn.IsSelected = !btn.IsSelected;
-                if (btn.IsSelected)
+                if (changeList.Contains(function))
                 {
-                    function.roomIdList.Add(room.sid);
-                }
-                else
+                    changeList.Remove(function);
+                }else
                 {
-                    function.roomIdList.Remove(room.sid);
+                    changeList.Add(function);
                 }
             };
             btn.MouseUpEventHandler = (sender, e) => {
                 btn.IsSelected = !btn.IsSelected;
-                if (btn.IsSelected)
+
+                if (changeList.Contains(function))
                 {
-                    function.roomIdList.Add(room.sid);
+                    changeList.Remove(function);
                 }
                 else
                 {
-                    function.roomIdList.Remove(room.sid);
+                    changeList.Add(function);
                 }
             };
         }
@@ -104,7 +104,7 @@
                 }
                 btn.IsSelected = true;
                 showedFunctionRoomId = btn.Tag.ToString() == "0" ? null : btn.Tag.ToString();
-                LoadFunctionListRow(allocatedList.FindAll((obj) => obj.roomIdList.Contains(showedFunctionRoomId)));
+                LoadFunctionListRow(allocatedList.FindAll((obj) => obj.roomIds.Contains(showedFunctionRoomId)));
                 btnChoosedRoom.Text = chooseRoomName;
                 dialog.Close();
             };
@@ -116,9 +116,27 @@
         void LoadEvent_SaveRoomData()
         {
             btnConfrim.MouseUpEventHandler = (sender, e) => {
-                room.SaveRoomData();
-                room.GetRoomFunctions(true);
-                bodyView.RemoveFromParent();
+                if (string.IsNullOrEmpty(room.roomId))//鏂板鐨勬埧闂达紝浜戠鏈垱寤簉oomid 鏃犳硶淇濆瓨鏁版嵁
+                {
+                    newRoomAddFunction(changeList);
+                }
+                else
+                {
+                    foreach (var f in changeList)
+                    {
+                        if(f.roomIds.Contains(room.roomId))
+                        {
+                            f.roomIds.Remove(room.roomId);
+                        }
+                        else
+                        {
+                            f.roomIds.Add(room.roomId);
+                        }
+                        f.SaveFunctionData(true);
+                    }
+                    room.GetRoomFunctions(true);
+                    bodyView.RemoveFromParent();
+                }
             };
         }
 

--
Gitblit v1.8.0