HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2020-12-17 9f326f4000847e6167d8166fa2f6a66f53cb3734
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs
@@ -63,8 +63,8 @@
        #endregion
        #region  UI显示  
        /// <summary>
        /// UI显示
        /// <summary>
        /// UI显示
        /// </summary>
        public void Show()
        {
@@ -73,12 +73,6 @@
            EventHandler<MouseEventArgs> eHandlerBack = (sender, e) =>
            {
                RemoveFromParent();
                UserDoorLockPage.canShowDialog = true;
                //暂时不考虑下级界面等推送导致常开模式失效的问题
                //var userDoorLockPage = new UserDoorLockPage(currentRoom, deviceUI);
                //HomePage.Instance.AddChidren(userDoorLockPage);
                //HomePage.Instance.PageIndex += 1;
                //userDoorLockPage.Show();
            };
            this.btnBack.MouseUpEventHandler += eHandlerBack;
            this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack;
@@ -106,7 +100,7 @@
                Gravity = Gravity.CenterHorizontal,
                TextColor = ZigbeeColor.Current.XMBlack,
                TextSize = 15,
                Text = Common.LocalDevice.Current.GetDeviceMacName(doorLock),
                Text = HdlDeviceCommonLogic.Current.GetDeviceMacName(doorLock),
            };
            this.midFrameLayout.AddChidren(btnDeviceText);
@@ -157,15 +151,16 @@
            listview.RemoveAll();
            //设备备注
            string caption = Language.StringByID(R.MyInternationalizationString.DeviceRemarkXm);
            string deviceName = Common.LocalDevice.Current.GetDeviceMacName(doorLock);
            string deviceName = HdlDeviceCommonLogic.Current.GetDeviceMacName(doorLock);
            var btnNote = new FrameCaptionInputControl(caption, deviceName, listview.rowSpace / 2);
            btnNote.txtInput.MaxByte = 48;//限制只能输入48个字节
            listview.AddChidren(btnNote);
            btnNote.InitControl();
            //划线
            btnNote.AddBottomLine();
            btnNote.txtInput.FinishInputEvent += () =>
            {
                string oldName = Common.LocalDevice.Current.GetDeviceMacName(doorLock);
                string oldName = HdlDeviceCommonLogic.Current.GetDeviceMacName(doorLock);
                if (btnNote.Text == string.Empty)
                {
                    btnNote.Text = oldName;
@@ -187,18 +182,18 @@
            var listCheck = new List<string>();
            rowBeloneArea.SelectRoomEvent += (roomKeys) =>
            {
                //选择未分配时,清空
                //选择未分配时,清空
                if (roomKeys == string.Empty) { listCheck = new List<string>(); }
                foreach (var device in this.listNewDevice)
                {
                    if (roomKeys == string.Empty)
                    {
                        //如果选择的是未分配,则它的全部回路无条件全部清空房间
                        HdlRoomLogic.Current.ChangedRoom(device, roomKeys);
                        continue;
                {
                    if (roomKeys == string.Empty)
                    {
                        //如果选择的是未分配,则它的全部回路无条件全部清空房间
                        HdlRoomLogic.Current.ChangedRoom(device, roomKeys);
                        continue;
                    }
                    var room = HdlRoomLogic.Current.GetRoomByDevice(device);
                    string mainKeys = LocalDevice.Current.GetDeviceMainKeys(device);
                    string mainKeys = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(device);
                    if (room == null)
                    {
                        //这里有点特殊,如果回路没有设置有区域的时候,才设置
@@ -212,12 +207,12 @@
                    }
                }
                //保存设备房间索引
                Common.LocalDevice.Current.SaveRealDeviceRoomId(this.listNewDevice, roomKeys);
                HdlRoomLogic.Current.SaveRealDeviceRoomId(this.listNewDevice, roomKeys);
            };
            //设备模块
            caption = Language.StringByID(R.MyInternationalizationString.BelongDevice);
            deviceName = Common.LocalDevice.Current.GetDeviceObjectText(listNewDevice);
            deviceName = HdlDeviceCommonLogic.Current.GetDeviceObjectText(listNewDevice);
            var btnType = new FrameCaptionViewControl(caption, deviceName, listview.rowSpace / 2);
            btnType.UseClickStatu = false;
            listview.AddChidren(btnType);
@@ -235,7 +230,7 @@
            bottomFrameLayout.AddChidren(btnFinish);
            btnFinish.ButtonClickEvent += (sender, e) =>
            {
                string oldName = Common.LocalDevice.Current.GetDeviceMacName(listNewDevice[0]);
                string oldName = HdlDeviceCommonLogic.Current.GetDeviceMacName(listNewDevice[0]);
                if (btnNote.Text.Trim() == string.Empty)
                {
                    btnNote.Text = oldName;
@@ -260,7 +255,7 @@
        /// </summary>
        private void AddAllMenuRow()
        {
            if (UserCenterResourse.UserInfo.AuthorityNo == 1)
            if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 1)
            {
                //添加【临时密码】行
                this.AddTempPasswordRow();
@@ -336,7 +331,7 @@
            btnswitch.ButtonClickEvent += async (sender, e) =>
            {
                if (UserCenterResourse.UserInfo.AuthorityNo == 1)
                if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 1)
                {
                    if (btnswitch.IsSelected == true)
                    {
@@ -400,7 +395,7 @@
            var doorLock = this.listNewDevice[0] as ZigBee.Device.DoorLock;
            btnRow.ButtonClickEvent += async (sender, e) =>
            {
                if (UserCenterResourse.UserInfo.AuthorityNo == 1)
                if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 1)
                {
                    var tempPage = new Shared.Phone.UserCenter.DoorLock.TimeSettignPage(doorLock, "DoorLockTime");
                    Shared.Phone.UserView.HomePage.Instance.AddChidren(tempPage);
@@ -432,14 +427,14 @@
        /// 设备重命名
        /// </summary>
        /// <param name="i_deviceName">deviceName.</param>
        private async void DeviceReName(string i_deviceName, bool closeForm)
        private void DeviceReName(string i_deviceName, bool closeForm)
        {
            //开启进度条
            this.ShowProgressBar();
            //修改MAC名
            string deviceName = i_deviceName.Trim();
            var result = await Common.LocalDevice.Current.ReMacName(listNewDevice, deviceName);
            var result = HdlDeviceCommonLogic.Current.ReMacName(listNewDevice, deviceName);
            //关闭进度条
            this.CloseProgressBar();