gxc
2019-10-28 1c4904d77f484c075080942d87785481b52b6fb2
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();
            //该APP为有楼层的模式才开启这个菜单
            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);