JLChen
2020-12-12 b3abfd30576871c32f2839a322fa3bb783f96498
HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPageBLL.cs
@@ -120,6 +120,11 @@
            EventHandler<MouseEventArgs> eventHandler2 = (sender, e) =>
            {
                bool result = !btnStartupBg.IsSelected;
                if (!result)
                {
                    //如果启动解锁 不能取消启动解锁
                    if (!CheckIfCanDeselect("1")) return;
                }
                btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = result;
                btnTipMsg.Text = Language.StringByID(StringId.AtStartupTipMsg);
@@ -158,6 +163,12 @@
            EventHandler<MouseEventArgs> eventHandler3 = (sender, e) =>
            {
                bool result = !btnSecurityBg.IsSelected;
                if (!result)
                {
                    //如果只剩布防/撤防一种 不能取消布防/撤防
                    if (!CheckIfCanDeselect("2")) return;
                }
                btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = result;
                btnTipMsg.Text = Language.StringByID(StringId.DefenseAndUndefenseTipMsg);
@@ -197,6 +208,12 @@
            EventHandler<MouseEventArgs> eventHandler4 = (sender, e) =>
            {
                bool result = !btnDoorlockBg.IsSelected;
                if (!result)
                {
                    //如果只剩远程开锁不能取消远程开锁
                    if (!CheckIfCanDeselect("3")) return;
                }
                btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = result;
                btnTipMsg.Text = Language.StringByID(StringId.RemoteUnlockingTipMsg);
@@ -363,5 +380,21 @@
                };
            }
        }
        /// <summary>
        /// 判断是否能够取消,如果只剩最后一种解锁方案禁止取消
        /// </summary>
        /// <param name="appUnlockPageType">1:启动时 2:布防撤防时 3:远程开锁时</param>
        /// <returns></returns>
        bool CheckIfCanDeselect(string appUnlockPageType)
        {
            if (UserInfo.Current.appUnlockPage.Count == 1 && UserInfo.Current.appUnlockPage.Contains(appUnlockPageType))
            {
                return false;
            }
            return true;
        }
    }
}