From 2ed75b8b337048e5d75e6d9ec8307633134f02fd Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 10 十月 2019 11:33:04 +0800
Subject: [PATCH] 个人中心添加楼层和创建房间,实装二级验证

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
index 991b648..2754542 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
@@ -96,6 +96,37 @@
             //鍒掔嚎
             btnType.AddBottomLine();
 
+            //鎵�灞炲尯鍩�
+            var rowBeloneArea = new BelongAreaControl(listview.rowSpace / 2);
+            listview.AddChidren(rowBeloneArea);
+            rowBeloneArea.InitControl(Language.StringByID(R.MyInternationalizationString.uBelongArea), this.listNewDevice);
+            //搴曠嚎
+            rowBeloneArea.AddBottomLine();
+
+            var listCheck = new List<string>();
+            rowBeloneArea.SelectRoomEvent += (roomKeys) =>
+            {
+                foreach (var device in this.listNewDevice)
+                {
+                    //淇濆瓨杩欎釜璁惧灞炰簬鍝釜鍖哄煙
+                    device.DeviceRoomId = roomKeys;
+                    device.ReSave();
+                    var room = Common.Room.CurrentRoom.GetRoomByDevice(device);
+                    string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
+                    if (room == null)
+                    {
+                        //杩欓噷鏈夌偣鐗规畩,濡傛灉鍥炶矾娌℃湁璁剧疆鏈夊尯鍩熺殑鏃跺��,鎵嶈缃�
+                        listCheck.Add(mainKeys);
+                        Common.Room.CurrentRoom.ChangedRoom(device, roomKeys);
+                    }
+                    else if (listCheck.Contains(mainKeys) == true)
+                    {
+                        //濡傛灉杩欎釜鍥炶矾涔嬪墠閮借繕娌℃湁鍖哄煙,鍦ㄦ湰鐣岄潰杩樻病鏈夊叧闂箣鍓�,鍙互鏃犳潯浠堕殢渚垮彉鏇�
+                        Common.Room.CurrentRoom.ChangedRoom(device, roomKeys);
+                    }
+                }
+            };
+
             //鏇村閰嶇疆
             var btnHelp = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(49), false);
             btnHelp.Y = Application.GetRealHeight(1388);

--
Gitblit v1.8.0