From 56b417e5bcdf4f34ddcda8c7e56fbac6584e615e Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 07 十二月 2020 17:24:54 +0800
Subject: [PATCH] 2020-12-7-02

---
 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs |   30 ++++++++++++++++--------------
 1 files changed, 16 insertions(+), 14 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..59a8daf 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;
@@ -336,12 +338,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,
                         };
 

--
Gitblit v1.8.0