gxc
2019-10-29 081ea8d273048fd03756718ac6fb48a3c09218e9
ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
@@ -12,6 +12,10 @@
        #region ■ 变量声明___________________________
        /// <summary>
        /// 结束编辑名称的事件
        /// </summary>
        public Action<string> FinishEditorEvent = null;
        /// <summary>
        /// 列表控件
        /// </summary>
        private VerticalListControl listview = null;
@@ -82,19 +86,23 @@
            //底线
            txtRoomName.AddBottomLine();
            //【所属楼层】
            var btnBelone = new FrameCaptionViewControl(Language.StringByID(R.MyInternationalizationString.uBelongeFloor), Common.Config.Instance.Home.FloorDics[this.cloneRoom.FloorId], this.listview.rowSpace / 2);
            listview.AddChidren(btnBelone);
            btnBelone.InitControl();
            //右箭头
            btnBelone.AddRightArrow();
            //底线
            btnBelone.AddBottomLine();
            btnBelone.ButtonClickEvent += (sender, e) =>
            //该APP为有楼层的模式才开启这个菜单
            if (string.IsNullOrEmpty(this.cloneRoom.FloorId) == false)
            {
                //楼层选择
                this.ShowSelectFloor(btnBelone);
            };
                //【所属楼层】
                var btnBelone = new FrameCaptionViewControl(Language.StringByID(R.MyInternationalizationString.uBelongeFloor), Common.Config.Instance.Home.FloorDics[this.cloneRoom.FloorId], this.listview.rowSpace / 2);
                listview.AddChidren(btnBelone);
                btnBelone.InitControl();
                //右箭头
                btnBelone.AddRightArrow();
                //底线
                btnBelone.AddBottomLine();
                btnBelone.ButtonClickEvent += (sender, e) =>
                {
                    //楼层选择
                    this.ShowSelectFloor(btnBelone);
                };
            }
            //【温度】
            var rowTemperature = new FrameRowControl(this.listview.rowSpace / 2);
@@ -152,6 +160,8 @@
                    return;
                }
                editorRoom.Save();
                FinishEditorEvent?.Invoke(this.cloneRoom.Name);
                this.CloseForm();
            };
        }
@@ -378,6 +388,8 @@
        /// </summary>
        public override void CloseForm()
        {
            this.FinishEditorEvent = null;
            HdlDeviceAttributeLogic.Current.RemoveEvent("TemperatrueDevice");
            HdlDeviceAttributeLogic.Current.RemoveEvent("HumidityDevice");
@@ -400,11 +412,24 @@
                this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uPleaseInputRoomName));
                return false;
            }
            if (Shared.Common.Room.Lists.Find((obj) => obj.Name == this.cloneRoom.Name && obj.Id != this.cloneRoom.Id) != null)
            if (string.IsNullOrEmpty(this.cloneRoom.FloorId) == true)
            {
                this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.HadSameRoom));
                return false;
                if (Shared.Common.Room.Lists.Find((obj) => obj.Name == this.cloneRoom.Name && obj.Id != this.cloneRoom.Id) != null)
                {
                    this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.HadSameRoom));
                    return false;
                }
            }
            else
            {
                var listRoom = Common.Room.CurrentRoom.GetFloorSortRoom(this.cloneRoom.FloorId);
                if (listRoom.Find((obj) => obj.Name == this.cloneRoom.Name && obj.Id != this.cloneRoom.Id) != null)
                {
                    this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.HadSameRoom));
                    return false;
                }
            }
            if (cloneRoom.BackgroundImageType == 1 || cloneRoom.BackgroundImageType == 2)
            {
                this.cloneRoom.MoveBackGroundIamageFileToDirectory(cloneRoom.BackgroundImage, cloneRoom.BackgroundImage);