From 09dfbfd9b77ec887c17b10f15799a1d3f56e4e17 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 15 十二月 2020 12:04:42 +0800
Subject: [PATCH] 2020-12-15-1

---
 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/AddRoomPage.cs |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/AddRoomPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/AddRoomPage.cs
index b5bc984..e57df22 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/AddRoomPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/AddRoomPage.cs
@@ -445,7 +445,7 @@
                         return;
                     }
                 }
-                var addResult = SpatialInfo.CurrentSpatial.AddRoom(room);//妫�鏌oom鏄惁涓轰簯绔繑鍥炵殑鏈�鏂版暟鎹�
+                var addResult = SpatialInfo.CurrentSpatial.AddRoom(room,out room);//妫�鏌oom鏄惁涓轰簯绔繑鍥炵殑鏈�鏂版暟鎹�
                 if (addResult == StateCode.SUCCESS)
                 {
                     var deviceIds = new List<string>();
@@ -453,14 +453,17 @@
                     {
                         deviceIds.Add(f.deviceId);
                     }
-                    var bindResult = FunctionList.List.FunctionsBindRooms(new List<string>() { room.roomId }, deviceIds);
-                    if (bindResult == StateCode.SUCCESS)
+                    if (deviceIds.Count > 0)
                     {
-                        room.GetRoomFunctions(true);
-                    }
-                    else
-                    {
-                        //Utlis.ShowTip(Language.StringByID(StringId.EditFunctionInfoFail) + "\r\nCode:" + pack.Code);
+                        var bindResult = FunctionList.List.FunctionsBindRooms(new List<string>() { room.roomId }, deviceIds);
+                        if (bindResult == StateCode.SUCCESS)
+                        {
+                            foreach (var f in roomFunctions)
+                            {
+                                f.roomIds.Add(room.roomId);
+                            }
+                            room.GetRoomFunctions(true);
+                        }
                     }
                     backAction(room);
                     RemoveFromParent();

--
Gitblit v1.8.0