From 1c4904d77f484c075080942d87785481b52b6fb2 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期一, 28 十月 2019 14:58:46 +0800
Subject: [PATCH] Revert "Merge branch 'dev-tzy' into DEV_GXC"

---
 ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs |   55 +++++++++++++++----------------------------------------
 1 files changed, 15 insertions(+), 40 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs
index 0a8979a..df60c3a 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs
@@ -12,10 +12,6 @@
         #region 鈻� 鍙橀噺澹版槑___________________________
 
         /// <summary>
-        /// 瀹屾垚娣诲姞鎴块棿鐨勪簨浠�
-        /// </summary>
-        public Action FinishEditorEvent = null;
-        /// <summary>
         /// 鍒楄〃鎺т欢
         /// </summary>
         private VerticalListControl listview = null;
@@ -89,23 +85,19 @@
             //搴曠嚎
             txtRoomName.AddBottomLine();
 
-            //璇PP涓烘湁妤煎眰鐨勬ā寮忔墠寮�鍚繖涓彍鍗�
-            if (floorKeys != string.Empty)
+            //銆愭墍灞炴ゼ灞傘��
+            var btnBelone = new FrameCaptionViewControl(Language.StringByID(R.MyInternationalizationString.uBelongeFloor), Common.Config.Instance.Home.FloorDics[this.floorKeys], this.listview.rowSpace / 2);
+            listview.AddChidren(btnBelone);
+            btnBelone.InitControl();
+            //鍙崇澶�
+            btnBelone.AddRightArrow();
+            //搴曠嚎
+            btnBelone.AddBottomLine();
+            btnBelone.ButtonClickEvent += (sender, e) =>
             {
-                //銆愭墍灞炴ゼ灞傘��
-                var btnBelone = new FrameCaptionViewControl(Language.StringByID(R.MyInternationalizationString.uBelongeFloor), Common.Config.Instance.Home.FloorDics[this.floorKeys], this.listview.rowSpace / 2);
-                listview.AddChidren(btnBelone);
-                btnBelone.InitControl();
-                //鍙崇澶�
-                btnBelone.AddRightArrow();
-                //搴曠嚎
-                btnBelone.AddBottomLine();
-                btnBelone.ButtonClickEvent += (sender, e) =>
-                {
-                    //妤煎眰閫夋嫨
-                    this.ShowSelectFloor(btnBelone);
-                };
-            }
+                //妤煎眰閫夋嫨
+                this.ShowSelectFloor(btnBelone);
+            };
 
             //銆愭俯搴︺��
             var rowTemperature = new FrameRowControl(this.listview.rowSpace / 2);
@@ -160,8 +152,6 @@
                 }
                 else
                 {
-                    this.FinishEditorEvent?.Invoke();
-
                     this.CloseForm();
                 }
             };
@@ -389,8 +379,6 @@
         /// </summary>
         public override void CloseForm()
         {
-            this.FinishEditorEvent = null;
-
             HdlDeviceAttributeLogic.Current.RemoveEvent("TemperatrueDevice");
             HdlDeviceAttributeLogic.Current.RemoveEvent("HumidityDevice");
 
@@ -413,24 +401,11 @@
                 this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uPleaseInputRoomName));
                 return false;
             }
-            if (string.IsNullOrEmpty(this.floorKeys) == true)
+            if (Shared.Common.Room.Lists.Find((obj) => obj.Name == this.newRoom.Name) != null)
             {
-                if (Shared.Common.Room.Lists.Find((obj) => obj.Name == this.newRoom.Name && obj.Id != this.newRoom.Id) != null)
-                {
-                    this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uRoomNameIsExist));
-                    return false;
-                }
+                this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.HadSameRoom));
+                return false;
             }
-            else
-            {
-                var listRoom = Common.Room.CurrentRoom.GetFloorSortRoom(this.floorKeys);
-                if (listRoom.Find((obj) => obj.Name == this.newRoom.Name && obj.Id != this.newRoom.Id) != null)
-                {
-                    this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uRoomNameIsExist));
-                    return false;
-                }
-            }
-
             if (newRoom.BackgroundImageType == 1 || newRoom.BackgroundImageType == 2)
             {
                 this.newRoom.MoveBackGroundIamageFileToDirectory(newRoom.BackgroundImage, newRoom.BackgroundImage);

--
Gitblit v1.8.0