From 33656fa9abd15ed00a390024b439568d2713ca1a Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期日, 06 十二月 2020 17:44:36 +0800 Subject: [PATCH] 2020-12-06 1.修改挤下线判断标记。2.修改房间和场景加载云端图片路径 --- 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 cee7417..c3c4ca3 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs @@ -31,7 +31,7 @@ { if (btnOption.TextID == StringId.Save) { - if (string.IsNullOrEmpty(room.name)) + if (string.IsNullOrEmpty(room.roomName)) { new Tip() { @@ -51,15 +51,15 @@ }.Show(bodyView); return; } - foreach (var tempRoom in DB_ResidenceData.rooms) + foreach (var tempRoom in DB_ResidenceData.residenceData.Rooms) { - if (room.name == tempRoom.name) + if (room.roomName == tempRoom.roomName) { new PublicAssmebly().TipMsg(StringId.Tip, StringId.AddingFailed_RoomAlreadyExists); return; } } - DB_ResidenceData.rooms.Add(room); + SpatialInfo.CurrentSpatial.AddRoom(room); room.SaveRoomData(); backAction(); this.RemoveFromParent(); @@ -70,12 +70,14 @@ { foreach (var f in DB_ResidenceData.functionList.GetAllFunction()) { - if (f.roomIds.Contains(room.sid)) + if (f.roomIds.Contains(room.uid)) { - f.roomIds.Remove(room.sid); + f.roomIds.Remove(room.uid); } } - DB_ResidenceData.DelRoom(room); + SpatialInfo.CurrentSpatial.DelRoom(room); + // backAction(); + // DB_ResidenceData.DelRoom(room); //鍒犻櫎浜嬩欢鍥炶皟 this.deleteAction?.Invoke(); this.RemoveFromParent(); @@ -115,7 +117,7 @@ return; } btnRoomName.Text = str; - room.name = str; + room.roomName = str; if (pageTitleId == StringId.EditRoomInfo) { room.SaveRoomData(); @@ -124,17 +126,17 @@ EventHandler<MouseEventArgs> eventHandler = (sender, e) => { List<string> roomNameList = new List<string>(); - foreach (var rroom in DB_ResidenceData.rooms) + foreach (var rroom in DB_ResidenceData.residenceData.Rooms) { - roomNameList.Add(rroom.name); + roomNameList.Add(rroom.roomName); } if (pageTitleId == StringId.AddRoom) { - new PublicAssmebly().LoadDialog_EditParater(StringId.RoomName, room.name, callBack, StringId.RoomNameCannotBeEmpty, StringId.RoomNameAlreadyExists, roomNameList); + new PublicAssmebly().LoadDialog_EditParater(StringId.RoomName, room.roomName, callBack, StringId.RoomNameCannotBeEmpty, StringId.RoomNameAlreadyExists, roomNameList); } else { - new PublicAssmebly().LoadDialog_EditParater(StringId.RoomName, room.name, callBack, StringId.RoomNameCannotBeEmpty, StringId.EidtFailed_RoomAlreadyExists, roomNameList); + new PublicAssmebly().LoadDialog_EditParater(StringId.RoomName, room.roomName, callBack, StringId.RoomNameCannotBeEmpty, StringId.EidtFailed_RoomAlreadyExists, roomNameList); } }; btnEditRoomNameIcon.MouseUpEventHandler = eventHandler; @@ -307,6 +309,7 @@ { room.SaveRoomData(); + } }; //涓婁紶鍥剧墖鍒颁簯绔� @@ -336,12 +339,12 @@ { try { - var newImageName = mRoom.name.Trim() + ".png"; + var newImageName = mRoom.roomName.Trim() + ".png"; var uploadImageObj = new UploadImageObj() { prefix = "ONR", fileName = newImageName, - uid = mRoom.sid, + uid = mRoom.uid, content = imageBytes, }; @@ -353,7 +356,7 @@ { Utlis.WriteLine("涓婁紶鎴愬姛锛�" + imageUrl); //1.2濡傛灉鏄嚜瀹氫箟鍥剧墖鍒犻櫎涔嬪墠鐨� - if (!imageView.ImagePath.Contains("Classification/Room/Roombg")) + if (!string.IsNullOrEmpty(imageView.ImagePath) && !imageView.ImagePath.Contains("Classification/Room/Roombg")) { Utlis.WriteLine("鍒犻櫎: " + imageView.ImagePath); System.IO.File.Delete(imageView.ImagePath); -- Gitblit v1.8.0