From 4f40e8385ff6725be8e8b642e50f9f7201a27dfa Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期五, 11 十二月 2020 15:58:32 +0800 Subject: [PATCH] Merge branch 'NewFilePath' of http://172.16.1.23:6688/r/~wxr/HDL_APP_Project into NewFilePath --- HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs | 43 +++++++++++++++++++++++-------------------- 1 files changed, 23 insertions(+), 20 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs index c3c4ca3..185b8b8 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.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); }; @@ -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; @@ -326,7 +329,7 @@ { try { - MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + selectImagePath); + //MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + selectImagePath); //1.璇诲彇瑁佸壀鍚庣殑鍥剧墖锛岀劧鍚庡垹闄� var imageBytes = Shared.IO.FileUtils.ReadFile(selectImagePath); System.IO.File.Delete(selectImagePath); @@ -342,7 +345,7 @@ var newImageName = mRoom.roomName.Trim() + ".png"; var uploadImageObj = new UploadImageObj() { - prefix = "ONR", + prefix = "Room" + Utlis.GetTimestamp(), fileName = newImageName, uid = mRoom.uid, content = imageBytes, @@ -354,15 +357,15 @@ //涓婁紶鎴愬姛 Application.RunOnMainThread(() => { - Utlis.WriteLine("涓婁紶鎴愬姛锛�" + imageUrl); + //Utlis.WriteLine("涓婁紶鎴愬姛锛�" + imageUrl); //1.2濡傛灉鏄嚜瀹氫箟鍥剧墖鍒犻櫎涔嬪墠鐨� if (!string.IsNullOrEmpty(imageView.ImagePath) && !imageView.ImagePath.Contains("Classification/Room/Roombg")) { - Utlis.WriteLine("鍒犻櫎: " + imageView.ImagePath); + //Utlis.WriteLine("鍒犻櫎: " + imageView.ImagePath); System.IO.File.Delete(imageView.ImagePath); } //閲嶅懡鍚嶄繚瀛� - FileUtils.WriteFileByBytes(imageUrl, imageBytes); + Common.FileUtlis.Files.WriteFileByBytes(imageUrl, imageBytes); imageView.ImagePath = null; imageView.ImageBytes = imageBytes; //涓婁紶鎴愬姛 -- Gitblit v1.8.0