From b3abfd30576871c32f2839a322fa3bb783f96498 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期六, 12 十二月 2020 19:10:10 +0800 Subject: [PATCH] 2020-12-12 1.解锁逻辑优化 --- HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs | 39 +++++++++++++++++++++------------------ 1 files changed, 21 insertions(+), 18 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs index 5c2cbb0..7098834 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs @@ -51,7 +51,7 @@ }.Show(bodyView); return; } - foreach (var tempRoom in DB_ResidenceData.residenceData.Rooms) + foreach (var tempRoom in SpatialInfo.CurrentSpatial.RoomList) { if (room.roomName == tempRoom.roomName) { @@ -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.uid)) + foreach (var f in DB_ResidenceData.functionList.GetAllFunction()) { - f.roomIds.Remove(room.uid); + 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); }; @@ -126,7 +129,7 @@ EventHandler<MouseEventArgs> eventHandler = (sender, e) => { List<string> roomNameList = new List<string>(); - foreach (var rroom in DB_ResidenceData.residenceData.Rooms) + foreach (var rroom in SpatialInfo.CurrentSpatial.RoomList) { roomNameList.Add(rroom.roomName); } @@ -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; @@ -362,7 +365,7 @@ System.IO.File.Delete(imageView.ImagePath); } //閲嶅懡鍚嶄繚瀛� - FileUtils.WriteFileByBytes(imageUrl, imageBytes); + ImageUtlis.Current.WriteFileByBytes(imageUrl, imageBytes); imageView.ImagePath = null; imageView.ImageBytes = imageBytes; //涓婁紶鎴愬姛 -- Gitblit v1.8.0