From 9ed4d6675aa1f0abe20e3f84e92f5ac2da8ab4f4 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期六, 12 十二月 2020 20:02:00 +0800
Subject: [PATCH] 20201212-4

---
 HDL-ON_iOS/Resources/Language.ini                                              |    1 
 HDL_ON/Entity/Room.cs                                                          |   16 +++++--
 HDL_ON/Common/R.cs                                                             |    1 
 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/AddRoomPage.cs           |    6 ++
 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/RoomBinglingFloorPage.cs |    2 
 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/FloorsManagementPage.cs          |    2 
 .vs/HDL_APP_Project/xs/UserPrefs.xml                                           |   48 +++++++++++++++--------
 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs               |    2 
 8 files changed, 52 insertions(+), 26 deletions(-)

diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml
index 5da2499..a7f621d 100644
--- a/.vs/HDL_APP_Project/xs/UserPrefs.xml
+++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,6 +1,18 @@
-锘�<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
-  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008030-00014C392121802E" />
-  <MonoDevelop.Ide.Workbench>
+锘�<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
+  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.6242be7109c740c6cb8999a8904b6e0ea8d45192" />
+  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/Entity/Room.cs">
+    <Files>
+      <File FileName="HDL_ON/DAL/Server/HttpServerRequest.cs" Line="1878" Column="32" />
+      <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePage.cs" Line="163" Column="56" />
+      <File FileName="HDL_ON/UI/UI1-Login/LoginPage.cs" Line="1" Column="1" />
+      <File FileName="HDL-ON_iOS/AppDelegate.cs" Line="342" Column="46" />
+      <File FileName="HDL_ON/Common/OnAppConfig.cs" Line="136" Column="22" />
+      <File FileName="HDL_ON/Common/FileUtlis.cs" Line="21" Column="10" />
+      <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" Line="149" Column="74" />
+      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/RoomBinglingFloorPage.cs" Line="221" Column="1" />
+      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/AddRoomPage.cs" Line="448" Column="67" />
+      <File FileName="HDL_ON/Entity/Room.cs" Line="366" Column="23" />
+    </Files>
     <Pads>
       <Pad Id="ProjectPad">
         <State name="__root__">
@@ -8,29 +20,27 @@
             <Node name="HDL_ON" expanded="True">
               <Node name="Common" expanded="True" />
               <Node name="DAL" expanded="True">
+                <Node name="DriverLayer" expanded="True" />
                 <Node name="Server" expanded="True" />
               </Node>
-              <Node name="Entity" expanded="True" />
+              <Node name="Entity" expanded="True">
+                <Node name="Function" expanded="True" />
+                <Node name="ResponseEntity" expanded="True" />
+                <Node name="Room.cs" selected="True" />
+              </Node>
               <Node name="UI" expanded="True">
-                <Node name="UI1-Login" expanded="True" />
+                <Node name="CSS" expanded="True" />
                 <Node name="UI2" expanded="True">
                   <Node name="4-PersonalCenter" expanded="True">
-                    <Node name="RoomListManage" expanded="True" />
-                    <Node name="UnlockSetting" expanded="True" />
+                    <Node name="RoomListManage" expanded="True">
+                      <Node name="AddRoom" expanded="True" />
+                    </Node>
                   </Node>
                 </Node>
               </Node>
             </Node>
-            <Node name="HDL-ON_Android" expanded="True">
-              <Node name="Assets" expanded="True" />
-              <Node name="Resources" expanded="True">
-                <Node name="values" expanded="True" />
-              </Node>
-            </Node>
             <Node name="HDL-ON_iOS" expanded="True">
-              <Node name="Other" expanded="True" />
               <Node name="Resources" expanded="True" />
-              <Node name="AppDelegate.cs" selected="True" />
             </Node>
           </Node>
         </State>
@@ -44,9 +54,13 @@
     <String>Shared.IOS/Shared.IOS.csproj</String>
   </DisabledProjects>
   <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" />
-  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.364c4b3158493098" />
+  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" />
   <MonoDevelop.Ide.DebuggingService.Breakpoints>
-    <BreakpointStore />
+    <BreakpointStore>
+      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs" relfile="HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs" line="136" column="1" />
+      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/1-HomePage/HomePage.cs" relfile="HDL_ON/UI/UI2/1-HomePage/HomePage.cs" line="163" column="1" />
+      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Entity/Room.cs" relfile="HDL_ON/Entity/Room.cs" line="371" column="1" />
+    </BreakpointStore>
   </MonoDevelop.Ide.DebuggingService.Breakpoints>
   <MultiItemStartupConfigurations />
 </Properties>
\ No newline at end of file
diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini
index 0ca9301..17f5a50 100644
--- a/HDL-ON_iOS/Resources/Language.ini
+++ b/HDL-ON_iOS/Resources/Language.ini
@@ -392,6 +392,7 @@
 370=鎴愪负瀹跺涵鎴愬憳
 371=鍔熻兘鏃犳硶浣跨敤锛岃缁戝畾缃戝叧
 372=鏃犳硶鍒涘缓鍦烘櫙锛岃缁戝畾缃戝叧
+373=娣诲姞妤煎眰澶辫触銆�
 
 5000=闊充箰
 5001=缁勫悎
diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs
index c4b0cf6..7bfbf1a 100644
--- a/HDL_ON/Common/R.cs
+++ b/HDL_ON/Common/R.cs
@@ -4,6 +4,7 @@
 {
     public static class StringId
     {
+        public const int AddFloorFail = 373;
         public const int UnableToCreateScenarioPleaseBindGateway = 372;
         public const int FunctionCannotBeUsedPleaseBindGateway = 371;
         public const int TobeFamily = 370;
diff --git a/HDL_ON/Entity/Room.cs b/HDL_ON/Entity/Room.cs
index 60c8e35..dcad772 100644
--- a/HDL_ON/Entity/Room.cs
+++ b/HDL_ON/Entity/Room.cs
@@ -247,7 +247,7 @@
         /// 澧炲姞妤煎眰
         /// </summary>
         /// <param name="floor"></param>
-        public string AddFloor(SpatialInfo floor)
+        public string AddFloor(SpatialInfo floor, out SpatialInfo newFloor)
         {
             var pm = new HttpServerRequest();
             var revPack = new ResponsePackNew();
@@ -255,10 +255,10 @@
             if (revPack.Code == StateCode.SUCCESS)
             {
                 var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SpatialInfo>>(revPack.Data.ToString());
-                if(revData.Count>0)
+                if (revData.Count > 0)
                 {
                     var addFloor = revData.Find((obj) => obj.uid == floor.uid);
-                    if(addFloor!= null)
+                    if (addFloor != null)
                     {
                         CurrentSpatial.FloorList.Add(addFloor);
                         floor = addFloor;
@@ -267,6 +267,11 @@
                 var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(CurrentSpatial.FloorList));
                 Common.FileUtlis.Files.WriteFileByBytes(dataSavePath, ssd);
             }
+            else
+            {
+                Utlis.ShowTip(Language.StringByID(StringId.AddFloorFail) + "\r\nCode:" + revPack.Code);
+            }
+            newFloor = floor;
             return revPack.Code;
         }
         /// <summary>
@@ -358,7 +363,7 @@
         /// 澧炲姞鎴块棿
         /// </summary>
         /// <param name="room"></param>
-        public string AddRoom(Room room)
+        public string AddRoom(Room room,out Room newRoom)
         {
             var pm = new HttpServerRequest();
             var pack = pm.AddRoom(new List<SpatialInfo>() { room });
@@ -373,7 +378,7 @@
                         var tempRoom = revData.Find((obj) => obj.uid == room.uid);
                         if (tempRoom != null)
                         {
-                            room = tempRoom as Room;
+                            room.roomId = tempRoom.roomId;
                             CurrentSpatial.RoomList.Add(room);
                             var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(room));
                             Common.FileUtlis.Files.WriteFileByBytes(dataSavePath, ssd);
@@ -381,6 +386,7 @@
                     }
                 }
             }
+            newRoom = room;
             return pack.Code;
         }
         /// <summary>
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..cc90c39 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>();
@@ -456,6 +456,10 @@
                     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);
                     }
                     else
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/RoomBinglingFloorPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/RoomBinglingFloorPage.cs
index 2751883..9921913 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/RoomBinglingFloorPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/RoomBinglingFloorPage.cs
@@ -95,7 +95,7 @@
             try
             {
                 var f = new SpatialInfo("FLOOR") { roomName = floorName, parentId = UserInfo.Current.CurReginID };
-                var addResult = SpatialInfo.CurrentSpatial.AddFloor(f);
+                var addResult = SpatialInfo.CurrentSpatial.AddFloor(f,out f);
                 if (addResult == DAL.Server.StateCode.SUCCESS)
                 {
                     LoadFloorRow(f);
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/FloorsManagementPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/FloorsManagementPage.cs
index 2b6f794..62f4d70 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/FloorsManagementPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/FloorsManagementPage.cs
@@ -126,7 +126,7 @@
             try
             {
                 var f = new SpatialInfo("FLOOR") { roomName = floorName, parentId = UserInfo.Current.CurReginID };
-                var addResult = SpatialInfo.CurrentSpatial.AddFloor(f);
+                var addResult = SpatialInfo.CurrentSpatial.AddFloor(f,out f);
                 if (addResult == DAL.Server.StateCode.SUCCESS)
                 {
                     LoadFloorRow(f);
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs
index 1de6f47..7e32122 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs
@@ -59,7 +59,7 @@
                             return;
                         }
                     }
-                    var addResult = SpatialInfo.CurrentSpatial.AddRoom(room);
+                    var addResult = SpatialInfo.CurrentSpatial.AddRoom(room,out room);
                     if (addResult == StateCode.SUCCESS)
                     {
                         backAction();

--
Gitblit v1.8.0