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/RoomEditPageBLL.cs | 33 ++++++++++++++++++--------------- 1 files changed, 18 insertions(+), 15 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs index 5b365f0..6ca33ae 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs @@ -59,28 +59,31 @@ return; } } - SpatialInfo.CurrentSpatial.AddRoom(room); - room.SaveRoomData(); - backAction(); - this.RemoveFromParent(); + var addResult = SpatialInfo.CurrentSpatial.AddRoom(room); + if (addResult == StateCode.SUCCESS) + { + backAction(); + this.RemoveFromParent(); + } } if (btnOption.TextID == StringId.DeleteRoom) { Action action = () => { - foreach (var f in DB_ResidenceData.functionList.GetAllFunction()) + var delResult = SpatialInfo.CurrentSpatial.DelRoom(room); + if (delResult == StateCode.SUCCESS) { - if (f.roomIds.Contains(room.roomId)) + foreach (var f in DB_ResidenceData.functionList.GetAllFunction()) { - f.roomIds.Remove(room.roomId); + if (f.roomIds.Contains(room.roomId)) + { + f.roomIds.Remove(room.roomId); + } } + //鍒犻櫎浜嬩欢鍥炶皟 + this.deleteAction?.Invoke(); + this.RemoveFromParent(); } - SpatialInfo.CurrentSpatial.DelRoom(room); - // backAction(); - // DB_ResidenceData.DelRoom(room); - //鍒犻櫎浜嬩欢鍥炶皟 - this.deleteAction?.Invoke(); - this.RemoveFromParent(); }; new PublicAssmebly().TipMsg(StringId.Tip, StringId.DeleteRoomTip, action); }; @@ -155,9 +158,9 @@ { btnFloorInfo.Text = room.floorName; }; - var residentialManagePage = new FloorsManagementPage(floorsCallBackAction); + var residentialManagePage = new RoomBinglingFloorPage(floorsCallBackAction, room); MainPage.BasePageView.AddChidren(residentialManagePage); - residentialManagePage.LoadPage(room, StringId.FloorAssignment); + residentialManagePage.LoadPage(); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; btnFloorInfo.MouseUpEventHandler = eventHandler; -- Gitblit v1.8.0