From 78df3d9006b4fa60c312cbda519096c167c1cf21 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期五, 11 十二月 2020 10:46:43 +0800 Subject: [PATCH] 20201210 --- HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPageBLL.cs | 41 ++++++++++++++++++++--------------------- 1 files changed, 20 insertions(+), 21 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPageBLL.cs index c01c4f8..bec504f 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPageBLL.cs @@ -53,14 +53,6 @@ { functionRow.MouseUpEventHandler = (sender, e) => { btn.IsSelected = !btn.IsSelected; - if (btn.IsSelected) - { - function.roomIds.Add(room.roomId); - } - else - { - function.roomIds.Remove(room.roomId); - } if (changeList.Contains(function)) { changeList.Remove(function); @@ -71,14 +63,7 @@ }; btn.MouseUpEventHandler = (sender, e) => { btn.IsSelected = !btn.IsSelected; - if (btn.IsSelected) - { - function.roomIds.Add(room.roomId); - } - else - { - function.roomIds.Remove(room.roomId); - } + if (changeList.Contains(function)) { changeList.Remove(function); @@ -131,13 +116,27 @@ void LoadEvent_SaveRoomData() { btnConfrim.MouseUpEventHandler = (sender, e) => { - foreach(var f in changeList) + if (string.IsNullOrEmpty(room.roomId))//鏂板鐨勬埧闂达紝浜戠鏈垱寤簉oomid 鏃犳硶淇濆瓨鏁版嵁 { - f.SaveFunctionData(true); + newRoomAddFunction(changeList); } - room.SaveRoomData(); - room.GetRoomFunctions(true); - bodyView.RemoveFromParent(); + 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